tina4-nodejs 3.13.124 → 3.13.130
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +2 -2
- package/package.json +1 -1
- package/packages/cli/dist/bin.js +455 -85
- package/packages/cli/src/bin.ts +6 -0
- package/packages/cli/src/commands/generate.ts +93 -19
- package/packages/cli/src/commands/lint.ts +360 -0
- package/packages/core/dist/index.js +172 -23
- package/packages/core/src/fakeData.ts +37 -2
- package/packages/orm/dist/index.js +172 -23
- package/packages/orm/src/adapters/firebird.ts +7 -0
- package/packages/orm/src/adapters/mssql.ts +10 -0
- package/packages/orm/src/adapters/mysql.ts +6 -0
- package/packages/orm/src/fakeData.ts +27 -2
- package/packages/orm/src/seeder.ts +8 -3
- package/packages/orm/src/sqlTranslator.ts +45 -0
- package/types/cli/src/commands/generate.d.ts +29 -0
- package/types/cli/src/commands/lint.d.ts +5 -0
- package/types/core/src/fakeData.d.ts +12 -0
- package/types/orm/src/fakeData.d.ts +12 -1
- package/types/orm/src/sqlTranslator.d.ts +19 -0
|
@@ -75,6 +75,25 @@ export declare class SQLTranslator {
|
|
|
75
75
|
* Translate AUTOINCREMENT across engines in DDL.
|
|
76
76
|
*/
|
|
77
77
|
static autoIncrementSyntax(sql: string, engine: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* Translate SQLite-canonical DDL column TYPES + CREATE-TABLE options to the
|
|
80
|
+
* target engine.
|
|
81
|
+
*
|
|
82
|
+
* ONLY acts on `CREATE TABLE` / `ALTER TABLE` statements, so a query or INSERT
|
|
83
|
+
* that happens to contain the word `TEXT` (a column name, a string literal) is
|
|
84
|
+
* never rewritten. Complements `autoIncrementSyntax` (which maps the id
|
|
85
|
+
* keyword) so ONE portable migration — and every `Model.createTable()` DDL,
|
|
86
|
+
* which is also SQLite-canonical — applies on every engine instead of failing
|
|
87
|
+
* on Firebird/MSSQL.
|
|
88
|
+
*
|
|
89
|
+
* * Firebird has no `TEXT` (-607), no `REAL`, and no `CREATE TABLE IF NOT
|
|
90
|
+
* EXISTS`.
|
|
91
|
+
* * MSSQL has no `CREATE TABLE IF NOT EXISTS` and its `TIMESTAMP` is a
|
|
92
|
+
* rowversion, not a datetime — a `created_at TIMESTAMP` there is wrong.
|
|
93
|
+
* * MySQL's `TIMESTAMP` carries auto-update / 2038 surprises, so a datetime
|
|
94
|
+
* column maps to `DATETIME` (matching the adapters' createTableAsync).
|
|
95
|
+
*/
|
|
96
|
+
static ddlTypes(sql: string, engine: string): string;
|
|
78
97
|
/**
|
|
79
98
|
* Convert ? placeholders to engine-specific style.
|
|
80
99
|
*
|