@atscript/db 0.1.140 → 0.1.141
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/agg.d.cts +1 -1
- package/dist/agg.d.mts +1 -1
- package/dist/{buckets-C-27xmtq.d.cts → buckets-Bv4pah66.d.cts} +225 -22
- package/dist/{buckets-BFG2RYRW.d.mts → buckets-CjL7F-hp.d.mts} +225 -22
- package/dist/{column-diff-CgxgFKzx.cjs → column-diff-CfPNcP6e.cjs} +663 -239
- package/dist/{column-diff-BwOA5101.mjs → column-diff-CmFNXV8C.mjs} +638 -220
- package/dist/column-diff-DiBbXyLA.d.cts +211 -0
- package/dist/column-diff-n-k5KY0u.d.mts +211 -0
- package/dist/derived-rules-0sKn4f5C.mjs +44 -0
- package/dist/derived-rules-YstgIxG-.cjs +67 -0
- package/dist/index.cjs +38 -4
- package/dist/index.d.cts +23 -6
- package/dist/index.d.mts +23 -6
- package/dist/index.mjs +34 -4
- package/dist/{nested-writer-FWD5oOYh.mjs → nested-writer-BO3vhbkP.mjs} +8 -4
- package/dist/{nested-writer-BZNCuqI6.cjs → nested-writer-DYsRxZ5f.cjs} +8 -4
- package/dist/object-DSN0h9lB.d.cts +30 -0
- package/dist/object-DSN0h9lB.d.mts +30 -0
- package/dist/plugin.cjs +392 -139
- package/dist/plugin.mjs +392 -139
- package/dist/rel.cjs +2 -2
- package/dist/rel.d.cts +2 -2
- package/dist/rel.d.mts +2 -2
- package/dist/rel.mjs +2 -2
- package/dist/{relation-helpers-D3Zu0Mta.d.mts → relation-helpers-B59to_dG.d.mts} +5 -4
- package/dist/{relation-helpers-DxrvS6ar.d.cts → relation-helpers-DQ_nRsV9.d.cts} +5 -4
- package/dist/{relation-loader-6ZB_5KFq.cjs → relation-loader-CgJ8bK6X.cjs} +1 -1
- package/dist/{relation-loader-CTFaZpVa.mjs → relation-loader-CuhEBzFU.mjs} +1 -1
- package/dist/shared.cjs +6 -1
- package/dist/shared.d.cts +48 -9
- package/dist/shared.d.mts +48 -9
- package/dist/shared.mjs +2 -2
- package/dist/sync.cjs +331 -105
- package/dist/sync.d.cts +62 -163
- package/dist/sync.d.mts +62 -163
- package/dist/sync.mjs +331 -105
- package/dist/{validation-utils-B4h-GW4d.mjs → validation-utils-CMR4fe2M.mjs} +99 -34
- package/dist/{validation-utils-Dg0hW6dn.cjs → validation-utils-DOsB4e6G.cjs} +128 -33
- package/dist/{validator-Drb2N-YL.d.cts → validator-Bw6ks9Hy.d.cts} +1 -11
- package/dist/{validator-Drb2N-YL.d.mts → validator-Bw6ks9Hy.d.mts} +1 -11
- package/dist/{validator-Ch7UIQl9.mjs → validator-D8bPsXPN.mjs} +54 -2
- package/dist/{validator-BtZbcLN2.cjs → validator-DASnXf1j.cjs} +77 -1
- package/dist/validator.cjs +1 -1
- package/dist/validator.d.cts +2 -1
- package/dist/validator.d.mts +2 -1
- package/dist/validator.mjs +1 -1
- package/package.json +6 -6
- package/dist/column-diff-BmqvgBWw.d.cts +0 -24
- package/dist/column-diff-DPkbZIVE.d.mts +0 -24
package/dist/validator.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { a as $mul, c as $update, d as TDbFieldOp, g as separateCas, h as reconcileCas, i as $insert, l as $upsert, m as isDbFieldOp, n as $dec, o as $remove, r as $inc, s as $replace, t as $cas, u as TDbCas } from "./ops-AqhV7s9o.mjs";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as isPlainObject, i as isEmptyObject } from "./object-DSN0h9lB.mjs";
|
|
3
|
+
import { a as buildValidationContext, c as isNavRelation, d as getKeyProps, i as buildPatchPartial, l as TArrayPatch, m as DbError, n as ValidatorMode, o as dbPlugin, r as buildDbValidator, s as forceNavNonOptional, t as ValidationContext, u as TDbPatch } from "./validator-Bw6ks9Hy.mjs";
|
|
3
4
|
import { n as createDbValidatorPlugin, t as DbValidationContext } from "./db-validator-plugin-BWy60OvG.mjs";
|
|
4
5
|
export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, DbError, type DbValidationContext, type TArrayPatch, type TDbCas, type TDbFieldOp, type TDbPatch, ValidationContext, ValidatorMode, buildDbValidator, buildPatchPartial, buildValidationContext, createDbValidatorPlugin, dbPlugin, forceNavNonOptional, getKeyProps, isDbFieldOp, isEmptyObject, isNavRelation, isPlainObject, reconcileCas, separateCas };
|
package/dist/validator.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { r as DbError } from "./db-error-D5uilS_A.mjs";
|
|
2
|
-
import { a as forceNavNonOptional, c as getKeyProps,
|
|
2
|
+
import { a as forceNavNonOptional, c as getKeyProps, f as isEmptyObject, i as dbPlugin, n as buildPatchPartial, o as isNavRelation, p as isPlainObject, r as buildValidationContext, s as createDbValidatorPlugin, t as buildDbValidator } from "./validator-D8bPsXPN.mjs";
|
|
3
3
|
import { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, isDbFieldOp, reconcileCas, separateCas } from "./ops.mjs";
|
|
4
4
|
export { $cas, $dec, $inc, $insert, $mul, $remove, $replace, $update, $upsert, DbError, buildDbValidator, buildPatchPartial, buildValidationContext, createDbValidatorPlugin, dbPlugin, forceNavNonOptional, getKeyProps, isDbFieldOp, isEmptyObject, isNavRelation, isPlainObject, reconcileCas, separateCas };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/db",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.141",
|
|
4
4
|
"description": "Database adapter utilities for atscript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atscript",
|
|
@@ -71,14 +71,14 @@
|
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@atscript/core": "^0.1.
|
|
75
|
-
"@atscript/typescript": "^0.1.
|
|
74
|
+
"@atscript/core": "^0.1.95",
|
|
75
|
+
"@atscript/typescript": "^0.1.95",
|
|
76
76
|
"@uniqu/core": "^0.1.11",
|
|
77
|
-
"unplugin-atscript": "^0.1.
|
|
77
|
+
"unplugin-atscript": "^0.1.95"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"@atscript/core": "^0.1.
|
|
81
|
-
"@atscript/typescript": "^0.1.
|
|
80
|
+
"@atscript/core": "^0.1.95",
|
|
81
|
+
"@atscript/typescript": "^0.1.95",
|
|
82
82
|
"@uniqu/core": "^0.1.11"
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { D as TColumnDiff, R as TDbFieldMeta, rt as TExistingColumn } from "./buckets-C-27xmtq.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/schema/column-diff.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Whether a live column's type differs from the type the adapter's
|
|
6
|
-
* `typeMapper` gives the field — the one rule schema sync diffs column types
|
|
7
|
-
* by (case-insensitive). Exported for adapters that must agree with it (the
|
|
8
|
-
* PostgreSQL recreate converts exactly the columns this reports changed).
|
|
9
|
-
* @since 0.1.137
|
|
10
|
-
*/
|
|
11
|
-
declare function isColumnTypeChanged(existingType: string, expectedType: string): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Computes the difference between desired schema fields and existing database columns.
|
|
14
|
-
*
|
|
15
|
-
* @param desired - Field descriptors from the Atscript type (after flattening).
|
|
16
|
-
* @param existing - Columns currently in the database (from introspection).
|
|
17
|
-
* @param typeMapper - Optional function to map field metadata to DB-native type strings.
|
|
18
|
-
* Receives the full field meta (design type, annotations, PK status, etc.)
|
|
19
|
-
* so adapters can produce context-aware types (e.g., `VARCHAR(255)` from maxLength).
|
|
20
|
-
* Required for type change detection.
|
|
21
|
-
*/
|
|
22
|
-
declare function computeColumnDiff(desired: readonly TDbFieldMeta[], existing: TExistingColumn[], typeMapper?: (field: TDbFieldMeta) => string): TColumnDiff;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { isColumnTypeChanged as n, computeColumnDiff as t };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { D as TColumnDiff, R as TDbFieldMeta, rt as TExistingColumn } from "./buckets-BFG2RYRW.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/schema/column-diff.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Whether a live column's type differs from the type the adapter's
|
|
6
|
-
* `typeMapper` gives the field — the one rule schema sync diffs column types
|
|
7
|
-
* by (case-insensitive). Exported for adapters that must agree with it (the
|
|
8
|
-
* PostgreSQL recreate converts exactly the columns this reports changed).
|
|
9
|
-
* @since 0.1.137
|
|
10
|
-
*/
|
|
11
|
-
declare function isColumnTypeChanged(existingType: string, expectedType: string): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Computes the difference between desired schema fields and existing database columns.
|
|
14
|
-
*
|
|
15
|
-
* @param desired - Field descriptors from the Atscript type (after flattening).
|
|
16
|
-
* @param existing - Columns currently in the database (from introspection).
|
|
17
|
-
* @param typeMapper - Optional function to map field metadata to DB-native type strings.
|
|
18
|
-
* Receives the full field meta (design type, annotations, PK status, etc.)
|
|
19
|
-
* so adapters can produce context-aware types (e.g., `VARCHAR(255)` from maxLength).
|
|
20
|
-
* Required for type change detection.
|
|
21
|
-
*/
|
|
22
|
-
declare function computeColumnDiff(desired: readonly TDbFieldMeta[], existing: TExistingColumn[], typeMapper?: (field: TDbFieldMeta) => string): TColumnDiff;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { isColumnTypeChanged as n, computeColumnDiff as t };
|