diff --git a/print.html b/print.html index 00df1ce0..33aac328 100644 --- a/print.html +++ b/print.html @@ -399,28 +399,35 @@
Example sqlxrc.json
{
- "default": {
- "DB_TYPE": "mysql",
- "DB_USER": "root",
- "DB_HOST": "127.0.0.1",
- "DB_PORT": 3306
+ "generate_types": {
+ "enabled": true,
+ "convertToCamelCaseColumnName": true
},
- "postgres": {
- "DB_TYPE": "postgres",
- "DB_USER": "postgres",
- "DB_PASS": "postgres",
- "DB_HOST": "127.0.0.1",
- "DB_PORT": 4321
- },
- "some_other_db": {
- "DB_TYPE": "mysql",
- "DB_USER": "app_user",
- "DB_PASS": "password",
- "DB_HOST": "127.0.0.1",
- "DB_PORT": 3307
+ "connections": {
+ "default": {
+ "DB_TYPE": "mysql",
+ "DB_USER": "root",
+ "DB_HOST": "127.0.0.1",
+ "DB_PORT": 3306
+ },
+ "postgres": {
+ "DB_TYPE": "postgres",
+ "DB_USER": "postgres",
+ "DB_PASS": "postgres",
+ "DB_HOST": "127.0.0.1",
+ "DB_PORT": 4321
+ },
+ "some_other_db": {
+ "DB_TYPE": "mysql",
+ "DB_USER": "app_user",
+ "DB_PASS": "password",
+ "DB_HOST": "127.0.0.1",
+ "DB_PORT": 3307
+ }
}
}
+For default database, you must call it default
like example above. Any extra DB connections
should have its own unique name such as postgres
or some_other_db
Along with the configuration above, when writing SQLs in your codebase, you need to provide @@ -435,6 +442,22 @@
Then running sqlx-ts
compile time query checker along with the
{
+ "generateTypes: {
+ enabled: true|false,
+ convertToCamelCaseColumnName: true|false
+ },
+ "connections": {
+ ...
+ }
+}
+
+Support for configuration of generate types operations.
+enabled
(default: false): enables type generation via configconvertToCamelCaseColumnName
(default: true): when generating field name based on table's column name, it will automatically cast to camelCase in TypeScript