@atscript/db-memory 0.1.168 → 0.1.169

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/dist/index.cjs CHANGED
@@ -1303,27 +1303,6 @@ var MemoryAdapter = class MemoryAdapter extends _atscript_db.BaseDbAdapter {
1303
1303
  return JSON.stringify(fields.map((field) => pinned.get(field)));
1304
1304
  }
1305
1305
  /**
1306
- * Builds a DEFINED inserted-id for a table with NO single `@meta.id` — a
1307
- * composite (or single non-meta) primary key, where
1308
- * {@link BaseDbAdapter._resolveInsertedId} would otherwise fall back to
1309
- * `undefined` (memory has no rowid/`_id` to hand back). Returns an object
1310
- * mapping each PRIMARY KEY PHYSICAL field name → its value in the stored row
1311
- * (e.g. `{ part1: "a", part2: "b" }`), read by physical name via
1312
- * {@link getPath} so it matches how {@link pkKey} derives the storage key and
1313
- * honours column renames. A single-field non-meta PK yields the one-key object
1314
- * form for consistency (documented shape).
1315
- *
1316
- * Passed as the `dbGeneratedId` fallback in {@link _insertRow} ONLY when
1317
- * {@link AtscriptDbReadable.metaIdPhysical} is null; single-`@meta.id` tables
1318
- * keep an `undefined` fallback, so their scalar `insertedId`
1319
- * (`row[metaIdPhysical]`) is byte-identical to before.
1320
- */
1321
- _compositeInsertedId(row) {
1322
- const id = {};
1323
- for (const field of this._physicalPkFields()) id[field] = (0, _atscript_db.getPath)(row, field);
1324
- return id;
1325
- }
1326
- /**
1327
1306
  * Switches this adapter into PROVIDER-BACKED mode: `fn` is invoked on every
1328
1307
  * read to recompute the table's rows (e.g. a Redis/job-manager snapshot), so a
1329
1308
  * runtime-owned entity with NO database can be observed as a read-only
@@ -1424,8 +1403,7 @@ var MemoryAdapter = class MemoryAdapter extends _atscript_db.BaseDbAdapter {
1424
1403
  if (state.rows.has(key)) throw this._pkConflict();
1425
1404
  const tuples = this._enforceUniqueIndexes(state, row);
1426
1405
  this._storeRow(state, key, row, tuples);
1427
- const fallback = this._table.metaIdPhysical ? void 0 : this._compositeInsertedId(row);
1428
- return this._resolveInsertedId(row, fallback);
1406
+ return this._resolveInsertedId(row, void 0);
1429
1407
  }
1430
1408
  /**
1431
1409
  * Enforces every recorded unique index against the current store. A row is
package/dist/index.d.cts CHANGED
@@ -189,23 +189,6 @@ declare class MemoryAdapter extends BaseDbAdapter {
189
189
  * {@link MemoryTableState.opaquePk opaque} key.
190
190
  */
191
191
  private _pinnedKey;
192
- /**
193
- * Builds a DEFINED inserted-id for a table with NO single `@meta.id` — a
194
- * composite (or single non-meta) primary key, where
195
- * {@link BaseDbAdapter._resolveInsertedId} would otherwise fall back to
196
- * `undefined` (memory has no rowid/`_id` to hand back). Returns an object
197
- * mapping each PRIMARY KEY PHYSICAL field name → its value in the stored row
198
- * (e.g. `{ part1: "a", part2: "b" }`), read by physical name via
199
- * {@link getPath} so it matches how {@link pkKey} derives the storage key and
200
- * honours column renames. A single-field non-meta PK yields the one-key object
201
- * form for consistency (documented shape).
202
- *
203
- * Passed as the `dbGeneratedId` fallback in {@link _insertRow} ONLY when
204
- * {@link AtscriptDbReadable.metaIdPhysical} is null; single-`@meta.id` tables
205
- * keep an `undefined` fallback, so their scalar `insertedId`
206
- * (`row[metaIdPhysical]`) is byte-identical to before.
207
- */
208
- private _compositeInsertedId;
209
192
  /**
210
193
  * Switches this adapter into PROVIDER-BACKED mode: `fn` is invoked on every
211
194
  * read to recompute the table's rows (e.g. a Redis/job-manager snapshot), so a
package/dist/index.d.mts CHANGED
@@ -189,23 +189,6 @@ declare class MemoryAdapter extends BaseDbAdapter {
189
189
  * {@link MemoryTableState.opaquePk opaque} key.
190
190
  */
191
191
  private _pinnedKey;
192
- /**
193
- * Builds a DEFINED inserted-id for a table with NO single `@meta.id` — a
194
- * composite (or single non-meta) primary key, where
195
- * {@link BaseDbAdapter._resolveInsertedId} would otherwise fall back to
196
- * `undefined` (memory has no rowid/`_id` to hand back). Returns an object
197
- * mapping each PRIMARY KEY PHYSICAL field name → its value in the stored row
198
- * (e.g. `{ part1: "a", part2: "b" }`), read by physical name via
199
- * {@link getPath} so it matches how {@link pkKey} derives the storage key and
200
- * honours column renames. A single-field non-meta PK yields the one-key object
201
- * form for consistency (documented shape).
202
- *
203
- * Passed as the `dbGeneratedId` fallback in {@link _insertRow} ONLY when
204
- * {@link AtscriptDbReadable.metaIdPhysical} is null; single-`@meta.id` tables
205
- * keep an `undefined` fallback, so their scalar `insertedId`
206
- * (`row[metaIdPhysical]`) is byte-identical to before.
207
- */
208
- private _compositeInsertedId;
209
192
  /**
210
193
  * Switches this adapter into PROVIDER-BACKED mode: `fn` is invoked on every
211
194
  * read to recompute the table's rows (e.g. a Redis/job-manager snapshot), so a
package/dist/index.mjs CHANGED
@@ -1302,27 +1302,6 @@ var MemoryAdapter = class MemoryAdapter extends BaseDbAdapter {
1302
1302
  return JSON.stringify(fields.map((field) => pinned.get(field)));
1303
1303
  }
1304
1304
  /**
1305
- * Builds a DEFINED inserted-id for a table with NO single `@meta.id` — a
1306
- * composite (or single non-meta) primary key, where
1307
- * {@link BaseDbAdapter._resolveInsertedId} would otherwise fall back to
1308
- * `undefined` (memory has no rowid/`_id` to hand back). Returns an object
1309
- * mapping each PRIMARY KEY PHYSICAL field name → its value in the stored row
1310
- * (e.g. `{ part1: "a", part2: "b" }`), read by physical name via
1311
- * {@link getPath} so it matches how {@link pkKey} derives the storage key and
1312
- * honours column renames. A single-field non-meta PK yields the one-key object
1313
- * form for consistency (documented shape).
1314
- *
1315
- * Passed as the `dbGeneratedId` fallback in {@link _insertRow} ONLY when
1316
- * {@link AtscriptDbReadable.metaIdPhysical} is null; single-`@meta.id` tables
1317
- * keep an `undefined` fallback, so their scalar `insertedId`
1318
- * (`row[metaIdPhysical]`) is byte-identical to before.
1319
- */
1320
- _compositeInsertedId(row) {
1321
- const id = {};
1322
- for (const field of this._physicalPkFields()) id[field] = getPath(row, field);
1323
- return id;
1324
- }
1325
- /**
1326
1305
  * Switches this adapter into PROVIDER-BACKED mode: `fn` is invoked on every
1327
1306
  * read to recompute the table's rows (e.g. a Redis/job-manager snapshot), so a
1328
1307
  * runtime-owned entity with NO database can be observed as a read-only
@@ -1423,8 +1402,7 @@ var MemoryAdapter = class MemoryAdapter extends BaseDbAdapter {
1423
1402
  if (state.rows.has(key)) throw this._pkConflict();
1424
1403
  const tuples = this._enforceUniqueIndexes(state, row);
1425
1404
  this._storeRow(state, key, row, tuples);
1426
- const fallback = this._table.metaIdPhysical ? void 0 : this._compositeInsertedId(row);
1427
- return this._resolveInsertedId(row, fallback);
1405
+ return this._resolveInsertedId(row, void 0);
1428
1406
  }
1429
1407
  /**
1430
1408
  * Enforces every recorded unique index against the current store. A row is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/db-memory",
3
- "version": "0.1.168",
3
+ "version": "0.1.169",
4
4
  "description": "In-memory adapter for atscript-db.",
5
5
  "keywords": [
6
6
  "atscript",
@@ -45,7 +45,7 @@
45
45
  "@atscript/core": "^0.2.4",
46
46
  "@atscript/typescript": "^0.2.4",
47
47
  "@uniqu/core": "^0.2.0",
48
- "@atscript/db": "^0.1.168"
48
+ "@atscript/db": "^0.1.169"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "vp pack",