diff --git a/database/drivers/postgres/parse.go b/database/drivers/postgres/parse.go index 3b30c7c..760d652 100644 --- a/database/drivers/postgres/parse.go +++ b/database/drivers/postgres/parse.go @@ -206,6 +206,7 @@ func queryEnums(log *log.Logger, db *sql.DB, schemas []string) (map[string][]*da SELECT n.nspname, t.typname as type FROM pg_type t LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace + JOIN pg_enum e ON t.oid = e.enumtypid WHERE (t.typrelid = 0 OR (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = t.typrelid)) AND NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type el WHERE el.oid = t.typelem AND el.typarray = t.oid) AND n.nspname IN (%s)` diff --git a/site/content/templates/data.md b/site/content/templates/data.md index 75035ba..4134a80 100644 --- a/site/content/templates/data.md +++ b/site/content/templates/data.md @@ -92,12 +92,16 @@ have the following properties: | Property | Type | Description | | --- | ---- | --- | | ConnStr | string | the connection string for the database +| DBType | string | the type of db | Schemas | list of string | the schema names to generate files for | IncludeTables | map[string] list of string | whitelist map of schema names to table names in that schema to generate files for. | ExcludeTables | map[string] list of string | blacklist map of schema names to table names in that schema to not generate files for. | PostRun | list of string | the command to run on files after generation | TypeMap | map[string]string | map of DBNames to converted names for column types | NullableTypeMap | map[string]string | map of DBNames to converted names for column types (used when Nullable=true) +| PluginDirs | list of string | ordered list of directories to look in for plugins +| OutputDir | string | the directory where gnorm should output all its data +| StaticDir | string | the directory from which to statically copy files to outputdir ### Enum