Releases: rmp135/sql-ts
1.14.0
Breaking
- Fix 104 Trailing numbers are now merged when converting to case. Although technically a regression it does impact the generated names.
New
- Merge 102 . Support
_uuid
arrays. Thanks to @jwmonroe-outschool
Fixes
- Fix 107. Enum names of
0
are now correctly converted to TS safe values.
(Not sure why but the linking to issues / pull requests are broken in the editor.)
1.13.0
All documentation can now be found at the new documentation page.
Breaking
- Tables names ending with 'ies' are renamed to 'y' when using
singularTableNames
option. Thanks to @ajeffrey. - SQLite primary keys are now optional.
- Although it was correctly brought up in pull #90 that SQLite primary keys are not optional, I think 90% of the time it's going to be auto-increment and therefore optional.
- To combat this, a new option columnOptionality has been added to allow for overriding optionality on a per column basis.
New
- Upgrade knex to 1.0. This adds support for better-sqlite3.
- Table generated enums.
- Enums can now be generated using static data from a table, and can be referenced as the type of another column.
- For further info and examples, see the documentation.
- Config option columnOptionality to allow for overriding optionality on a per column basis.
- Fix #98 - Config option globalOptionality to set the optionality globally, allowing for creating read models.
- Config option enumNumericKeyFormat to set the format when a numeric key is found.
- Config option custom for defining user-defined variables in the template. Thanks to @DarkRoku12 for the idea.
Fixes
- Column names are sorted based on their name. Thanks to @jwmonroe-outschool.
- Enums are sorted based on their returned sort order. Thanks to @jhiesey.
- Fix #99 - Handling of numeric enum keys.
- Enum keys that are numeric are now passed through the enumNumericKeyFormat config option. By default, it will prepend the key with an underscore.
1.12.1
1.12.0
New
- #79 - Allow for an existing knex connection to be used.
toObject
andtoTypescript
both allow for a knex connection to be passed as the second argument. In this case you do not need to specify the connection details, only the sql-ts options.
- #68 - Importing comments from the database.
- Table and column comments can now be imported from the database. See the README for more info on how these are populated.
Fixes
- #88 - Enums and enum values are sorted by name for consistency between generations.
- #92 - Fix for CLI usage when supplying the config option.
- Better type conversions for postgres. Thanks to @DarkRoku12
- SQLite adapter usage improvements. Thanks to @herrecito
- Support for postgres generated columns and identities. Thanks to @xiaoyu-tamu.
1.11.0
Breaking
#75 - Precise types returned from postgres will be correctly set as strings instead of numbers.
#82 - Numbers are no longer removed from type names. If you're using a custom template, you need to add quotes to the types.
Enums no longer have spaces or invalid characters removed from the type name. If you're using a custom template, you need to add quotes to the enum names.
Fixed
#84 - Fixes enum references on columns being an incorrect case if enumNameCasing
config option is applied.
New
#87 - Support for standard postgres views.
#84 - New config option enumKeyCasing
. Changes the casing of enum keys.
1.10.0
Breaking
Hopefully nothing but some TypeScript type names were changed and a large refactor took place so 🤞.
Fixed
Fixed #76 - All clients have had their optionality and nullability standardised.
Fixed issue found in #80 - TypeMap changed to allow for per-client typings so mssql returns string for timestamp type.