You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat!: Allow non-optional generation of params with optionalNullParams
This feature allows specifying whether nullable params should be
generated as optional via the config.
The default behaviour stays the same, so this feature is backwards
compatible.
Copy file name to clipboardexpand all lines: docs-new/docs/cli.md
+2
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,7 @@ For a full list of options, see the [Configuration file format](#configuration-f
60
60
"srcDir":"./src/", // Directory to scan or watch for query files
61
61
"failOnError":false, // Whether to fail on a file processing error and abort generation (can be omitted - default is false)
62
62
"camelCaseColumnNames":false, // convert to camelCase column names of result interface
63
+
"optionalNullParams":true, // Whether nullable parameters are made optional
63
64
"dbUrl":"postgres://user:password@host/database", // DB URL (optional - will be merged with db if provided)
64
65
"db": {
65
66
"dbName":"testdb", // DB name
@@ -92,6 +93,7 @@ Configuration file can be also be written in CommonJS format and default exporte
92
93
|`failOnError?`|`boolean`| Whether to fail on a file processing error and abort generation. **Default:**`false`|
93
94
|`dbUrl?`|`string`| A connection string to the database. Example: `postgres://user:password@host/database`. Overrides (merged) with `db` config. |
94
95
|`camelCaseColumnNames?`|`boolean`| Whether to convert column names to camelCase. _Note that this only coverts the types. You need to do this at runtime independently using a library like `pg-camelcase`_. |
96
+
|`optionalNullParams?`|`boolean`| Whether nullable parameters are automatically marked as optional. **Default:**`true`|
95
97
|`typesOverrides?`|`Record<string, string>`| A map of type overrides. Similarly to `camelCaseColumnNames`, this only affects the types. _You need to do this at runtime independently using a library like `pg-types`._|
96
98
|`maxWorkerThreads`|`number`| The maximum number of worker threads to use for type generation. **The default is based on the number of available CPUs.**|
0 commit comments