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
@@ -61,6 +61,7 @@ For a full list of options, see the [Configuration file format](#configuration-f
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
63
"nonEmptyArrayParams":false, // Whether the type for an array parameter should exclude empty arrays
64
+
"optionalNullParams":true, // Whether nullable parameters are made optional
64
65
"dbUrl":"postgres://user:password@host/database", // DB URL (optional - will be merged with db if provided)
65
66
"db": {
66
67
"dbName":"testdb", // DB name
@@ -94,6 +95,7 @@ Configuration file can be also be written in CommonJS format and default exporte
94
95
|`dbUrl?`|`string`| A connection string to the database. Example: `postgres://user:password@host/database`. Overrides (merged) with `db` config. |
95
96
|`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
97
|`nonEmptyArrayParams?`|`boolean`| Whether the types for arrays parameters exclude empty arrays. This helps prevent runtime errors when accidentally providing empty input to a query. |
98
+
|`optionalNullParams?`|`boolean`| Whether nullable parameters are automatically marked as optional. **Default:**`true`|
97
99
|`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`._|
98
100
|`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