1
+ # ConnStr is the connection string for the database. Any environment variables
2
+ # in this string will be expanded, so for example dbname=$MY_DDB will do the
3
+ # right thing.
4
+ # MySQL example:
5
+ # ConnStr = "root:admin@tcp/"
6
+ # Postgres example:
7
+ ConnStr = " dbname=postgres host=127.0.0.1 sslmode=disable user=postgres password=password"
8
+
9
+ DBType = " postgres"
10
+
11
+ Schemas = [" public" ]
12
+
13
+ # TODO: add linting
14
+ PostRun = [" ../scripts/post-process.sh" , " join-monster" , " $GNORMFILE" ]
15
+
16
+ NameConversion = " {{camel .}}"
17
+
18
+ # This will output the files in a subdirectory called "gnorm". You can change
19
+ # this, but if you do, change the RootPkg definition below to match what the
20
+ # package name should be.
21
+ OutputDir = " ./generated"
22
+
23
+ ExcludeTables = [" knex_migrations" , " knex_migrations_lock" ]
24
+
25
+ # PluginDirs = ["./templates/plugin"]
26
+
27
+ [Params ]
28
+ # RootPkg is the package declaration for the output dir. It should match the
29
+ # directory name above. You may change this as appropriate.
30
+ # RootPkg = "generated"
31
+
32
+ # RootImport = "gitlab.com/stackworx.io/metcon/generated"
33
+
34
+ [SchemaPaths ]
35
+ # "fields.go" = "templates/fields.gotmpl"
36
+ # "db.go" = "templates/db.gotmpl"
37
+ "{{toLower .Schema}}/index.ts" = " templates/table_index.gotmpl"
38
+ "{{toLower .Schema}}/enums/index.ts" = " templates/enum_index.gotmpl"
39
+
40
+ [TablePaths ]
41
+ # "{{toLower .Schema}}/{{toLower .Table}}/{{toLower .Table}}.ts" = "templates/table.gotmpl"
42
+ "{{toLower .Schema}}/{{pascal .Table}}.graphql.ts" = " templates/table.gotmpl"
43
+
44
+ [EnumPaths ]
45
+ # "{{toLower .Schema}}/enum/{{toLower .Enum}}.ts" = "templates/enum.gotmpl"
46
+ "{{toLower .Schema}}/enums/{{pascal .Enum}}.ts" = " templates/enum.gotmpl"
47
+
48
+ [TypeMap ]
49
+ "timestamp with time zone" = " GraphQLNonNull(GraphQLDateTime)"
50
+ "timestamptz" = " GraphQLNonNull(GraphQLDateTime"
51
+ "varchar" = " GraphQLNonNull(GraphQLString"
52
+ "text" = " GraphQLNonNull(GraphQLString)"
53
+ "boolean" = " GraphQLNonNull(boolean)"
54
+ "uuid" = " GraphQLNonNull(GraphQLString)"
55
+ "character varying" = " GraphQLNonNull(GraphQLString)"
56
+ "character" = " GraphQLNonNull(GraphQLString)"
57
+ "smallint" = " GraphQLNonNull(GraphQLInt)"
58
+ "integer" = " GraphQLNonNull(GraphQLInt)"
59
+ "int4" = " GraphQLNonNull(GraphQLInt)"
60
+ "int8" = " GraphQLNonNull(GraphQLInt)"
61
+ "numeric" = " GraphQLNonNull(GraphQLFloat)"
62
+ "bigint" = " GraphQLNonNull(GraphQLInt)"
63
+ # TODO
64
+ "hstore" = " GraphQLNonNull(GraphQLString)"
65
+ # TODO
66
+ "jsonb" = " GraphQLNonNull(GraphQLString)"
67
+ # TODO
68
+ "bytea" = " GraphQLNonNull(GraphQLString)"
69
+ # TODO: real column
70
+ "tstzrange" = " GraphQLNonNull(GraphQLString)"
71
+ # Replace with your own enums
72
+ "book_type" = " GraphQLNonNull(enums.BookType)"
73
+
74
+ [NullableTypeMap ]
75
+ "timestamp with time zone" = " GraphQLDateTime"
76
+ "timestamptz" = " GraphQLDateTime"
77
+ "varchar" = " GraphQLString"
78
+ "text" = " GraphQLString"
79
+ "boolean" = " boolean"
80
+ "uuid" = " GraphQLString"
81
+ "character varying" = " GraphQLString"
82
+ "character" = " GraphQLString"
83
+ "smallint" = " GraphQLInt"
84
+ "integer" = " GraphQLInt"
85
+ "int4" = " GraphQLInt"
86
+ "int8" = " GraphQLInt"
87
+ "numeric" = " GraphQLFloat"
88
+ "bigint" = " GraphQLInt"
89
+ # TODO
90
+ "hstore" = " GraphQLString"
91
+ # TODO
92
+ "jsonb" = " GraphQLString"
93
+ # TODO
94
+ "bytea" = " GraphQLString"
95
+ # TODO: real column
96
+ "tstzrange" = " GraphQLString"
97
+ # Replace with your own enums
98
+ "book_type" = " enums.BookType"
0 commit comments