@atscript/db 0.1.44 → 0.1.46
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/{db-readable-C3C-qPcP.d.cts → db-readable-BIU8D1OQ.d.cts} +1 -0
- package/dist/{db-readable-D9odJuSf.d.mts → db-readable-COxcZfSy.d.mts} +1 -0
- package/dist/{db-space-7bf9_IWC.d.mts → db-space-jEX71kKU.d.mts} +1 -1
- package/dist/{db-space-Dgf-CphX.d.cts → db-space-vDpqDRkP.d.cts} +1 -1
- package/dist/{db-view-7Y5N4muD.mjs → db-view-B1j_IKSf.mjs} +8 -0
- package/dist/{db-view-BMPRfGjB.cjs → db-view-DjDKgytJ.cjs} +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/plugin.cjs +10 -0
- package/dist/plugin.mjs +10 -0
- package/dist/rel.d.cts +1 -1
- package/dist/rel.d.mts +1 -1
- package/dist/sync.cjs +1 -1
- package/dist/sync.d.cts +2 -2
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +1 -1
- package/package.json +6 -6
|
@@ -1084,6 +1084,7 @@ declare class AtscriptDbReadable<T extends TAtscriptAnnotatedType = TAtscriptAnn
|
|
|
1084
1084
|
constructor(_type: T, adapter: A, logger?: TGenericLogger, _tableResolver?: TTableResolver | undefined);
|
|
1085
1085
|
/** Ensures metadata is built. Called before any metadata access. */
|
|
1086
1086
|
protected _ensureBuilt(): void;
|
|
1087
|
+
protected _ensureSearchable(): void;
|
|
1087
1088
|
/** Whether this readable is a view (overridden in AtscriptDbView). */
|
|
1088
1089
|
get isView(): boolean;
|
|
1089
1090
|
/** Returns the underlying adapter with its concrete type preserved. */
|
|
@@ -1084,6 +1084,7 @@ declare class AtscriptDbReadable<T extends TAtscriptAnnotatedType = TAtscriptAnn
|
|
|
1084
1084
|
constructor(_type: T, adapter: A, logger?: TGenericLogger, _tableResolver?: TTableResolver | undefined);
|
|
1085
1085
|
/** Ensures metadata is built. Called before any metadata access. */
|
|
1086
1086
|
protected _ensureBuilt(): void;
|
|
1087
|
+
protected _ensureSearchable(): void;
|
|
1087
1088
|
/** Whether this readable is a view (overridden in AtscriptDbView). */
|
|
1088
1089
|
get isView(): boolean;
|
|
1089
1090
|
/** Returns the underlying adapter with its concrete type preserved. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as TDbInsertResult, H as TFkLookupResolver, O as TDbDeleteResult, P as TDbInsertManyResult, S as TCascadeResolver, Y as TTableResolver, Z as TWriteTableResolver, l as TGenericLogger, o as BaseDbAdapter, s as TableMetadata, t as AtscriptDbReadable, z as TDbUpdateResult } from "./db-readable-
|
|
1
|
+
import { F as TDbInsertResult, H as TFkLookupResolver, O as TDbDeleteResult, P as TDbInsertManyResult, S as TCascadeResolver, Y as TTableResolver, Z as TWriteTableResolver, l as TGenericLogger, o as BaseDbAdapter, s as TableMetadata, t as AtscriptDbReadable, z as TDbUpdateResult } from "./db-readable-COxcZfSy.mjs";
|
|
2
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
3
|
import { FilterExpr } from "@uniqu/core";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as TDbInsertResult, H as TFkLookupResolver, O as TDbDeleteResult, P as TDbInsertManyResult, S as TCascadeResolver, Y as TTableResolver, Z as TWriteTableResolver, l as TGenericLogger, o as BaseDbAdapter, s as TableMetadata, t as AtscriptDbReadable, z as TDbUpdateResult } from "./db-readable-
|
|
1
|
+
import { F as TDbInsertResult, H as TFkLookupResolver, O as TDbDeleteResult, P as TDbInsertManyResult, S as TCascadeResolver, Y as TTableResolver, Z as TWriteTableResolver, l as TGenericLogger, o as BaseDbAdapter, s as TableMetadata, t as AtscriptDbReadable, z as TDbUpdateResult } from "./db-readable-BIU8D1OQ.cjs";
|
|
2
2
|
import { FilterExpr } from "@uniqu/core";
|
|
3
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
|
|
|
@@ -1096,6 +1096,12 @@ var AtscriptDbReadable = class {
|
|
|
1096
1096
|
_ensureBuilt() {
|
|
1097
1097
|
if (!this._meta.isBuilt) this._meta.build(this.type, this.adapter, this.logger);
|
|
1098
1098
|
}
|
|
1099
|
+
_ensureSearchable() {
|
|
1100
|
+
if (!this.adapter.isSearchable()) throw new DbError("INVALID_QUERY", [{
|
|
1101
|
+
path: "$search",
|
|
1102
|
+
message: `Table "${this.tableName}" has no search indexes defined`
|
|
1103
|
+
}]);
|
|
1104
|
+
}
|
|
1099
1105
|
/** Whether this readable is a view (overridden in AtscriptDbView). */
|
|
1100
1106
|
get isView() {
|
|
1101
1107
|
return false;
|
|
@@ -1333,6 +1339,7 @@ var AtscriptDbReadable = class {
|
|
|
1333
1339
|
*/
|
|
1334
1340
|
async search(text, query, indexName) {
|
|
1335
1341
|
this._ensureBuilt();
|
|
1342
|
+
this._ensureSearchable();
|
|
1336
1343
|
const withRelations = query.controls?.$with;
|
|
1337
1344
|
const translated = this._fieldMapper.translateQuery(query, this._meta);
|
|
1338
1345
|
const rows = (await this.adapter.search(text, translated, indexName)).map((row) => this._fieldMapper.reconstructFromRead(row, this._meta));
|
|
@@ -1344,6 +1351,7 @@ var AtscriptDbReadable = class {
|
|
|
1344
1351
|
*/
|
|
1345
1352
|
async searchWithCount(text, query, indexName) {
|
|
1346
1353
|
this._ensureBuilt();
|
|
1354
|
+
this._ensureSearchable();
|
|
1347
1355
|
const withRelations = query.controls?.$with;
|
|
1348
1356
|
const translated = this._fieldMapper.translateQuery(query, this._meta);
|
|
1349
1357
|
const result = await this.adapter.searchWithCount(text, translated, indexName);
|
|
@@ -1096,6 +1096,12 @@ var AtscriptDbReadable = class {
|
|
|
1096
1096
|
_ensureBuilt() {
|
|
1097
1097
|
if (!this._meta.isBuilt) this._meta.build(this.type, this.adapter, this.logger);
|
|
1098
1098
|
}
|
|
1099
|
+
_ensureSearchable() {
|
|
1100
|
+
if (!this.adapter.isSearchable()) throw new require_nested_writer.DbError("INVALID_QUERY", [{
|
|
1101
|
+
path: "$search",
|
|
1102
|
+
message: `Table "${this.tableName}" has no search indexes defined`
|
|
1103
|
+
}]);
|
|
1104
|
+
}
|
|
1099
1105
|
/** Whether this readable is a view (overridden in AtscriptDbView). */
|
|
1100
1106
|
get isView() {
|
|
1101
1107
|
return false;
|
|
@@ -1333,6 +1339,7 @@ var AtscriptDbReadable = class {
|
|
|
1333
1339
|
*/
|
|
1334
1340
|
async search(text, query, indexName) {
|
|
1335
1341
|
this._ensureBuilt();
|
|
1342
|
+
this._ensureSearchable();
|
|
1336
1343
|
const withRelations = query.controls?.$with;
|
|
1337
1344
|
const translated = this._fieldMapper.translateQuery(query, this._meta);
|
|
1338
1345
|
const rows = (await this.adapter.search(text, translated, indexName)).map((row) => this._fieldMapper.reconstructFromRead(row, this._meta));
|
|
@@ -1344,6 +1351,7 @@ var AtscriptDbReadable = class {
|
|
|
1344
1351
|
*/
|
|
1345
1352
|
async searchWithCount(text, query, indexName) {
|
|
1346
1353
|
this._ensureBuilt();
|
|
1354
|
+
this._ensureSearchable();
|
|
1347
1355
|
const withRelations = query.controls?.$with;
|
|
1348
1356
|
const translated = this._fieldMapper.translateQuery(query, this._meta);
|
|
1349
1357
|
const result = await this.adapter.searchWithCount(text, translated, indexName);
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_nested_writer = require("./nested-writer-BIQ6EfaR.cjs");
|
|
3
|
-
const require_db_view = require("./db-view-
|
|
3
|
+
const require_db_view = require("./db-view-DjDKgytJ.cjs");
|
|
4
4
|
const require_ops = require("./ops.cjs");
|
|
5
5
|
const require_validator = require("./validator-0iGuvGOD.cjs");
|
|
6
6
|
let _uniqu_core = require("@uniqu/core");
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as Uniquery, A as TDbForeignKey, B as TExistingColumn, C as TCascadeTarget, D as TDbDefaultValue, E as TDbDefaultFn, F as TDbInsertResult, G as TMetadataOverrides, H as TFkLookupResolver, I as TDbReferentialAction, J as TTableOptionDiff, K as TSearchIndexInfo, L as TDbRelation, M as TDbIndexField, N as TDbIndexType, O as TDbDeleteResult, P as TDbInsertManyResult, Q as TypedWithRelation, R as TDbStorageType, S as TCascadeResolver, T as TDbCollation, U as TFkLookupTarget, V as TExistingTableOption, W as TIdDescriptor, X as TValueFormatterPair, Y as TTableResolver, Z as TWriteTableResolver, _ as DbQuery, a as FieldMappingStrategy, b as NavPropsOf, c as NoopLogger, d as AggregateExpr, et as UniqueryControls, f as AggregateFn, g as DbControls, h as AtscriptDbWritable, i as DocumentFieldMapper, j as TDbIndex, k as TDbFieldMeta, l as TGenericLogger, m as AggregateResult, n as DbResponse, nt as UniquSelect, o as BaseDbAdapter, p as AggregateQuery, q as TSyncColumnResult, r as resolveDesignType, s as TableMetadata, t as AtscriptDbReadable, tt as WithRelation, u as AggregateControls, v as FieldOpsFor, w as TColumnDiff, x as OwnPropsOf, y as FilterExpr, z as TDbUpdateResult } from "./db-readable-
|
|
1
|
+
import { $ as Uniquery, A as TDbForeignKey, B as TExistingColumn, C as TCascadeTarget, D as TDbDefaultValue, E as TDbDefaultFn, F as TDbInsertResult, G as TMetadataOverrides, H as TFkLookupResolver, I as TDbReferentialAction, J as TTableOptionDiff, K as TSearchIndexInfo, L as TDbRelation, M as TDbIndexField, N as TDbIndexType, O as TDbDeleteResult, P as TDbInsertManyResult, Q as TypedWithRelation, R as TDbStorageType, S as TCascadeResolver, T as TDbCollation, U as TFkLookupTarget, V as TExistingTableOption, W as TIdDescriptor, X as TValueFormatterPair, Y as TTableResolver, Z as TWriteTableResolver, _ as DbQuery, a as FieldMappingStrategy, b as NavPropsOf, c as NoopLogger, d as AggregateExpr, et as UniqueryControls, f as AggregateFn, g as DbControls, h as AtscriptDbWritable, i as DocumentFieldMapper, j as TDbIndex, k as TDbFieldMeta, l as TGenericLogger, m as AggregateResult, n as DbResponse, nt as UniquSelect, o as BaseDbAdapter, p as AggregateQuery, q as TSyncColumnResult, r as resolveDesignType, s as TableMetadata, t as AtscriptDbReadable, tt as WithRelation, u as AggregateControls, v as FieldOpsFor, w as TColumnDiff, x as OwnPropsOf, y as FilterExpr, z as TDbUpdateResult } from "./db-readable-BIU8D1OQ.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-
|
|
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-vDpqDRkP.cjs";
|
|
4
4
|
import { n as createDbValidatorPlugin, t as DbValidationContext } from "./db-validator-plugin-Cz4QoDWg.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 Uniquery, A as TDbForeignKey, B as TExistingColumn, C as TCascadeTarget, D as TDbDefaultValue, E as TDbDefaultFn, F as TDbInsertResult, G as TMetadataOverrides, H as TFkLookupResolver, I as TDbReferentialAction, J as TTableOptionDiff, K as TSearchIndexInfo, L as TDbRelation, M as TDbIndexField, N as TDbIndexType, O as TDbDeleteResult, P as TDbInsertManyResult, Q as TypedWithRelation, R as TDbStorageType, S as TCascadeResolver, T as TDbCollation, U as TFkLookupTarget, V as TExistingTableOption, W as TIdDescriptor, X as TValueFormatterPair, Y as TTableResolver, Z as TWriteTableResolver, _ as DbQuery, a as FieldMappingStrategy, b as NavPropsOf, c as NoopLogger, d as AggregateExpr, et as UniqueryControls, f as AggregateFn, g as DbControls, h as AtscriptDbWritable, i as DocumentFieldMapper, j as TDbIndex, k as TDbFieldMeta, l as TGenericLogger, m as AggregateResult, n as DbResponse, nt as UniquSelect, o as BaseDbAdapter, p as AggregateQuery, q as TSyncColumnResult, r as resolveDesignType, s as TableMetadata, t as AtscriptDbReadable, tt as WithRelation, u as AggregateControls, v as FieldOpsFor, w as TColumnDiff, x as OwnPropsOf, y as FilterExpr, z as TDbUpdateResult } from "./db-readable-
|
|
1
|
+
import { $ as Uniquery, A as TDbForeignKey, B as TExistingColumn, C as TCascadeTarget, D as TDbDefaultValue, E as TDbDefaultFn, F as TDbInsertResult, G as TMetadataOverrides, H as TFkLookupResolver, I as TDbReferentialAction, J as TTableOptionDiff, K as TSearchIndexInfo, L as TDbRelation, M as TDbIndexField, N as TDbIndexType, O as TDbDeleteResult, P as TDbInsertManyResult, Q as TypedWithRelation, R as TDbStorageType, S as TCascadeResolver, T as TDbCollation, U as TFkLookupTarget, V as TExistingTableOption, W as TIdDescriptor, X as TValueFormatterPair, Y as TTableResolver, Z as TWriteTableResolver, _ as DbQuery, a as FieldMappingStrategy, b as NavPropsOf, c as NoopLogger, d as AggregateExpr, et as UniqueryControls, f as AggregateFn, g as DbControls, h as AtscriptDbWritable, i as DocumentFieldMapper, j as TDbIndex, k as TDbFieldMeta, l as TGenericLogger, m as AggregateResult, n as DbResponse, nt as UniquSelect, o as BaseDbAdapter, p as AggregateQuery, q as TSyncColumnResult, r as resolveDesignType, s as TableMetadata, t as AtscriptDbReadable, tt as WithRelation, u as AggregateControls, v as FieldOpsFor, w as TColumnDiff, x as OwnPropsOf, y as FilterExpr, z as TDbUpdateResult } from "./db-readable-COxcZfSy.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-DcHDxrjX.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-
|
|
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-jEX71kKU.mjs";
|
|
4
4
|
import { n as createDbValidatorPlugin, t as DbValidationContext } from "./db-validator-plugin-KC4aNIQq.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-BeXlQISk.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 { h as DbError } from "./nested-writer-CNDyhg2L.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-
|
|
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-B1j_IKSf.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-D_7Fqzs4.mjs";
|
|
5
5
|
import { computeInsights, isPrimitive, walkFilter } from "@uniqu/core";
|
package/dist/plugin.cjs
CHANGED
|
@@ -753,6 +753,15 @@ const dbTableAnnotations = {
|
|
|
753
753
|
description: "Schema/namespace name."
|
|
754
754
|
}
|
|
755
755
|
}),
|
|
756
|
+
http: { path: new _atscript_core.AnnotationSpec({
|
|
757
|
+
description: "HTTP endpoint path where this table is served. Used by the UI for value-help on FK fields. Gets overwritten by the final controller prefix at runtime.\n\n**Example:**\n```atscript\n@db.table \"authors\"\n@db.http.path \"/authors\"\nexport interface Author { ... }\n```\n",
|
|
758
|
+
nodeType: ["interface"],
|
|
759
|
+
argument: {
|
|
760
|
+
name: "path",
|
|
761
|
+
type: "string",
|
|
762
|
+
description: "Relative HTTP path (e.g., '/authors')"
|
|
763
|
+
}
|
|
764
|
+
}) },
|
|
756
765
|
sync: { method: new _atscript_core.AnnotationSpec({
|
|
757
766
|
description: "Controls how the sync engine handles structural changes that cannot be applied via ALTER TABLE.\n\n- `\"recreate\"` — lossless: create temp table, copy data, drop old, rename.\n- `\"drop\"` — lossy: drop table entirely and create from scratch.\n\nWithout this annotation, structural changes fail with an error requiring manual intervention.\n\n**Example:**\n```atscript\n@db.sync.method \"drop\"\ninterface Logs { ... }\n```\n",
|
|
758
767
|
nodeType: ["interface"],
|
|
@@ -953,6 +962,7 @@ const dbPlugin = () => ({
|
|
|
953
962
|
default: dbColumnAnnotations.default,
|
|
954
963
|
json: dbColumnAnnotations.json,
|
|
955
964
|
ignore: dbColumnAnnotations.ignore,
|
|
965
|
+
http: dbTableAnnotations.http,
|
|
956
966
|
sync: dbTableAnnotations.sync,
|
|
957
967
|
rel: dbRelAnnotations.rel,
|
|
958
968
|
view: dbViewAnnotations.view,
|
package/dist/plugin.mjs
CHANGED
|
@@ -749,6 +749,15 @@ const dbTableAnnotations = {
|
|
|
749
749
|
description: "Schema/namespace name."
|
|
750
750
|
}
|
|
751
751
|
}),
|
|
752
|
+
http: { path: new AnnotationSpec({
|
|
753
|
+
description: "HTTP endpoint path where this table is served. Used by the UI for value-help on FK fields. Gets overwritten by the final controller prefix at runtime.\n\n**Example:**\n```atscript\n@db.table \"authors\"\n@db.http.path \"/authors\"\nexport interface Author { ... }\n```\n",
|
|
754
|
+
nodeType: ["interface"],
|
|
755
|
+
argument: {
|
|
756
|
+
name: "path",
|
|
757
|
+
type: "string",
|
|
758
|
+
description: "Relative HTTP path (e.g., '/authors')"
|
|
759
|
+
}
|
|
760
|
+
}) },
|
|
752
761
|
sync: { method: new AnnotationSpec({
|
|
753
762
|
description: "Controls how the sync engine handles structural changes that cannot be applied via ALTER TABLE.\n\n- `\"recreate\"` — lossless: create temp table, copy data, drop old, rename.\n- `\"drop\"` — lossy: drop table entirely and create from scratch.\n\nWithout this annotation, structural changes fail with an error requiring manual intervention.\n\n**Example:**\n```atscript\n@db.sync.method \"drop\"\ninterface Logs { ... }\n```\n",
|
|
754
763
|
nodeType: ["interface"],
|
|
@@ -949,6 +958,7 @@ const dbPlugin = () => ({
|
|
|
949
958
|
default: dbColumnAnnotations.default,
|
|
950
959
|
json: dbColumnAnnotations.json,
|
|
951
960
|
ignore: dbColumnAnnotations.ignore,
|
|
961
|
+
http: dbTableAnnotations.http,
|
|
952
962
|
sync: dbTableAnnotations.sync,
|
|
953
963
|
rel: dbRelAnnotations.rel,
|
|
954
964
|
view: dbViewAnnotations.view,
|
package/dist/rel.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as TDbForeignKey, L as TDbRelation, Y as TTableResolver, Z as TWriteTableResolver, l as TGenericLogger, o as BaseDbAdapter, s as TableMetadata } from "./db-readable-
|
|
1
|
+
import { A as TDbForeignKey, L as TDbRelation, Y as TTableResolver, Z as TWriteTableResolver, l as TGenericLogger, o as BaseDbAdapter, s as TableMetadata } from "./db-readable-BIU8D1OQ.cjs";
|
|
2
2
|
import { t as DbValidationContext } from "./db-validator-plugin-Cz4QoDWg.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 { A as TDbForeignKey, L as TDbRelation, Y as TTableResolver, Z as TWriteTableResolver, l as TGenericLogger, o as BaseDbAdapter, s as TableMetadata } from "./db-readable-
|
|
1
|
+
import { A as TDbForeignKey, L as TDbRelation, Y as TTableResolver, Z as TWriteTableResolver, l as TGenericLogger, o as BaseDbAdapter, s as TableMetadata } from "./db-readable-COxcZfSy.mjs";
|
|
2
2
|
import { t as DbValidationContext } from "./db-validator-plugin-KC4aNIQq.mjs";
|
|
3
3
|
import { Validator } from "@atscript/typescript/utils";
|
|
4
4
|
import { FilterExpr, WithRelation } from "@uniqu/core";
|
package/dist/sync.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./nested-writer-BIQ6EfaR.cjs");
|
|
3
|
-
const require_db_view = require("./db-view-
|
|
3
|
+
const require_db_view = require("./db-view-DjDKgytJ.cjs");
|
|
4
4
|
require("./validator-0iGuvGOD.cjs");
|
|
5
5
|
//#region src/schema/schema-hash.ts
|
|
6
6
|
/** Extracts sorted field snapshots from a readable's field descriptors. */
|
package/dist/sync.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as TDbForeignKey, B as TExistingColumn, D as TDbDefaultValue, J as TTableOptionDiff, R as TDbStorageType, V as TExistingTableOption, k as TDbFieldMeta, l as TGenericLogger, t as AtscriptDbReadable, w as TColumnDiff } from "./db-readable-
|
|
2
|
-
import { r as AtscriptDbView, t as DbSpace } from "./db-space-
|
|
1
|
+
import { A as TDbForeignKey, B as TExistingColumn, D as TDbDefaultValue, J as TTableOptionDiff, R as TDbStorageType, V as TExistingTableOption, k as TDbFieldMeta, l as TGenericLogger, t as AtscriptDbReadable, w as TColumnDiff } from "./db-readable-BIU8D1OQ.cjs";
|
|
2
|
+
import { r as AtscriptDbView, t as DbSpace } from "./db-space-vDpqDRkP.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 { A as TDbForeignKey, B as TExistingColumn, D as TDbDefaultValue, J as TTableOptionDiff, R as TDbStorageType, V as TExistingTableOption, k as TDbFieldMeta, l as TGenericLogger, t as AtscriptDbReadable, w as TColumnDiff } from "./db-readable-
|
|
2
|
-
import { r as AtscriptDbView, t as DbSpace } from "./db-space-
|
|
1
|
+
import { A as TDbForeignKey, B as TExistingColumn, D as TDbDefaultValue, J as TTableOptionDiff, R as TDbStorageType, V as TExistingTableOption, k as TDbFieldMeta, l as TGenericLogger, t as AtscriptDbReadable, w as TColumnDiff } from "./db-readable-COxcZfSy.mjs";
|
|
2
|
+
import { r as AtscriptDbView, t as DbSpace } from "./db-space-jEX71kKU.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,5 +1,5 @@
|
|
|
1
1
|
import "./nested-writer-CNDyhg2L.mjs";
|
|
2
|
-
import { h as NoopLogger } from "./db-view-
|
|
2
|
+
import { h as NoopLogger } from "./db-view-B1j_IKSf.mjs";
|
|
3
3
|
import "./validator-D_7Fqzs4.mjs";
|
|
4
4
|
//#region src/schema/schema-hash.ts
|
|
5
5
|
/** Extracts sorted field snapshots from a readable's field descriptors. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/db",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.46",
|
|
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.
|
|
71
|
-
"@atscript/typescript": "^0.1.
|
|
70
|
+
"@atscript/core": "^0.1.47",
|
|
71
|
+
"@atscript/typescript": "^0.1.47",
|
|
72
72
|
"@uniqu/core": "^0.1.2",
|
|
73
|
-
"unplugin-atscript": "^0.1.
|
|
73
|
+
"unplugin-atscript": "^0.1.47"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@atscript/core": "^0.1.
|
|
77
|
-
"@atscript/typescript": "^0.1.
|
|
76
|
+
"@atscript/core": "^0.1.47",
|
|
77
|
+
"@atscript/typescript": "^0.1.47",
|
|
78
78
|
"@uniqu/core": "^0.1.2"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|