@rudderjs/database 1.3.1 → 1.5.0

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.
Files changed (34) hide show
  1. package/dist/native/adapter.d.ts +7 -4
  2. package/dist/native/adapter.d.ts.map +1 -1
  3. package/dist/native/adapter.js +19 -5
  4. package/dist/native/adapter.js.map +1 -1
  5. package/dist/native/compiler.d.ts +0 -15
  6. package/dist/native/compiler.d.ts.map +1 -1
  7. package/dist/native/compiler.js +41 -4
  8. package/dist/native/compiler.js.map +1 -1
  9. package/dist/native/drivers/better-sqlite3.js +17 -12
  10. package/dist/native/drivers/better-sqlite3.js.map +1 -1
  11. package/dist/native/index.d.ts +2 -0
  12. package/dist/native/index.d.ts.map +1 -1
  13. package/dist/native/index.js +2 -0
  14. package/dist/native/index.js.map +1 -1
  15. package/dist/native/intent-guard.d.ts +7 -0
  16. package/dist/native/intent-guard.d.ts.map +1 -0
  17. package/dist/native/intent-guard.js +42 -0
  18. package/dist/native/intent-guard.js.map +1 -0
  19. package/dist/native/query-builder.d.ts.map +1 -1
  20. package/dist/native/query-builder.js +6 -4
  21. package/dist/native/query-builder.js.map +1 -1
  22. package/dist/native/schema/intent-replay.d.ts +27 -0
  23. package/dist/native/schema/intent-replay.d.ts.map +1 -0
  24. package/dist/native/schema/intent-replay.js +173 -0
  25. package/dist/native/schema/intent-replay.js.map +1 -0
  26. package/dist/native/schema/schema-types.d.ts +8 -5
  27. package/dist/native/schema/schema-types.d.ts.map +1 -1
  28. package/dist/native/schema/schema-types.js +9 -7
  29. package/dist/native/schema/schema-types.js.map +1 -1
  30. package/dist/native/schema/types-generator.d.ts +32 -7
  31. package/dist/native/schema/types-generator.d.ts.map +1 -1
  32. package/dist/native/schema/types-generator.js +43 -9
  33. package/dist/native/schema/types-generator.js.map +1 -1
  34. package/package.json +2 -2
@@ -1,4 +1,5 @@
1
1
  import type { RawColumn } from './introspect.js';
2
+ import type { ColumnType } from './column.js';
2
3
  import type { BuiltInCast } from '@rudderjs/contracts';
3
4
  /** A column's resolved TypeScript type plus whether it's optional on read. */
4
5
  export interface GeneratedColumnType {
@@ -54,15 +55,39 @@ export declare function mysqlTypeToTs(declared: string): string;
54
55
  */
55
56
  export declare function castToTs(cast: BuiltInCast | string): string | null;
56
57
  /**
57
- * Resolve one column's TS type: a declared cast wins over the storage mapping,
58
- * and a nullable column widens with `| null`. The primary key and NOT NULL
58
+ * The TS type a blueprint's declared {@link ColumnType} refines a CAST-LESS
59
+ * column to the middle layer of the precedence `cast > blueprint intent >
60
+ * introspected storage type`. Returns null for types where the storage mapping
61
+ * is already faithful (or where folding the intent would lie about runtime):
62
+ *
63
+ * - `boolean` → `boolean`: writes are safe everywhere (every driver binds
64
+ * `true`/`false`, the sqlite driver maps them to 1/0); reads return `0`/`1`
65
+ * on sqlite (and mysql `tinyint(1)`) without a `boolean` cast — truthiness
66
+ * behaves identically, but strict `=== true` comparisons need the cast.
67
+ * This is the deliberate 90%-case trade-off the plan doc's option 3 names.
68
+ * - `json`/`jsonb` → `unknown`: SOUND on every dialect — sqlite reads the raw
69
+ * TEXT (a string ⊆ unknown; a `json` cast gets parsed reads), and the
70
+ * binding funnel JSON-stringifies object/array writes, which `unknown`
71
+ * admits and the affinity type `string` wrongly rejected.
72
+ * - date family (`date`/`dateTime`/`timestamp`/`time`) → null, deliberately:
73
+ * on sqlite a cast-less column reads as TEXT *and* better-sqlite3 REJECTS a
74
+ * `Date` binding — emitting `Date` would make tsc bless writes that throw
75
+ * at runtime. The `date`/`datetime` cast (which parses reads AND serializes
76
+ * writes) is the correct tool; pg/mysql introspection already yields `Date`.
77
+ */
78
+ export declare function blueprintIntentToTs(type: ColumnType): string | null;
79
+ /**
80
+ * Resolve one column's TS type — `cast > blueprint intent > storage mapping` —
81
+ * and widen nullable columns with `| null`. The primary key and NOT NULL
59
82
  * columns stay non-null. `typeToTs` is the per-dialect storage mapper
60
- * ({@link sqliteTypeToTs} by default; {@link pgTypeToTs} for Postgres).
83
+ * ({@link sqliteTypeToTs} by default; {@link pgTypeToTs} for Postgres);
84
+ * `intent` is the column's blueprint-declared type when the migration replay
85
+ * recovered one (see `intent-replay.ts`).
61
86
  */
62
- export declare function resolveColumnType(col: RawColumn, casts: Record<string, string>, typeToTs?: (declared: string) => string): GeneratedColumnType;
63
- /** Build one table's {@link TableTypes} from its columns + casts, using the
64
- * given per-dialect storage mapper (defaults to the SQLite mapping). */
65
- export declare function buildTableTypes(table: string, columns: RawColumn[], casts?: Record<string, string>, typeToTs?: (declared: string) => string): TableTypes;
87
+ export declare function resolveColumnType(col: RawColumn, casts: Record<string, string>, typeToTs?: (declared: string) => string, intent?: ReadonlyMap<string, ColumnType>): GeneratedColumnType;
88
+ /** Build one table's {@link TableTypes} from its columns + casts + blueprint
89
+ * intent, using the given per-dialect storage mapper (defaults to SQLite). */
90
+ export declare function buildTableTypes(table: string, columns: RawColumn[], casts?: Record<string, string>, typeToTs?: (declared: string) => string, intent?: ReadonlyMap<string, ColumnType>): TableTypes;
66
91
  /**
67
92
  * Emit the full `registry.d.ts` contents: a `declare module '@rudderjs/orm'`
68
93
  * augmentation extending `SchemaRegistry` with one entry per table. Tables are
@@ -1 +1 @@
1
- {"version":3,"file":"types-generator.d.ts","sourceRoot":"","sources":["../../../src/native/schema/types-generator.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEtD,8EAA8E;AAC9E,MAAM,WAAW,mBAAmB;IAClC,sEAAsE;IACtE,EAAE,EAAQ,MAAM,CAAA;IAChB,qDAAqD;IACrD,IAAI,EAAM,MAAM,CAAA;CACjB;AAED,gEAAgE;AAChE,MAAM,WAAW,UAAU;IACzB,KAAK,EAAI,MAAM,CAAA;IACf,OAAO,EAAE,mBAAmB,EAAE,CAAA;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAA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136
136
  }
137
137
  /**
138
- * Resolve one column's TS type: a declared cast wins over the storage mapping,
139
- * and a nullable column widens with `| null`. The primary key and NOT NULL
138
+ * The TS type a blueprint's declared {@link ColumnType} refines a CAST-LESS
139
+ * column to the middle layer of the precedence `cast > blueprint intent >
140
+ * introspected storage type`. Returns null for types where the storage mapping
141
+ * is already faithful (or where folding the intent would lie about runtime):
142
+ *
143
+ * - `boolean` → `boolean`: writes are safe everywhere (every driver binds
144
+ * `true`/`false`, the sqlite driver maps them to 1/0); reads return `0`/`1`
145
+ * on sqlite (and mysql `tinyint(1)`) without a `boolean` cast — truthiness
146
+ * behaves identically, but strict `=== true` comparisons need the cast.
147
+ * This is the deliberate 90%-case trade-off the plan doc's option 3 names.
148
+ * - `json`/`jsonb` → `unknown`: SOUND on every dialect — sqlite reads the raw
149
+ * TEXT (a string ⊆ unknown; a `json` cast gets parsed reads), and the
150
+ * binding funnel JSON-stringifies object/array writes, which `unknown`
151
+ * admits and the affinity type `string` wrongly rejected.
152
+ * - date family (`date`/`dateTime`/`timestamp`/`time`) → null, deliberately:
153
+ * on sqlite a cast-less column reads as TEXT *and* better-sqlite3 REJECTS a
154
+ * `Date` binding — emitting `Date` would make tsc bless writes that throw
155
+ * at runtime. The `date`/`datetime` cast (which parses reads AND serializes
156
+ * writes) is the correct tool; pg/mysql introspection already yields `Date`.
157
+ */
158
+ export function blueprintIntentToTs(type) {
159
+ switch (type) {
160
+ case 'boolean': return 'boolean';
161
+ case 'json':
162
+ case 'jsonb': return 'unknown';
163
+ default: return null;
164
+ }
165
+ }
166
+ /**
167
+ * Resolve one column's TS type — `cast > blueprint intent > storage mapping` —
168
+ * and widen nullable columns with `| null`. The primary key and NOT NULL
140
169
  * columns stay non-null. `typeToTs` is the per-dialect storage mapper
141
- * ({@link sqliteTypeToTs} by default; {@link pgTypeToTs} for Postgres).
170
+ * ({@link sqliteTypeToTs} by default; {@link pgTypeToTs} for Postgres);
171
+ * `intent` is the column's blueprint-declared type when the migration replay
172
+ * recovered one (see `intent-replay.ts`).
142
173
  */
143
- export function resolveColumnType(col, casts, typeToTs = sqliteTypeToTs) {
174
+ export function resolveColumnType(col, casts, typeToTs = sqliteTypeToTs, intent) {
144
175
  const declaredCast = casts[col.name];
145
- const base = (declaredCast && castToTs(declaredCast)) || typeToTs(col.type);
176
+ const intentType = intent?.get(col.name);
177
+ const base = (declaredCast && castToTs(declaredCast)) ||
178
+ (intentType && blueprintIntentToTs(intentType)) ||
179
+ typeToTs(col.type);
146
180
  // A column is nullable on read when it permits NULL and isn't the PK.
147
181
  const nullable = !col.notNull && col.pk === 0;
148
182
  return { name: col.name, ts: nullable ? `${base} | null` : base };
149
183
  }
150
- /** Build one table's {@link TableTypes} from its columns + casts, using the
151
- * given per-dialect storage mapper (defaults to the SQLite mapping). */
152
- export function buildTableTypes(table, columns, casts = {}, typeToTs = sqliteTypeToTs) {
153
- return { table, columns: columns.map((c) => resolveColumnType(c, casts, typeToTs)) };
184
+ /** Build one table's {@link TableTypes} from its columns + casts + blueprint
185
+ * intent, using the given per-dialect storage mapper (defaults to SQLite). */
186
+ export function buildTableTypes(table, columns, casts = {}, typeToTs = sqliteTypeToTs, intent) {
187
+ return { table, columns: columns.map((c) => resolveColumnType(c, casts, typeToTs, intent)) };
154
188
  }
155
189
  /**
156
190
  * Emit the full `registry.d.ts` contents: a `declare module '@rudderjs/orm'`
@@ -1 +1 @@
1
- {"version":3,"file":"types-generator.js","sourceRoot":"","sources":["../../../src/native/schema/types-generator.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,EAAE;AACF,+EAA+E;AAC/E,iFAAiF;AACjF,2EAA2E;AAC3E,mFAAmF;AACnF,2EAA2E;AAC3E,gFAAgF;AAChF,mBAAmB;AACnB,EAAE;AACF,4EAA4E;AAC5E,gFAAgF;AAChF,4EAA4E;AAC5E,0BAA0B;AAmB1B;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,MAAM,CAAC,GAAG,QAAQ,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",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,7 +36,7 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "@rudderjs/contracts": "^1.13.0"
39
+ "@rudderjs/contracts": "^1.14.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "better-sqlite3": "^12.0.0",