@@ -240,6 +240,10 @@ Each mapping of the `overrides` collection has the following keys:
240
240
- `nullable` :
241
241
- If `true`, use this type when a column is nullable. Defaults to `false`.
242
242
243
+ Note that a single `db_type` override configuration applies to either nullable or non-nullable
244
+ columns, but not both. If you want a single `go_type` to override in both cases, you'll
245
+ need to specify two overrides.
246
+
243
247
When generating code, entries using the `column` key will always have preference over
244
248
entries using the `db_type` key in order to generate the struct.
245
249
@@ -434,11 +438,11 @@ With the previous configuration, whenever a struct field is generated from a
434
438
table column that is called `id`, it will generated as `Identifier`.
435
439
436
440
Also, whenever there is a nullable `timestamp with time zone` column in a
437
- Postgres table, it will be generated as `null.Time`. Note that, the mapping for
441
+ Postgres table, it will be generated as `null.Time`. Note that the mapping for
438
442
global type overrides has a field called `engine` that is absent in the regular
439
443
type overrides. This field is only used when there are multiple definitions
440
- using multiple engines. Otherwise, the value of the `engine` key will be
441
- defaulted to the engine that is currently being used.
444
+ using multiple engines. Otherwise, the value of the `engine` key
445
+ defaults to the engine that is currently being used.
442
446
443
447
Currently, type overrides and field renaming, both global and regular, are only
444
448
fully supported in Go.
@@ -453,6 +457,7 @@ packages:
453
457
queries: "./sql/query/"
454
458
schema: "./sql/schema/"
455
459
engine: "postgresql"
460
+ emit_db_tags: false
456
461
emit_prepared_queries: true
457
462
emit_interface: false
458
463
emit_exact_table_names: false
@@ -472,6 +477,7 @@ packages:
472
477
output_models_file_name: "models.go"
473
478
output_querier_file_name: "querier.go"
474
479
output_copyfrom_file_name: "copyfrom.go"
480
+ query_parameter_limit: 1
475
481
` ` `
476
482
477
483
# ## packages
@@ -567,6 +573,10 @@ Each override document has the following keys:
567
573
- `nullable` :
568
574
- If true, use this type when a column is nullable. Defaults to `false`.
569
575
576
+ Note that a single `db_type` override configuration applies to either nullable or non-nullable
577
+ columns, but not both. If you want a single `go_type` to override in both cases, you'll
578
+ need to specify two overrides.
579
+
570
580
For more complicated import paths, the `go_type` can also be an object.
571
581
572
582
` ` ` yaml
@@ -599,7 +609,7 @@ overrides:
599
609
600
610
# ### Package Level Overrides
601
611
602
- Overrides can be configured globally, as demonstrated in the previous sections, or they can be configured on a per-package which
612
+ Overrides can be configured globally, as demonstrated in the previous sections, or they can be configured per-package which
603
613
scopes the override behavior to just a single package :
604
614
605
615
` ` ` yaml
0 commit comments