diff --git a/docs/pages/docs/Generation options/index.md b/docs/pages/docs/Generation options/index.md index ef04b4a5b..0246caa11 100644 --- a/docs/pages/docs/Generation options/index.md +++ b/docs/pages/docs/Generation options/index.md @@ -54,6 +54,8 @@ At the moment, drift supports these options: (so a column named `user_name` would also use `user_name` as a json key instead of `userName`). You can always override the json key by using a `JSON KEY` column constraint (e.g. `user_name VARCHAR NOT NULL JSON KEY userName`). +* `use_sql_column_name_as_json_key` (defaults to false): Uses the column name in SQL as the JSON key for serialization, + regardless of whether the table was defined in a drift file or not. * `generate_connect_constructor` (deprecated): Generates a named `connect()` constructor on database classes that takes a `DatabaseConnection` instead of a `QueryExecutor`. This option was deprecated in drift 2.5 because `DatabaseConnection` now implements `QueryExecutor`. diff --git a/drift_dev/CHANGELOG.md b/drift_dev/CHANGELOG.md index c5ae4216f..bbcfdcc07 100644 --- a/drift_dev/CHANGELOG.md +++ b/drift_dev/CHANGELOG.md @@ -1,6 +1,7 @@ ## 2.17.0-dev - Fix drift using the wrong import alias in generated part files. +- Add the `use_sql_column_name_as_json_key` builder option. ## 2.16.0