@atscript/db 0.1.71 → 0.1.73

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.
@@ -2989,13 +2989,16 @@ var AtscriptDbView = class extends AtscriptDbReadable {
2989
2989
  condition: join.condition
2990
2990
  });
2991
2991
  }
2992
+ const filter = metadata.get("db.view.filter");
2993
+ const having = metadata.get("db.view.having");
2994
+ const materialized = metadata.has("db.view.materialized");
2992
2995
  this._viewPlan = {
2993
2996
  entryType,
2994
2997
  entryTable,
2995
2998
  joins,
2996
- filter: metadata.get("db.view.filter"),
2997
- having: metadata.get("db.view.having"),
2998
- materialized: metadata.has("db.view.materialized")
2999
+ filter,
3000
+ having,
3001
+ materialized
2999
3002
  };
3000
3003
  return this._viewPlan;
3001
3004
  }
@@ -2989,13 +2989,16 @@ var AtscriptDbView = class extends AtscriptDbReadable {
2989
2989
  condition: join.condition
2990
2990
  });
2991
2991
  }
2992
+ const filter = metadata.get("db.view.filter");
2993
+ const having = metadata.get("db.view.having");
2994
+ const materialized = metadata.has("db.view.materialized");
2992
2995
  this._viewPlan = {
2993
2996
  entryType,
2994
2997
  entryTable,
2995
2998
  joins,
2996
- filter: metadata.get("db.view.filter"),
2997
- having: metadata.get("db.view.having"),
2998
- materialized: metadata.has("db.view.materialized")
2999
+ filter,
3000
+ having,
3001
+ materialized
2999
3002
  };
3000
3003
  return this._viewPlan;
3001
3004
  }
package/dist/index.cjs CHANGED
@@ -1,9 +1,8 @@
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-CLqTqTMH.cjs");
3
+ const require_db_view = require("./db-view-CtkGKGvA.cjs");
4
4
  const require_ops = require("./ops.cjs");
5
5
  const require_validator = require("./validator-BIuw_T0k.cjs");
6
- require("./nested-writer-v_LPR1yJ.cjs");
7
6
  let _uniqu_core = require("@uniqu/core");
8
7
  //#region src/table/db-space.ts
9
8
  /**
package/dist/index.mjs CHANGED
@@ -1,8 +1,7 @@
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-N_jNtSTG.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-BHgsWaqn.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
- import "./nested-writer-CT2rLURx.mjs";
6
5
  import { computeInsights, isPrimitive, walkFilter } from "@uniqu/core";
7
6
  //#region src/table/db-space.ts
8
7
  /**
package/dist/plugin.cjs CHANGED
@@ -713,7 +713,7 @@ const dbRelAnnotations = { rel: {
713
713
  const dbSearchAnnotations = { search: {
714
714
  vector: {
715
715
  $self: new _atscript_core.AnnotationSpec({
716
- description: "Marks a field as a **vector embedding** for **similarity search**.\n\n- Each adapter maps this to its native vector type and index:\n - **MongoDB** → Atlas `$vectorSearch` index\n - **MySQL 9+** → `VECTOR(N)` column + `VEC_DISTANCE_*` functions\n - **PostgreSQL** → pgvector `vector(N)` column + distance operators\n - **SQLite** → JSON storage (no native vector support)\n\n**Example:**\n```atscript\n@db.search.vector 1536, \"cosine\"\nembedding: db.vector\n```\n",
716
+ description: "Marks a field as a **vector embedding** for **similarity search**.\n\n- Each adapter maps this to its native vector type and index:\n - **MongoDB** → Atlas `$vectorSearch` index\n - **MySQL 9+** → `VECTOR(N)` column + `VEC_DISTANCE_*` functions\n - **PostgreSQL** → pgvector `vector(N)` column + distance operators\n - **SQLite** → `BLOB` column + `vec0` virtual index (requires the `sqlite-vec` extension; falls back to JSON `TEXT` when unavailable)\n\n**Example:**\n```atscript\n@db.search.vector 1536, \"cosine\"\nembedding: db.vector\n```\n",
717
717
  nodeType: ["prop"],
718
718
  multiple: false,
719
719
  argument: [
package/dist/plugin.mjs CHANGED
@@ -709,7 +709,7 @@ const dbRelAnnotations = { rel: {
709
709
  const dbSearchAnnotations = { search: {
710
710
  vector: {
711
711
  $self: new AnnotationSpec({
712
- description: "Marks a field as a **vector embedding** for **similarity search**.\n\n- Each adapter maps this to its native vector type and index:\n - **MongoDB** → Atlas `$vectorSearch` index\n - **MySQL 9+** → `VECTOR(N)` column + `VEC_DISTANCE_*` functions\n - **PostgreSQL** → pgvector `vector(N)` column + distance operators\n - **SQLite** → JSON storage (no native vector support)\n\n**Example:**\n```atscript\n@db.search.vector 1536, \"cosine\"\nembedding: db.vector\n```\n",
712
+ description: "Marks a field as a **vector embedding** for **similarity search**.\n\n- Each adapter maps this to its native vector type and index:\n - **MongoDB** → Atlas `$vectorSearch` index\n - **MySQL 9+** → `VECTOR(N)` column + `VEC_DISTANCE_*` functions\n - **PostgreSQL** → pgvector `vector(N)` column + distance operators\n - **SQLite** → `BLOB` column + `vec0` virtual index (requires the `sqlite-vec` extension; falls back to JSON `TEXT` when unavailable)\n\n**Example:**\n```atscript\n@db.search.vector 1536, \"cosine\"\nembedding: db.vector\n```\n",
713
713
  nodeType: ["prop"],
714
714
  multiple: false,
715
715
  argument: [
package/dist/rel.d.cts CHANGED
@@ -116,4 +116,4 @@ declare function batchPatchNestedFrom(host: TNestedWriterHost, originals: Array<
116
116
  */
117
117
  declare function batchPatchNestedVia(host: TNestedWriterHost, originals: Array<Record<string, unknown>>, maxDepth: number, depth: number): Promise<void>;
118
118
  //#endregion
119
- export { TNestedWriterHost, TRelationLoaderHost, batchInsertNestedFrom, batchInsertNestedTo, batchInsertNestedVia, batchPatchNestedFrom, batchPatchNestedTo, batchPatchNestedVia, batchReplaceNestedFrom, batchReplaceNestedTo, batchReplaceNestedVia, checkDepthOverflow, findFKForRelation, findRemoteFK, loadRelationsImpl, preValidateNestedFrom, resolveRelationTargetTable, validateBatch };
119
+ export { type TNestedWriterHost, type TRelationLoaderHost, batchInsertNestedFrom, batchInsertNestedTo, batchInsertNestedVia, batchPatchNestedFrom, batchPatchNestedTo, batchPatchNestedVia, batchReplaceNestedFrom, batchReplaceNestedTo, batchReplaceNestedVia, checkDepthOverflow, findFKForRelation, findRemoteFK, loadRelationsImpl, preValidateNestedFrom, resolveRelationTargetTable, validateBatch };
package/dist/sync.cjs CHANGED
@@ -1,7 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_db_view = require("./db-view-CLqTqTMH.cjs");
3
- require("./validator-BIuw_T0k.cjs");
4
- require("./nested-writer-v_LPR1yJ.cjs");
2
+ const require_db_view = require("./db-view-CtkGKGvA.cjs");
5
3
  //#region src/schema/schema-hash.ts
6
4
  /** Extracts sorted field snapshots from a readable's field descriptors. */
7
5
  function extractFieldSnapshots(fields, typeMapper) {
package/dist/sync.mjs CHANGED
@@ -1,6 +1,4 @@
1
- import { h as NoopLogger } from "./db-view-N_jNtSTG.mjs";
2
- import "./validator-BB5h1Le3.mjs";
3
- import "./nested-writer-CT2rLURx.mjs";
1
+ import { h as NoopLogger } from "./db-view-BHgsWaqn.mjs";
4
2
  //#region src/schema/schema-hash.ts
5
3
  /** Extracts sorted field snapshots from a readable's field descriptors. */
6
4
  function extractFieldSnapshots(fields, typeMapper) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/db",
3
- "version": "0.1.71",
3
+ "version": "0.1.73",
4
4
  "description": "Database adapter utilities for atscript.",
5
5
  "keywords": [
6
6
  "atscript",
@@ -37,19 +37,23 @@
37
37
  },
38
38
  "./plugin": {
39
39
  "types": "./dist/plugin.d.mts",
40
- "import": "./dist/plugin.mjs"
40
+ "import": "./dist/plugin.mjs",
41
+ "require": "./dist/plugin.cjs"
41
42
  },
42
43
  "./rel": {
43
44
  "types": "./dist/rel.d.mts",
44
- "import": "./dist/rel.mjs"
45
+ "import": "./dist/rel.mjs",
46
+ "require": "./dist/rel.cjs"
45
47
  },
46
48
  "./agg": {
47
49
  "types": "./dist/agg.d.mts",
48
- "import": "./dist/agg.mjs"
50
+ "import": "./dist/agg.mjs",
51
+ "require": "./dist/agg.cjs"
49
52
  },
50
53
  "./shared": {
51
54
  "types": "./dist/shared.d.mts",
52
- "import": "./dist/shared.mjs"
55
+ "import": "./dist/shared.mjs",
56
+ "require": "./dist/shared.cjs"
53
57
  },
54
58
  "./ops": {
55
59
  "types": "./dist/ops.d.mts",