Skip to content

Commit d0dae8b

Browse files
authored
document emit_result_struct_pointers and emit_params_struct_pointers options (#1209)
Co-authored-by: cqsd <>
1 parent 6cea18d commit d0dae8b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/reference/config.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ packages:
1717
emit_empty_slices: false
1818
emit_exported_queries: false
1919
emit_json_tags: true
20+
emit_result_struct_pointers: false
21+
emit_params_struct_pointers: false
2022
json_tags_case_style: "camel"
2123
output_db_file_name: "db.go"
2224
output_models_file_name: "models.go"
2325
output_querier_file_name: "querier.go"
2426
```
2527
2628
Each package document has the following keys:
29+
2730
- `name`:
2831
- The package name to use for the generated code. Defaults to `path` basename
2932
- `path`:
@@ -50,6 +53,10 @@ Each package document has the following keys:
5053
- If true, autogenerated SQL statement can be exported to be accessed by another package.
5154
- `emit_json_tags`:
5255
- If true, add JSON tags to generated structs. Defaults to `false`.
56+
- `emit_result_struct_pointers`:
57+
- If true, query results are returned as pointers to structs. Queries returning multiple results are returned as slices of pointers. Defaults to `false`.
58+
- `emit_params_struct_pointers`:
59+
- If true, parameters are passed as pointers to structs. Defaults to `false`.
5360
- `json_tags_case_style`:
5461
- `camel` for camelCase, `pascal` for PascalCase, `snake` for snake_case or `none` to use the column name in the DB. Defaults to `none`.
5562
- `output_db_file_name`:
@@ -80,6 +87,7 @@ overrides:
8087
```
8188

8289
Each override document has the following keys:
90+
8391
- `db_type`:
8492
- The PostgreSQL type to override. Find the full list of supported types in [postgresql_type.go](https://github.com/kyleconroy/sqlc/blob/main/internal/codegen/golang/postgresql_type.go#L12).
8593
- `go_type`:

0 commit comments

Comments
 (0)