@mistriwork/engine 1.0.0-rc.44 → 1.0.0-rc.45

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.
@@ -356,6 +356,8 @@ export class SqliteAdapter {
356
356
  columns,
357
357
  approxRows: approxRowsOf(t.name, t.type),
358
358
  isView: t.type === 'view',
359
+ /* AUTOINCREMENT is only in the statement: the catalog says nothing else about it. */
360
+ ...(identity && !/\bAUTOINCREMENT\b/i.test(t.sql ?? '') ? { reusesKeys: true } : {}),
359
361
  indexed: t.type === 'view' ? [] : this.leadingIndexColumns(columns, indexes),
360
362
  ...(() => {
361
363
  const unique = t.type === 'view' ? [] : this.uniqueColumns(indexes);
@@ -198,6 +198,12 @@ export interface TableMeta {
198
198
  sortable?: string[];
199
199
  /** `false` when the source reports no totals (an API): lists page without one, and nothing asks for a count. */
200
200
  countable?: false;
201
+ /**
202
+ * Set on a SQLite table whose key is a rowid alias declared without AUTOINCREMENT: SQLite may hand a deleted row's
203
+ * key to the next insert, so whatever outlives the row and names it by key (a capability link) may come to name a
204
+ * new one. Absent elsewhere, AUTOINCREMENT and every other engine included.
205
+ */
206
+ reusesKeys?: true;
201
207
  /** True for views — read-only, and worth saying so rather than surprising. */
202
208
  isView: boolean;
203
209
  /** An App's union (appUnions.ts): read by asking each branch it holds, never as a table. */
@@ -178,6 +178,7 @@ export function captureScopeCatalog(schema) {
178
178
  'filterIn',
179
179
  'sortable',
180
180
  'countable',
181
+ 'reusesKeys',
181
182
  ]);
182
183
  if (!identifier(table.id) ||
183
184
  /* A catalog of several connections says which engine reads each table
@@ -256,6 +257,8 @@ export function captureScopeCatalog(schema) {
256
257
  return refuse();
257
258
  if (table.countable !== undefined && table.countable !== false)
258
259
  return refuse();
260
+ if (table.reusesKeys !== undefined && table.reusesKeys !== true)
261
+ return refuse();
259
262
  // Index advice, as `unique` is address evidence: only columns this table has.
260
263
  if (table.trigram !== undefined &&
261
264
  (!Array.isArray(table.trigram) ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mistriwork/engine",
3
- "version": "1.0.0-rc.44",
3
+ "version": "1.0.0-rc.45",
4
4
  "description": "The engine both products stand on: the adapters (SQLite, Postgres), the catalog, the query language, keyset pages, the HTTP kit and the shared rules. No React.",
5
5
  "homepage": "https://mistriwork.dev",
6
6
  "bugs": {