masterrecord 1.1.3 → 1.1.5

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/CHANGES.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # MasterRecord Changelog
2
2
 
3
+ ## v1.1.5 — clean npm tarball: add a `files` allowlist
4
+
5
+ The package had no `files` field, so `npm publish` swept the whole working tree. The 1.1.4 tarball shipped `.claude/settings.local.json` (a local editor-settings file that should never have been published), all 20 `test/*.test.js` files, test fixtures, and the eslint/prettier configs — none of which belong in a consumed package.
6
+
7
+ - Added a `files` allowlist: top-level `*.js`, `Cache/`, `Entity/`, `QueryLanguage/`, `Migrations/` runtime modules, `docs/`, `CHANGES.md`, `LICENSE` (npm always also includes `readme.md` and `package.json`). `bin` (`Migrations/cli.js`) still ships.
8
+ - Excluded `**/*.test.js` (including the colocated `Migrations/pathUtils.test.js`) and the dev configs via `files` negation patterns.
9
+ - Added `.claude/` to `.gitignore`.
10
+
11
+ Result: tarball dropped from publishing ~65 files to 42 — runtime code + docs only. No source/API changes; runtime behavior is identical to 1.1.4.
12
+
13
+ ## v1.1.4 — re-publish: include the entityTrackerModel.js fix that 1.1.3 missed
14
+
15
+ v1.1.3's commit dropped one of the two files it was supposed to ship — the `Entity/entityTrackerModel.js` change. macOS's case-insensitive filesystem combined with git's case-sensitive index: the file is tracked as `Entity/EntityTrackerModel.js` (capital E), the disk had `entityTrackerModel.js` (lowercase e), and `git add Entity/entityTrackerModel.js` silently no-op'd against the capital-E tracked path.
16
+
17
+ Effect on 1.1.3: the **loaded-entity** FK crash described in v1.1.3's changelog was NOT actually fixed in the published package. `.new()` entities did get the fix (the queryMethods.js change shipped correctly).
18
+
19
+ v1.1.4 ships exactly the same intent as v1.1.3, with the tracker file actually included. If you installed 1.1.3, upgrade to 1.1.4.
20
+
3
21
  ## v1.1.3 — belongsTo FK column setter on both `.new()` and loaded entities
4
22
 
5
23
  **Bug:** `belongsTo('Run')` declares a navigation property `Run` and an implicit FK column `run_id`. Two assignment paths existed but only one worked reliably:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "masterrecord",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "An Object-relational mapping for the Master framework. Master Record connects classes to relational database tables to establish a database with almost zero-configuration ",
5
5
  "type": "module",
6
6
  "main": "./MasterRecord.js",
@@ -32,6 +32,19 @@
32
32
  "bin": {
33
33
  "masterrecord": "./Migrations/cli.js"
34
34
  },
35
+ "files": [
36
+ "*.js",
37
+ "Cache/**/*.js",
38
+ "Entity/**/*.js",
39
+ "QueryLanguage/**/*.js",
40
+ "Migrations/**/*.js",
41
+ "!**/*.test.js",
42
+ "!eslint.config.js",
43
+ "!prettier.config.js",
44
+ "docs/**/*.md",
45
+ "CHANGES.md",
46
+ "LICENSE"
47
+ ],
35
48
  "engines": {
36
49
  "node": ">=20.0.0"
37
50
  },
@@ -1,10 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(node --test --test-timeout=20000 test/text-types.test.js)",
5
- "Bash(node --check /Users/alexanderrich/Documents/development/opensourceHQ/MasterController/MasterActionFilters.js)",
6
- "Bash(node --test test/action-filters-mixin.test.js)",
7
- "Bash(npm test *)"
8
- ]
9
- }
10
- }
@@ -1,37 +0,0 @@
1
- /**
2
- * Tests for pathUtils.js - Path resolution for migrations
3
- */
4
-
5
- import path from 'node:path';
6
- import { test } from 'node:test';
7
- import assert from 'node:assert/strict';
8
- import { resolveMigrationsDirectory, isInMigrationsDirectory } from './pathUtils.js';
9
-
10
- test('resolveMigrationsDirectory: context NOT in migrations folder', () => {
11
- const result = resolveMigrationsDirectory('/app/models/Context.js');
12
- const expected = path.join('/app/models', 'db', 'migrations');
13
- assert.equal(result, expected);
14
- });
15
-
16
- test('resolveMigrationsDirectory: context already in migrations folder', () => {
17
- const result = resolveMigrationsDirectory('/app/models/db/migrations/Context.js');
18
- assert.equal(result, '/app/models/db/migrations');
19
- });
20
-
21
- test('resolveMigrationsDirectory: context in nested migrations folder', () => {
22
- const result = resolveMigrationsDirectory('/components/qa/app/models/db/migrations/qaContext.js');
23
- assert.equal(result, '/components/qa/app/models/db/migrations');
24
- });
25
-
26
- test('isInMigrationsDirectory: true for path with db/migrations', () => {
27
- assert.equal(isInMigrationsDirectory('/app/models/db/migrations/Context.js'), true);
28
- });
29
-
30
- test('isInMigrationsDirectory: false for path without db/migrations', () => {
31
- assert.equal(isInMigrationsDirectory('/app/models/Context.js'), false);
32
- });
33
-
34
- test('isInMigrationsDirectory: handles Windows paths', () => {
35
- const winPath = '/app\\models\\db\\migrations\\Context.js'.replace(/\\/g, path.sep);
36
- assert.equal(isInMigrationsDirectory(winPath), true);
37
- });
package/eslint.config.js DELETED
@@ -1,40 +0,0 @@
1
- import js from '@eslint/js';
2
-
3
- export default [
4
- js.configs.recommended,
5
- {
6
- languageOptions: {
7
- ecmaVersion: 2023,
8
- sourceType: 'module',
9
- globals: {
10
- console: 'readonly',
11
- process: 'readonly',
12
- Buffer: 'readonly',
13
- global: 'readonly',
14
- setTimeout: 'readonly',
15
- clearTimeout: 'readonly',
16
- setInterval: 'readonly',
17
- clearInterval: 'readonly',
18
- URL: 'readonly',
19
- },
20
- },
21
- rules: {
22
- 'no-var': 'error',
23
- 'prefer-const': 'error',
24
- 'no-unused-vars': ['error', {
25
- vars: 'all',
26
- args: 'after-used',
27
- ignoreRestSiblings: true,
28
- argsIgnorePattern: '^_',
29
- varsIgnorePattern: '^_',
30
- }],
31
- 'no-console': 'off',
32
- eqeqeq: ['error', 'always'],
33
- 'no-eval': 'error',
34
- 'no-implied-eval': 'error',
35
- },
36
- },
37
- {
38
- ignores: ['node_modules/**', '_migrations/**', 'test/**'],
39
- },
40
- ];
@@ -1,22 +0,0 @@
1
- export default {
2
- printWidth: 100,
3
- tabWidth: 4,
4
- useTabs: false,
5
- semi: true,
6
- singleQuote: true,
7
- quoteProps: 'as-needed',
8
- trailingComma: 'es5',
9
- bracketSpacing: true,
10
- bracketSameLine: false,
11
- arrowParens: 'avoid',
12
- endOfLine: 'lf',
13
- proseWrap: 'preserve',
14
- htmlWhitespaceSensitivity: 'css',
15
- singleAttributePerLine: false,
16
- overrides: [
17
- { files: '*.md', options: { printWidth: 80, proseWrap: 'always' } },
18
- { files: '*.json', options: { tabWidth: 2 } },
19
- { files: ['*.yml', '*.yaml'], options: { tabWidth: 2 } },
20
- { files: 'package.json', options: { tabWidth: 2 } },
21
- ],
22
- };
@@ -1,154 +0,0 @@
1
- /**
2
- * belongsTo FK column setter on `.new()` entities.
3
- *
4
- * Bug: `belongsTo('Run')` declares a navigation property `Run` and an
5
- * implicit foreign-key column `run_id`. `.new()` walks the entity
6
- * definition and creates a setter for `Run`, but NOT for `run_id` (the
7
- * FK column doesn't appear as a top-level field in `__entity`).
8
- *
9
- * Effect: `step.run_id = 'run_xyz'` lands as a plain JS property — the
10
- * tracker never sees it, the INSERT builder never picks it up, the row
11
- * goes in without the FK. Users were forced to either use the
12
- * navigation setter (`step.Run = id`) or drop to raw SQL.
13
- *
14
- * Fix: when defining `.new()` setters, for each `belongsTo` column,
15
- * also define a setter on the foreignKey field name that stores the
16
- * value and marks the FK as dirty.
17
- */
18
-
19
- import { test } from 'node:test';
20
- import assert from 'node:assert/strict';
21
- import fs from 'node:fs';
22
- import path from 'node:path';
23
- import { fileURLToPath } from 'node:url';
24
-
25
- process.env.master = 'fk-setter';
26
-
27
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
28
- const fixturesDir = path.join(__dirname, 'fixtures', 'belongs-to-fk-setter');
29
- const envDir = path.join(fixturesDir, 'config', 'environments');
30
- const dbDir = path.join(fixturesDir, 'db');
31
- fs.mkdirSync(envDir, { recursive: true });
32
- fs.mkdirSync(dbDir, { recursive: true });
33
-
34
- fs.writeFileSync(
35
- path.join(envDir, 'env.fk-setter.json'),
36
- JSON.stringify({
37
- FkSetterCtx: { type: 'better-sqlite3', connection: dbDir + path.sep },
38
- })
39
- );
40
-
41
- const { default: context } = await import('../context.js');
42
-
43
- class Run {
44
- id(db) { db.string().primary(); }
45
- name(db) { db.string(); }
46
- }
47
-
48
- class Step {
49
- id(db) { db.integer().primary().auto(); }
50
- name(db) { db.string(); }
51
- Run(db) { db.belongsTo('Run').notNullable(); }
52
- }
53
-
54
- class FkSetterCtx extends context {
55
- constructor() {
56
- super();
57
- this.env(envDir);
58
- this.dbset(Run);
59
- this.dbset(Step);
60
- }
61
- }
62
-
63
- test('.new() entity has a setter for the belongsTo foreignKey column', () => {
64
- const ctx = new FkSetterCtx();
65
- const step = ctx.Step.new();
66
-
67
- // The navigation property setter has always worked
68
- step.Run = 'run_abc';
69
- assert.equal(step.Run, 'run_abc');
70
-
71
- // The FK column setter is what was broken
72
- step.run_id = 'run_xyz';
73
- assert.equal(step.run_id, 'run_xyz', 'run_id should be readable');
74
- // The assignment must be tracked. Internally we canonicalize to the
75
- // navigation-property name ('Run') so the engine UPDATE/INSERT
76
- // builders' existing belongsTo handling picks it up. Either name in
77
- // __dirtyFields is acceptable; what matters is that the entity is
78
- // marked as having a pending change.
79
- const dirtyHas = step.__dirtyFields.includes('Run') ||
80
- step.__dirtyFields.includes('run_id');
81
- assert.ok(
82
- dirtyHas,
83
- `FK assignment must be marked dirty, got: ${JSON.stringify(step.__dirtyFields)}`
84
- );
85
- });
86
-
87
- test('loaded entity allows reassigning run_id and persists the UPDATE', async () => {
88
- const ctx = new FkSetterCtx();
89
- ctx._SQLEngine.db.exec(`
90
- CREATE TABLE IF NOT EXISTS Run (
91
- id TEXT PRIMARY KEY,
92
- name TEXT
93
- );
94
- CREATE TABLE IF NOT EXISTS Step (
95
- id INTEGER PRIMARY KEY AUTOINCREMENT,
96
- name TEXT,
97
- run_id TEXT NOT NULL
98
- );
99
- DELETE FROM Step;
100
- DELETE FROM Run;
101
- INSERT INTO Run (id, name) VALUES ('run_alpha', 'first');
102
- INSERT INTO Run (id, name) VALUES ('run_beta', 'second');
103
- INSERT INTO Step (id, name, run_id) VALUES (1, 'step 1', 'run_alpha');
104
- `);
105
-
106
- const step = await ctx.Step.where(s => s.id == $$, 1).single();
107
- assert.equal(step.run_id, 'run_alpha', 'loaded step has the FK');
108
-
109
- // Reassign the FK. Pre-fix this throws because the tracker setter
110
- // does `currentEntity[modelField].set` without a null guard — and
111
- // currentEntity has no 'run_id' key (only 'Run' with foreignKey).
112
- step.run_id = 'run_beta';
113
- assert.equal(step.run_id, 'run_beta');
114
- const dirtyHas = step.__dirtyFields.includes('Run') ||
115
- step.__dirtyFields.includes('run_id');
116
- assert.ok(dirtyHas, `dirty fields: ${JSON.stringify(step.__dirtyFields)}`);
117
-
118
- await ctx.saveChanges();
119
-
120
- const after = ctx._SQLEngine.db.prepare('SELECT run_id FROM Step WHERE id = 1').get();
121
- assert.equal(after.run_id, 'run_beta');
122
-
123
- await ctx.close();
124
- });
125
-
126
- test('.new() then setting run_id ends up in SQLite INSERT', async () => {
127
- const ctx = new FkSetterCtx();
128
- ctx._SQLEngine.db.exec(`
129
- CREATE TABLE IF NOT EXISTS Run (
130
- id TEXT PRIMARY KEY,
131
- name TEXT
132
- );
133
- CREATE TABLE IF NOT EXISTS Step (
134
- id INTEGER PRIMARY KEY AUTOINCREMENT,
135
- name TEXT,
136
- run_id TEXT NOT NULL
137
- );
138
- DELETE FROM Step;
139
- DELETE FROM Run;
140
- INSERT INTO Run (id, name) VALUES ('run_abc', 'first');
141
- `);
142
-
143
- const step = ctx.Step.new();
144
- step.name = 'step 1';
145
- step.run_id = 'run_abc'; // ← this is the case the bug forbade
146
- await ctx.saveChanges();
147
-
148
- const rows = ctx._SQLEngine.db.prepare('SELECT * FROM Step').all();
149
- assert.equal(rows.length, 1);
150
- assert.equal(rows[0].run_id, 'run_abc');
151
- assert.equal(rows[0].name, 'step 1');
152
-
153
- await ctx.close();
154
- });
@@ -1,253 +0,0 @@
1
- /**
2
- * belongsTo FK type resolution (1.1.2).
3
- *
4
- * Bug: belongsTo() hardcoded type='integer' on the FK column at entity-
5
- * definition time, before the parent entity was known. If the parent's PK
6
- * was string/bigint/uuid, the FK column was still declared INTEGER. SQLite
7
- * accepted the mismatch (dynamic typing); Postgres and MySQL rejected it.
8
- *
9
- * Fix: after each dbset() call, walk every entity and re-resolve every
10
- * belongsTo column's `type` from its parent's primary-key type. Order-
11
- * independent, idempotent.
12
- *
13
- * Notes for future maintenance:
14
- * - EntityModelBuilder only sees own-prototype methods. Test entity classes
15
- * must declare their fields directly (no `extends`) or the build silently
16
- * produces an empty entity with no PK and the resolver has nothing to copy.
17
- * - bigint/uuid go through EntityModel.type('bigint') because EntityModel
18
- * doesn't have dedicated bigint()/uuid() field-setter methods.
19
- */
20
-
21
- import { test } from 'node:test';
22
- import assert from 'node:assert/strict';
23
- import fs from 'node:fs';
24
- import path from 'node:path';
25
- import { fileURLToPath } from 'node:url';
26
-
27
- process.env.master = 'fktypes';
28
-
29
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
30
- const fixturesDir = path.join(__dirname, 'fixtures', 'belongs-to-fk-type');
31
- const envDir = path.join(fixturesDir, 'config', 'environments');
32
- const dbDir = path.join(fixturesDir, 'db');
33
- fs.mkdirSync(envDir, { recursive: true });
34
- fs.mkdirSync(dbDir, { recursive: true });
35
-
36
- fs.writeFileSync(
37
- path.join(envDir, 'env.fktypes.json'),
38
- JSON.stringify({
39
- StringPkCtx: { type: 'better-sqlite3', connection: dbDir + path.sep },
40
- IntPkCtx: { type: 'better-sqlite3', connection: dbDir + path.sep },
41
- OutOfOrderCtx: { type: 'better-sqlite3', connection: dbDir + path.sep },
42
- BigintPkCtx: { type: 'better-sqlite3', connection: dbDir + path.sep },
43
- UuidPkCtx: { type: 'better-sqlite3', connection: dbDir + path.sep },
44
- })
45
- );
46
-
47
- const { default: context } = await import('../context.js');
48
- const { default: SQLiteQuery } = await import('../Migrations/migrationSQLiteQuery.js');
49
- const { default: MySQLQuery } = await import('../Migrations/migrationMySQLQuery.js');
50
- const { default: PostgresQuery } = await import('../Migrations/migrationPostgresQuery.js');
51
-
52
- // =====================================================================
53
- // Resolver behavior (per parent PK type)
54
- // =====================================================================
55
-
56
- test('belongsTo FK type resolves from string PK on parent', () => {
57
- class Run {
58
- id(db) { db.string().primary(); }
59
- name(db) { db.string(); }
60
- }
61
- class Step {
62
- id(db) { db.integer().primary().auto(); }
63
- name(db) { db.string(); }
64
- Run(db) { db.belongsTo('Run').notNullable(); }
65
- }
66
- class StringPkCtx extends context {
67
- constructor() {
68
- super();
69
- this.env(envDir);
70
- this.dbset(Run);
71
- this.dbset(Step);
72
- }
73
- }
74
- const ctx = new StringPkCtx();
75
- const stepEntity = ctx.__entities.find(e => e.__name === 'Step');
76
- const fk = stepEntity.Run;
77
- assert.equal(fk.relationshipType, 'belongsTo');
78
- assert.equal(fk.foreignKey, 'run_id');
79
- assert.equal(fk.type, 'string', 'FK type should match parent string PK');
80
- });
81
-
82
- test('belongsTo FK type stays integer when parent PK is integer', () => {
83
- class Run {
84
- id(db) { db.integer().primary().auto(); }
85
- name(db) { db.string(); }
86
- }
87
- class Step {
88
- id(db) { db.integer().primary().auto(); }
89
- Run(db) { db.belongsTo('Run').notNullable(); }
90
- }
91
- class IntPkCtx extends context {
92
- constructor() {
93
- super();
94
- this.env(envDir);
95
- this.dbset(Run);
96
- this.dbset(Step);
97
- }
98
- }
99
- const ctx = new IntPkCtx();
100
- const stepEntity = ctx.__entities.find(e => e.__name === 'Step');
101
- assert.equal(stepEntity.Run.type, 'integer');
102
- });
103
-
104
- test('belongsTo FK type resolves regardless of dbset() order', () => {
105
- class Run {
106
- id(db) { db.string().primary(); }
107
- name(db) { db.string(); }
108
- }
109
- class Step {
110
- id(db) { db.integer().primary().auto(); }
111
- Run(db) { db.belongsTo('Run').notNullable(); }
112
- }
113
- class OutOfOrderCtx extends context {
114
- constructor() {
115
- super();
116
- this.env(envDir);
117
- this.dbset(Step); // child first
118
- this.dbset(Run); // parent second
119
- }
120
- }
121
- const ctx = new OutOfOrderCtx();
122
- const stepEntity = ctx.__entities.find(e => e.__name === 'Step');
123
- assert.equal(stepEntity.Run.type, 'string', 'resolution must be order-independent');
124
- });
125
-
126
- test('belongsTo FK type resolves for bigint parent PK', () => {
127
- class Run {
128
- id(db) { db.type('bigint').primary().auto(); }
129
- name(db) { db.string(); }
130
- }
131
- class Step {
132
- id(db) { db.integer().primary().auto(); }
133
- Run(db) { db.belongsTo('Run').notNullable(); }
134
- }
135
- class BigintPkCtx extends context {
136
- constructor() {
137
- super();
138
- this.env(envDir);
139
- this.dbset(Run);
140
- this.dbset(Step);
141
- }
142
- }
143
- const ctx = new BigintPkCtx();
144
- const stepEntity = ctx.__entities.find(e => e.__name === 'Step');
145
- assert.equal(stepEntity.Run.type, 'bigint');
146
- });
147
-
148
- test('belongsTo FK type resolves for uuid parent PK', () => {
149
- class Run {
150
- id(db) { db.type('uuid').primary(); }
151
- name(db) { db.string(); }
152
- }
153
- class Step {
154
- id(db) { db.integer().primary().auto(); }
155
- Run(db) { db.belongsTo('Run').notNullable(); }
156
- }
157
- class UuidPkCtx extends context {
158
- constructor() {
159
- super();
160
- this.env(envDir);
161
- this.dbset(Run);
162
- this.dbset(Step);
163
- }
164
- }
165
- const ctx = new UuidPkCtx();
166
- const stepEntity = ctx.__entities.find(e => e.__name === 'Step');
167
- assert.equal(stepEntity.Run.type, 'uuid');
168
- });
169
-
170
- // =====================================================================
171
- // Migration DDL output — verify each engine emits a matching SQL type.
172
- // Bypasses context; feeds a minimal table-like object straight to the
173
- // migration query builders. Shape mirrors what the resolver produces.
174
- // =====================================================================
175
-
176
- function stepTableWith(fkType) {
177
- return {
178
- __name: 'Step',
179
- id: { name: 'id', type: 'integer', primary: true, auto: true },
180
- name: { name: 'name', type: 'string' },
181
- Run: {
182
- name: 'Run',
183
- type: fkType,
184
- relationshipType: 'belongsTo',
185
- foreignTable: 'Run',
186
- foreignKey: 'run_id',
187
- nullable: false,
188
- },
189
- };
190
- }
191
-
192
- test('Postgres createTable emits VARCHAR(255) for FK to string PK', () => {
193
- const sql = new PostgresQuery().createTable(stepTableWith('string'));
194
- assert.match(sql, /"run_id"\s+VARCHAR\(255\)/, sql);
195
- assert.doesNotMatch(sql, /"run_id"\s+INTEGER/);
196
- });
197
-
198
- test('Postgres createTable emits INTEGER for FK to integer PK', () => {
199
- const sql = new PostgresQuery().createTable(stepTableWith('integer'));
200
- assert.match(sql, /"run_id"\s+INTEGER/, sql);
201
- });
202
-
203
- test('Postgres createTable emits BIGINT for FK to bigint PK', () => {
204
- const sql = new PostgresQuery().createTable(stepTableWith('bigint'));
205
- assert.match(sql, /"run_id"\s+BIGINT/, sql);
206
- });
207
-
208
- test('Postgres createTable emits UUID for FK to uuid PK', () => {
209
- const sql = new PostgresQuery().createTable(stepTableWith('uuid'));
210
- assert.match(sql, /"run_id"\s+UUID/, sql);
211
- });
212
-
213
- test('MySQL createTable emits VARCHAR(255) for FK to string PK', () => {
214
- const sql = new MySQLQuery().createTable(stepTableWith('string'));
215
- assert.match(sql, /`run_id`\s+VARCHAR\(255\)/, sql);
216
- });
217
-
218
- test('MySQL createTable emits BIGINT for FK to bigint PK', () => {
219
- const sql = new MySQLQuery().createTable(stepTableWith('bigint'));
220
- assert.match(sql, /`run_id`\s+BIGINT/, sql);
221
- });
222
-
223
- test('MySQL createTable emits VARCHAR(36) for FK to uuid PK', () => {
224
- const sql = new MySQLQuery().createTable(stepTableWith('uuid'));
225
- assert.match(sql, /`run_id`\s+VARCHAR\(36\)/, sql);
226
- });
227
-
228
- test('MySQL createTable never emits "undefined" for any FK type', () => {
229
- for (const t of ['string', 'integer', 'bigint', 'uuid', 'text']) {
230
- const sql = new MySQLQuery().createTable(stepTableWith(t));
231
- assert.doesNotMatch(sql, /undefined/, `MySQL ${t}: ${sql}`);
232
- }
233
- });
234
-
235
- test('SQLite createTable emits TEXT for FK to string PK', () => {
236
- const sql = new SQLiteQuery().createTable(stepTableWith('string'));
237
- assert.match(sql, /\[?run_id\]?\s+TEXT/i, sql);
238
- });
239
-
240
- test('SQLite createTable emits INTEGER for FK to integer PK', () => {
241
- const sql = new SQLiteQuery().createTable(stepTableWith('integer'));
242
- assert.match(sql, /\[?run_id\]?\s+INTEGER/i, sql);
243
- });
244
-
245
- test('SQLite createTable emits INTEGER for FK to bigint PK', () => {
246
- const sql = new SQLiteQuery().createTable(stepTableWith('bigint'));
247
- assert.match(sql, /\[?run_id\]?\s+INTEGER/i, sql);
248
- });
249
-
250
- test('SQLite createTable emits TEXT for FK to uuid PK', () => {
251
- const sql = new SQLiteQuery().createTable(stepTableWith('uuid'));
252
- assert.match(sql, /\[?run_id\]?\s+TEXT/i, sql);
253
- });