@atscript/db 0.1.67 → 0.1.69

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.
@@ -95,6 +95,8 @@ declare class TableMetadata {
95
95
  allPhysicalFields: string[];
96
96
  /** Precomputed parent path → child physical column names for fast null-setting. */
97
97
  childrenByParent: Map<string, string[]>;
98
+ /** Precomputed parent path → optional child logical paths (replace-strategy null-fill in the patch decomposer). */
99
+ optionalLeavesByLogicalParent: Map<string, string[]>;
98
100
  requiresMappings: boolean;
99
101
  /** True when the only mappings needed are simple `@db.column` renames (no nesting/JSON). */
100
102
  onlyColumnRenames: boolean;
@@ -1409,6 +1411,13 @@ declare class AtscriptDbReadable<T extends TAtscriptAnnotatedType = TAtscriptAnn
1409
1411
  findById<Q extends {
1410
1412
  controls?: UniqueryControls<OwnProps, NavType>;
1411
1413
  } = Record<string, never>>(id: IdType, query?: Q): Promise<DbResponse<DataType, NavType, Q> | null>;
1414
+ /**
1415
+ * Resolve an id value (scalar or object) into a {@link FilterExpr} using the
1416
+ * same identification resolution as {@link findById}. Public so callers can
1417
+ * AND-combine the id-filter with a row-level read overlay before issuing
1418
+ * `findOne` (avoiding the existence leak that `findById` would cause).
1419
+ */
1420
+ resolveIdFilter(id: unknown): FilterExpr | null;
1412
1421
  /**
1413
1422
  * Resolve an id value into a filter expression.
1414
1423
  *
@@ -95,6 +95,8 @@ declare class TableMetadata {
95
95
  allPhysicalFields: string[];
96
96
  /** Precomputed parent path → child physical column names for fast null-setting. */
97
97
  childrenByParent: Map<string, string[]>;
98
+ /** Precomputed parent path → optional child logical paths (replace-strategy null-fill in the patch decomposer). */
99
+ optionalLeavesByLogicalParent: Map<string, string[]>;
98
100
  requiresMappings: boolean;
99
101
  /** True when the only mappings needed are simple `@db.column` renames (no nesting/JSON). */
100
102
  onlyColumnRenames: boolean;
@@ -1409,6 +1411,13 @@ declare class AtscriptDbReadable<T extends TAtscriptAnnotatedType = TAtscriptAnn
1409
1411
  findById<Q extends {
1410
1412
  controls?: UniqueryControls<OwnProps, NavType>;
1411
1413
  } = Record<string, never>>(id: IdType, query?: Q): Promise<DbResponse<DataType, NavType, Q> | null>;
1414
+ /**
1415
+ * Resolve an id value (scalar or object) into a {@link FilterExpr} using the
1416
+ * same identification resolution as {@link findById}. Public so callers can
1417
+ * AND-combine the id-filter with a row-level read overlay before issuing
1418
+ * `findOne` (avoiding the existence leak that `findById` would cause).
1419
+ */
1420
+ resolveIdFilter(id: unknown): FilterExpr | null;
1412
1421
  /**
1413
1422
  * Resolve an id value into a filter expression.
1414
1423
  *
@@ -1,6 +1,6 @@
1
- import { B as TDbInsertResult, J as TFkLookupResolver, N as TDbDeleteResult, W as TDbUpdateResult, dt as TableMetadata, it as TTableResolver, o as BaseDbAdapter, ot as TWriteTableResolver, pt as TGenericLogger, t as AtscriptDbReadable, x as TCascadeResolver, z as TDbInsertManyResult } from "./db-readable-vjbawUvu.mjs";
2
- import { AtscriptQueryComparison, AtscriptQueryFieldRef, AtscriptQueryFieldRef as AtscriptQueryFieldRef$1, AtscriptQueryNode, AtscriptQueryNode as AtscriptQueryNode$1, AtscriptRef, FlatOf, NavPropsOf, OwnPropsOf, PrimaryKeyOf, TAtscriptAnnotatedType, TAtscriptDataType, Validator } from "@atscript/typescript/utils";
1
+ import { B as TDbInsertResult, J as TFkLookupResolver, N as TDbDeleteResult, W as TDbUpdateResult, dt as TableMetadata, it as TTableResolver, o as BaseDbAdapter, ot as TWriteTableResolver, pt as TGenericLogger, t as AtscriptDbReadable, x as TCascadeResolver, z as TDbInsertManyResult } from "./db-readable-D7ZC5hgc.cjs";
3
2
  import { FilterExpr } from "@uniqu/core";
3
+ import { AtscriptQueryComparison, AtscriptQueryFieldRef, AtscriptQueryFieldRef as AtscriptQueryFieldRef$1, AtscriptQueryNode, AtscriptQueryNode as AtscriptQueryNode$1, AtscriptRef, FlatOf, NavPropsOf, OwnPropsOf, PrimaryKeyOf, TAtscriptAnnotatedType, TAtscriptDataType, Validator } from "@atscript/typescript/utils";
4
4
 
5
5
  //#region src/strategies/integrity.d.ts
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { B as TDbInsertResult, J as TFkLookupResolver, N as TDbDeleteResult, W as TDbUpdateResult, dt as TableMetadata, it as TTableResolver, o as BaseDbAdapter, ot as TWriteTableResolver, pt as TGenericLogger, t as AtscriptDbReadable, x as TCascadeResolver, z as TDbInsertManyResult } from "./db-readable-BZN2QKud.cjs";
2
- import { FilterExpr } from "@uniqu/core";
1
+ import { B as TDbInsertResult, J as TFkLookupResolver, N as TDbDeleteResult, W as TDbUpdateResult, dt as TableMetadata, it as TTableResolver, o as BaseDbAdapter, ot as TWriteTableResolver, pt as TGenericLogger, t as AtscriptDbReadable, x as TCascadeResolver, z as TDbInsertManyResult } from "./db-readable-CS8b_Kov.mjs";
3
2
  import { AtscriptQueryComparison, AtscriptQueryFieldRef, AtscriptQueryFieldRef as AtscriptQueryFieldRef$1, AtscriptQueryNode, AtscriptQueryNode as AtscriptQueryNode$1, AtscriptRef, FlatOf, NavPropsOf, OwnPropsOf, PrimaryKeyOf, TAtscriptAnnotatedType, TAtscriptDataType, Validator } from "@atscript/typescript/utils";
3
+ import { FilterExpr } from "@uniqu/core";
4
4
 
5
5
  //#region src/strategies/integrity.d.ts
6
6
  /**
@@ -76,6 +76,8 @@ var TableMetadata = class {
76
76
  allPhysicalFields = [];
77
77
  /** Precomputed parent path → child physical column names for fast null-setting. */
78
78
  childrenByParent = /* @__PURE__ */ new Map();
79
+ /** Precomputed parent path → optional child logical paths (replace-strategy null-fill in the patch decomposer). */
80
+ optionalLeavesByLogicalParent = /* @__PURE__ */ new Map();
79
81
  requiresMappings = false;
80
82
  /** True when the only mappings needed are simple `@db.column` renames (no nesting/JSON). */
81
83
  onlyColumnRenames = false;
@@ -333,8 +335,13 @@ var TableMetadata = class {
333
335
  for (const parentPath of this.flattenedParents) {
334
336
  const prefix = `${parentPath}.`;
335
337
  const children = [];
336
- for (const [path, fd] of this.leafByLogical.entries()) if (path.startsWith(prefix)) children.push(fd.physicalName);
338
+ const optionalLeaves = [];
339
+ for (const [path, fd] of this.leafByLogical.entries()) if (path.startsWith(prefix)) {
340
+ children.push(fd.physicalName);
341
+ if (fd.optional) optionalLeaves.push(path);
342
+ }
337
343
  if (children.length > 0) this.childrenByParent.set(parentPath, children);
344
+ if (optionalLeaves.length > 0) this.optionalLeavesByLogicalParent.set(parentPath, optionalLeaves);
338
345
  }
339
346
  }
340
347
  /**
@@ -694,7 +701,7 @@ var FieldMappingStrategy = class {
694
701
  const parts = parentPath.split(".");
695
702
  let current = obj;
696
703
  for (let i = 0; i < parts.length - 1; i++) {
697
- if (current[parts[i]] === void 0) return;
704
+ if (current[parts[i]] === void 0 || current[parts[i]] === null) return;
698
705
  current = current[parts[i]];
699
706
  }
700
707
  const lastPart = parts[parts.length - 1];
@@ -1563,6 +1570,15 @@ var AtscriptDbReadable = class {
1563
1570
  });
1564
1571
  }
1565
1572
  /**
1573
+ * Resolve an id value (scalar or object) into a {@link FilterExpr} using the
1574
+ * same identification resolution as {@link findById}. Public so callers can
1575
+ * AND-combine the id-filter with a row-level read overlay before issuing
1576
+ * `findOne` (avoiding the existence leak that `findById` would cause).
1577
+ */
1578
+ resolveIdFilter(id) {
1579
+ return this._resolveIdFilter(id);
1580
+ }
1581
+ /**
1566
1582
  * Resolve an id value into a filter expression.
1567
1583
  *
1568
1584
  * When `preferredId` differs from the PK, scalar ids resolve only against
@@ -2402,14 +2418,22 @@ function decomposePatch(payload, table) {
2402
2418
  return update;
2403
2419
  }
2404
2420
  function flattenPatchPayload(payload, prefix, update, table, topLevelArrayTag) {
2421
+ const meta = table.getMetadata();
2405
2422
  for (const [_key, value] of Object.entries(payload)) {
2406
2423
  const key = prefix ? `${prefix}.${_key}` : _key;
2407
2424
  if (table.primaryKeys.includes(key)) continue;
2408
2425
  const flatType = table.flatMap.get(key);
2409
2426
  const isTopLevelArray = flatType?.metadata?.get(topLevelArrayTag);
2410
- if (typeof value === "object" && value !== null && !Array.isArray(value) && isTopLevelArray && !flatType?.metadata?.has("db.json")) decomposeArrayPatch(key, value, flatType, update, table);
2411
- else if (typeof value === "object" && value !== null && !Array.isArray(value) && flatType?.metadata?.get("db.patch.strategy") === "merge") flattenPatchPayload(value, key, update, table, topLevelArrayTag);
2412
- else update[key] = value;
2427
+ const isObjectValue = typeof value === "object" && value !== null && !Array.isArray(value);
2428
+ if (isObjectValue && isTopLevelArray && !flatType?.metadata?.has("db.json")) decomposeArrayPatch(key, value, flatType, update, table);
2429
+ else if (isObjectValue && flatType?.metadata?.get("db.patch.strategy") === "merge") flattenPatchPayload(value, key, update, table, topLevelArrayTag);
2430
+ else if (isObjectValue && meta.flattenedParents.has(key)) {
2431
+ flattenPatchPayload(value, key, update, table, topLevelArrayTag);
2432
+ const optLeaves = meta.optionalLeavesByLogicalParent.get(key);
2433
+ if (optLeaves) {
2434
+ for (const lp of optLeaves) if (!(lp in update)) update[lp] = null;
2435
+ }
2436
+ } else update[key] = value;
2413
2437
  }
2414
2438
  }
2415
2439
  /**
@@ -76,6 +76,8 @@ var TableMetadata = class {
76
76
  allPhysicalFields = [];
77
77
  /** Precomputed parent path → child physical column names for fast null-setting. */
78
78
  childrenByParent = /* @__PURE__ */ new Map();
79
+ /** Precomputed parent path → optional child logical paths (replace-strategy null-fill in the patch decomposer). */
80
+ optionalLeavesByLogicalParent = /* @__PURE__ */ new Map();
79
81
  requiresMappings = false;
80
82
  /** True when the only mappings needed are simple `@db.column` renames (no nesting/JSON). */
81
83
  onlyColumnRenames = false;
@@ -333,8 +335,13 @@ var TableMetadata = class {
333
335
  for (const parentPath of this.flattenedParents) {
334
336
  const prefix = `${parentPath}.`;
335
337
  const children = [];
336
- for (const [path, fd] of this.leafByLogical.entries()) if (path.startsWith(prefix)) children.push(fd.physicalName);
338
+ const optionalLeaves = [];
339
+ for (const [path, fd] of this.leafByLogical.entries()) if (path.startsWith(prefix)) {
340
+ children.push(fd.physicalName);
341
+ if (fd.optional) optionalLeaves.push(path);
342
+ }
337
343
  if (children.length > 0) this.childrenByParent.set(parentPath, children);
344
+ if (optionalLeaves.length > 0) this.optionalLeavesByLogicalParent.set(parentPath, optionalLeaves);
338
345
  }
339
346
  }
340
347
  /**
@@ -694,7 +701,7 @@ var FieldMappingStrategy = class {
694
701
  const parts = parentPath.split(".");
695
702
  let current = obj;
696
703
  for (let i = 0; i < parts.length - 1; i++) {
697
- if (current[parts[i]] === void 0) return;
704
+ if (current[parts[i]] === void 0 || current[parts[i]] === null) return;
698
705
  current = current[parts[i]];
699
706
  }
700
707
  const lastPart = parts[parts.length - 1];
@@ -1563,6 +1570,15 @@ var AtscriptDbReadable = class {
1563
1570
  });
1564
1571
  }
1565
1572
  /**
1573
+ * Resolve an id value (scalar or object) into a {@link FilterExpr} using the
1574
+ * same identification resolution as {@link findById}. Public so callers can
1575
+ * AND-combine the id-filter with a row-level read overlay before issuing
1576
+ * `findOne` (avoiding the existence leak that `findById` would cause).
1577
+ */
1578
+ resolveIdFilter(id) {
1579
+ return this._resolveIdFilter(id);
1580
+ }
1581
+ /**
1566
1582
  * Resolve an id value into a filter expression.
1567
1583
  *
1568
1584
  * When `preferredId` differs from the PK, scalar ids resolve only against
@@ -2402,14 +2418,22 @@ function decomposePatch(payload, table) {
2402
2418
  return update;
2403
2419
  }
2404
2420
  function flattenPatchPayload(payload, prefix, update, table, topLevelArrayTag) {
2421
+ const meta = table.getMetadata();
2405
2422
  for (const [_key, value] of Object.entries(payload)) {
2406
2423
  const key = prefix ? `${prefix}.${_key}` : _key;
2407
2424
  if (table.primaryKeys.includes(key)) continue;
2408
2425
  const flatType = table.flatMap.get(key);
2409
2426
  const isTopLevelArray = flatType?.metadata?.get(topLevelArrayTag);
2410
- if (typeof value === "object" && value !== null && !Array.isArray(value) && isTopLevelArray && !flatType?.metadata?.has("db.json")) decomposeArrayPatch(key, value, flatType, update, table);
2411
- else if (typeof value === "object" && value !== null && !Array.isArray(value) && flatType?.metadata?.get("db.patch.strategy") === "merge") flattenPatchPayload(value, key, update, table, topLevelArrayTag);
2412
- else update[key] = value;
2427
+ const isObjectValue = typeof value === "object" && value !== null && !Array.isArray(value);
2428
+ if (isObjectValue && isTopLevelArray && !flatType?.metadata?.has("db.json")) decomposeArrayPatch(key, value, flatType, update, table);
2429
+ else if (isObjectValue && flatType?.metadata?.get("db.patch.strategy") === "merge") flattenPatchPayload(value, key, update, table, topLevelArrayTag);
2430
+ else if (isObjectValue && meta.flattenedParents.has(key)) {
2431
+ flattenPatchPayload(value, key, update, table, topLevelArrayTag);
2432
+ const optLeaves = meta.optionalLeavesByLogicalParent.get(key);
2433
+ if (optLeaves) {
2434
+ for (const lp of optLeaves) if (!(lp in update)) update[lp] = null;
2435
+ }
2436
+ } else update[key] = value;
2413
2437
  }
2414
2438
  }
2415
2439
  /**
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_db_error = require("./db-error-D8tQhNgM.cjs");
3
- const require_db_view = require("./db-view-B028LhoI.cjs");
3
+ const require_db_view = require("./db-view-CLqTqTMH.cjs");
4
4
  const require_ops = require("./ops.cjs");
5
5
  const require_validator = require("./validator-BIuw_T0k.cjs");
6
6
  require("./nested-writer-v_LPR1yJ.cjs");
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { $ as TMetadataOverrides, A as TDbCollation, B as TDbInsertResult, C as TColumnDiff, D as TDbActionIntent, E as TDbActionInfo, F as TDbForeignKey, G as TExistingColumn, H as TDbRelation, I as TDbIndex, J as TFkLookupResolver, K as TExistingTableOption, L as TDbIndexField, M as TDbDefaultValue, N as TDbDeleteResult, O as TDbActionLevel, P as TDbFieldMeta, Q as TMetaResponse, R as TDbIndexType, S as TCascadeTarget, T as TCrudPermissions, U as TDbStorageType, V as TDbReferentialAction, W as TDbUpdateResult, X as TIdDescriptor, Y as TFkLookupTarget, Z as TIdentification, _ as FlatOf, a as FieldMappingStrategy, at as TValueFormatterPair, b as PrimaryKeyOf, c as AggregateExpr, ct as Uniquery, d as AggregateResult, dt as TableMetadata, et as TRelationInfo, f as AtscriptDbWritable, ft as NoopLogger, g as FilterExpr, h as FieldOpsFor, i as DocumentFieldMapper, it as TTableResolver, j as TDbDefaultFn, k as TDbActionProcessor, l as AggregateFn, lt as UniqueryControls, m as DbQuery, mt as UniquSelect, n as DbResponse, nt as TSyncColumnResult, o as BaseDbAdapter, ot as TWriteTableResolver, p as DbControls, pt as TGenericLogger, q as TFieldMeta, r as resolveDesignType, rt as TTableOptionDiff, s as AggregateControls, st as TypedWithRelation, t as AtscriptDbReadable, tt as TSearchIndexInfo, u as AggregateQuery, ut as WithRelation, v as NavPropsOf, w as TCrudOp, x as TCascadeResolver, y as OwnPropsOf, z as TDbInsertManyResult } from "./db-readable-BZN2QKud.cjs";
1
+ import { $ as TMetadataOverrides, A as TDbCollation, B as TDbInsertResult, C as TColumnDiff, D as TDbActionIntent, E as TDbActionInfo, F as TDbForeignKey, G as TExistingColumn, H as TDbRelation, I as TDbIndex, J as TFkLookupResolver, K as TExistingTableOption, L as TDbIndexField, M as TDbDefaultValue, N as TDbDeleteResult, O as TDbActionLevel, P as TDbFieldMeta, Q as TMetaResponse, R as TDbIndexType, S as TCascadeTarget, T as TCrudPermissions, U as TDbStorageType, V as TDbReferentialAction, W as TDbUpdateResult, X as TIdDescriptor, Y as TFkLookupTarget, Z as TIdentification, _ as FlatOf, a as FieldMappingStrategy, at as TValueFormatterPair, b as PrimaryKeyOf, c as AggregateExpr, ct as Uniquery, d as AggregateResult, dt as TableMetadata, et as TRelationInfo, f as AtscriptDbWritable, ft as NoopLogger, g as FilterExpr, h as FieldOpsFor, i as DocumentFieldMapper, it as TTableResolver, j as TDbDefaultFn, k as TDbActionProcessor, l as AggregateFn, lt as UniqueryControls, m as DbQuery, mt as UniquSelect, n as DbResponse, nt as TSyncColumnResult, o as BaseDbAdapter, ot as TWriteTableResolver, p as DbControls, pt as TGenericLogger, q as TFieldMeta, r as resolveDesignType, rt as TTableOptionDiff, s as AggregateControls, st as TypedWithRelation, t as AtscriptDbReadable, tt as TSearchIndexInfo, u as AggregateQuery, ut as WithRelation, v as NavPropsOf, w as TCrudOp, x as TCascadeResolver, y as OwnPropsOf, z as TDbInsertManyResult } from "./db-readable-D7ZC5hgc.cjs";
2
2
  import { a as $remove, c as $upsert, d as getDbFieldOp, f as isDbFieldOp, i as $mul, l as TDbFieldOp, n as $inc, o as $replace, p as separateFieldOps, r as $insert, s as $update, t as $dec, u as TFieldOps } from "./ops-DXJ4Zw0P.cjs";
3
- import { a as AtscriptQueryComparison, c as AtscriptRef, d as translateQueryTree, f as AtscriptDbTable, i as TViewColumnMapping, l as TViewJoin, m as NativeIntegrity, n as TAdapterFactory, o as AtscriptQueryFieldRef, p as IntegrityStrategy, r as AtscriptDbView, s as AtscriptQueryNode, t as DbSpace, u as TViewPlan } from "./db-space-Dnjxe6Bt.cjs";
3
+ import { a as AtscriptQueryComparison, c as AtscriptRef, d as translateQueryTree, f as AtscriptDbTable, i as TViewColumnMapping, l as TViewJoin, m as NativeIntegrity, n as TAdapterFactory, o as AtscriptQueryFieldRef, p as IntegrityStrategy, r as AtscriptDbView, s as AtscriptQueryNode, t as DbSpace, u as TViewPlan } from "./db-space-Bw9Bsq4A.cjs";
4
4
  import { n as createDbValidatorPlugin, t as DbValidationContext } from "./db-validator-plugin-DRGMCEn3.cjs";
5
5
  import { c as TArrayPatch, i as buildValidationContext, l as TDbPatch, n as ValidatorMode, o as forceNavNonOptional, r as buildDbValidator, s as isNavRelation, t as ValidationContext, u as getKeyProps } from "./validator-_z_A3cKa.cjs";
6
6
  import { AggregateQuery as AggregateQuery$1, FilterExpr as FilterExpr$1, FilterVisitor, Uniquery as Uniquery$1, computeInsights, isPrimitive, walkFilter } from "@uniqu/core";
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { $ as TMetadataOverrides, A as TDbCollation, B as TDbInsertResult, C as TColumnDiff, D as TDbActionIntent, E as TDbActionInfo, F as TDbForeignKey, G as TExistingColumn, H as TDbRelation, I as TDbIndex, J as TFkLookupResolver, K as TExistingTableOption, L as TDbIndexField, M as TDbDefaultValue, N as TDbDeleteResult, O as TDbActionLevel, P as TDbFieldMeta, Q as TMetaResponse, R as TDbIndexType, S as TCascadeTarget, T as TCrudPermissions, U as TDbStorageType, V as TDbReferentialAction, W as TDbUpdateResult, X as TIdDescriptor, Y as TFkLookupTarget, Z as TIdentification, _ as FlatOf, a as FieldMappingStrategy, at as TValueFormatterPair, b as PrimaryKeyOf, c as AggregateExpr, ct as Uniquery, d as AggregateResult, dt as TableMetadata, et as TRelationInfo, f as AtscriptDbWritable, ft as NoopLogger, g as FilterExpr, h as FieldOpsFor, i as DocumentFieldMapper, it as TTableResolver, j as TDbDefaultFn, k as TDbActionProcessor, l as AggregateFn, lt as UniqueryControls, m as DbQuery, mt as UniquSelect, n as DbResponse, nt as TSyncColumnResult, o as BaseDbAdapter, ot as TWriteTableResolver, p as DbControls, pt as TGenericLogger, q as TFieldMeta, r as resolveDesignType, rt as TTableOptionDiff, s as AggregateControls, st as TypedWithRelation, t as AtscriptDbReadable, tt as TSearchIndexInfo, u as AggregateQuery, ut as WithRelation, v as NavPropsOf, w as TCrudOp, x as TCascadeResolver, y as OwnPropsOf, z as TDbInsertManyResult } from "./db-readable-vjbawUvu.mjs";
1
+ import { $ as TMetadataOverrides, A as TDbCollation, B as TDbInsertResult, C as TColumnDiff, D as TDbActionIntent, E as TDbActionInfo, F as TDbForeignKey, G as TExistingColumn, H as TDbRelation, I as TDbIndex, J as TFkLookupResolver, K as TExistingTableOption, L as TDbIndexField, M as TDbDefaultValue, N as TDbDeleteResult, O as TDbActionLevel, P as TDbFieldMeta, Q as TMetaResponse, R as TDbIndexType, S as TCascadeTarget, T as TCrudPermissions, U as TDbStorageType, V as TDbReferentialAction, W as TDbUpdateResult, X as TIdDescriptor, Y as TFkLookupTarget, Z as TIdentification, _ as FlatOf, a as FieldMappingStrategy, at as TValueFormatterPair, b as PrimaryKeyOf, c as AggregateExpr, ct as Uniquery, d as AggregateResult, dt as TableMetadata, et as TRelationInfo, f as AtscriptDbWritable, ft as NoopLogger, g as FilterExpr, h as FieldOpsFor, i as DocumentFieldMapper, it as TTableResolver, j as TDbDefaultFn, k as TDbActionProcessor, l as AggregateFn, lt as UniqueryControls, m as DbQuery, mt as UniquSelect, n as DbResponse, nt as TSyncColumnResult, o as BaseDbAdapter, ot as TWriteTableResolver, p as DbControls, pt as TGenericLogger, q as TFieldMeta, r as resolveDesignType, rt as TTableOptionDiff, s as AggregateControls, st as TypedWithRelation, t as AtscriptDbReadable, tt as TSearchIndexInfo, u as AggregateQuery, ut as WithRelation, v as NavPropsOf, w as TCrudOp, x as TCascadeResolver, y as OwnPropsOf, z as TDbInsertManyResult } from "./db-readable-CS8b_Kov.mjs";
2
2
  import { a as $remove, c as $upsert, d as getDbFieldOp, f as isDbFieldOp, i as $mul, l as TDbFieldOp, n as $inc, o as $replace, p as separateFieldOps, r as $insert, s as $update, t as $dec, u as TFieldOps } from "./ops-C61kelof.mjs";
3
- import { a as AtscriptQueryComparison, c as AtscriptRef, d as translateQueryTree, f as AtscriptDbTable, i as TViewColumnMapping, l as TViewJoin, m as NativeIntegrity, n as TAdapterFactory, o as AtscriptQueryFieldRef, p as IntegrityStrategy, r as AtscriptDbView, s as AtscriptQueryNode, t as DbSpace, u as TViewPlan } from "./db-space-CxGLp-no.mjs";
3
+ import { a as AtscriptQueryComparison, c as AtscriptRef, d as translateQueryTree, f as AtscriptDbTable, i as TViewColumnMapping, l as TViewJoin, m as NativeIntegrity, n as TAdapterFactory, o as AtscriptQueryFieldRef, p as IntegrityStrategy, r as AtscriptDbView, s as AtscriptQueryNode, t as DbSpace, u as TViewPlan } from "./db-space-fGC4DZXO.mjs";
4
4
  import { n as createDbValidatorPlugin, t as DbValidationContext } from "./db-validator-plugin-DDvYyv5t.mjs";
5
5
  import { c as TArrayPatch, i as buildValidationContext, l as TDbPatch, n as ValidatorMode, o as forceNavNonOptional, r as buildDbValidator, s as isNavRelation, t as ValidationContext, u as getKeyProps } from "./validator-DttN2e5_.mjs";
6
6
  import { AggregateQuery as AggregateQuery$1, FilterExpr as FilterExpr$1, FilterVisitor, Uniquery as Uniquery$1, computeInsights, isPrimitive, walkFilter } from "@uniqu/core";
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as DbError } from "./db-error-Cepx-RsQ.mjs";
2
- import { a as BaseDbAdapter, c as AtscriptDbReadable, d as DocumentFieldMapper, f as FieldMappingStrategy, h as NoopLogger, i as ApplicationIntegrity, l as resolveDesignType, m as TableMetadata, n as AtscriptDbTable, o as IntegrityStrategy, p as UniquSelect, r as decomposePatch, s as NativeIntegrity, t as AtscriptDbView, u as RelationalFieldMapper } from "./db-view-DiItd0YG.mjs";
2
+ import { a as BaseDbAdapter, c as AtscriptDbReadable, d as DocumentFieldMapper, f as FieldMappingStrategy, h as NoopLogger, i as ApplicationIntegrity, l as resolveDesignType, m as TableMetadata, n as AtscriptDbTable, o as IntegrityStrategy, p as UniquSelect, r as decomposePatch, s as NativeIntegrity, t as AtscriptDbView, u as RelationalFieldMapper } from "./db-view-N_jNtSTG.mjs";
3
3
  import { $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, getDbFieldOp, isDbFieldOp, separateFieldOps } from "./ops.mjs";
4
4
  import { a as isNavRelation, i as forceNavNonOptional, n as buildValidationContext, o as createDbValidatorPlugin, s as getKeyProps, t as buildDbValidator } from "./validator-BB5h1Le3.mjs";
5
5
  import "./nested-writer-CT2rLURx.mjs";
package/dist/rel.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { F as TDbForeignKey, H as TDbRelation, dt as TableMetadata, it as TTableResolver, o as BaseDbAdapter, ot as TWriteTableResolver, pt as TGenericLogger } from "./db-readable-BZN2QKud.cjs";
1
+ import { F as TDbForeignKey, H as TDbRelation, dt as TableMetadata, it as TTableResolver, o as BaseDbAdapter, ot as TWriteTableResolver, pt as TGenericLogger } from "./db-readable-D7ZC5hgc.cjs";
2
2
  import { t as DbValidationContext } from "./db-validator-plugin-DRGMCEn3.cjs";
3
3
  import { FilterExpr, WithRelation } from "@uniqu/core";
4
4
  import { Validator } from "@atscript/typescript/utils";
package/dist/rel.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { F as TDbForeignKey, H as TDbRelation, dt as TableMetadata, it as TTableResolver, o as BaseDbAdapter, ot as TWriteTableResolver, pt as TGenericLogger } from "./db-readable-vjbawUvu.mjs";
1
+ import { F as TDbForeignKey, H as TDbRelation, dt as TableMetadata, it as TTableResolver, o as BaseDbAdapter, ot as TWriteTableResolver, pt as TGenericLogger } from "./db-readable-CS8b_Kov.mjs";
2
2
  import { t as DbValidationContext } from "./db-validator-plugin-DDvYyv5t.mjs";
3
3
  import { Validator } from "@atscript/typescript/utils";
4
4
  import { FilterExpr, WithRelation } from "@uniqu/core";
package/dist/sync.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_db_view = require("./db-view-B028LhoI.cjs");
2
+ const require_db_view = require("./db-view-CLqTqTMH.cjs");
3
3
  require("./validator-BIuw_T0k.cjs");
4
4
  require("./nested-writer-v_LPR1yJ.cjs");
5
5
  //#region src/schema/schema-hash.ts
package/dist/sync.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as TColumnDiff, F as TDbForeignKey, G as TExistingColumn, K as TExistingTableOption, M as TDbDefaultValue, P as TDbFieldMeta, U as TDbStorageType, pt as TGenericLogger, rt as TTableOptionDiff, t as AtscriptDbReadable } from "./db-readable-BZN2QKud.cjs";
2
- import { r as AtscriptDbView, t as DbSpace } from "./db-space-Dnjxe6Bt.cjs";
1
+ import { C as TColumnDiff, F as TDbForeignKey, G as TExistingColumn, K as TExistingTableOption, M as TDbDefaultValue, P as TDbFieldMeta, U as TDbStorageType, pt as TGenericLogger, rt as TTableOptionDiff, t as AtscriptDbReadable } from "./db-readable-D7ZC5hgc.cjs";
2
+ import { r as AtscriptDbView, t as DbSpace } from "./db-space-Bw9Bsq4A.cjs";
3
3
  import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
4
4
 
5
5
  //#region src/schema/sync-entry.d.ts
package/dist/sync.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as TColumnDiff, F as TDbForeignKey, G as TExistingColumn, K as TExistingTableOption, M as TDbDefaultValue, P as TDbFieldMeta, U as TDbStorageType, pt as TGenericLogger, rt as TTableOptionDiff, t as AtscriptDbReadable } from "./db-readable-vjbawUvu.mjs";
2
- import { r as AtscriptDbView, t as DbSpace } from "./db-space-CxGLp-no.mjs";
1
+ import { C as TColumnDiff, F as TDbForeignKey, G as TExistingColumn, K as TExistingTableOption, M as TDbDefaultValue, P as TDbFieldMeta, U as TDbStorageType, pt as TGenericLogger, rt as TTableOptionDiff, t as AtscriptDbReadable } from "./db-readable-CS8b_Kov.mjs";
2
+ import { r as AtscriptDbView, t as DbSpace } from "./db-space-fGC4DZXO.mjs";
3
3
  import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
4
4
 
5
5
  //#region src/schema/sync-entry.d.ts
package/dist/sync.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { h as NoopLogger } from "./db-view-DiItd0YG.mjs";
1
+ import { h as NoopLogger } from "./db-view-N_jNtSTG.mjs";
2
2
  import "./validator-BB5h1Le3.mjs";
3
3
  import "./nested-writer-CT2rLURx.mjs";
4
4
  //#region src/schema/schema-hash.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/db",
3
- "version": "0.1.67",
3
+ "version": "0.1.69",
4
4
  "description": "Database adapter utilities for atscript.",
5
5
  "keywords": [
6
6
  "atscript",
@@ -67,14 +67,14 @@
67
67
  "access": "public"
68
68
  },
69
69
  "devDependencies": {
70
- "@atscript/core": "^0.1.50",
71
- "@atscript/typescript": "^0.1.50",
70
+ "@atscript/core": "^0.1.51",
71
+ "@atscript/typescript": "^0.1.51",
72
72
  "@uniqu/core": "^0.1.6",
73
- "unplugin-atscript": "^0.1.50"
73
+ "unplugin-atscript": "^0.1.51"
74
74
  },
75
75
  "peerDependencies": {
76
- "@atscript/core": "^0.1.50",
77
- "@atscript/typescript": "^0.1.50",
76
+ "@atscript/core": "^0.1.51",
77
+ "@atscript/typescript": "^0.1.51",
78
78
  "@uniqu/core": "^0.1.6"
79
79
  },
80
80
  "scripts": {