@voltro/database 0.87.0 → 0.88.0
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/CHANGELOG.md +169 -6
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/dist/actorSnapshot.js +1 -2
- package/dist/arrayCodec.js +1 -2
- package/dist/branchExecute.js +1 -2
- package/dist/branching.js +1 -2
- package/dist/bulkInsertLimits.js +16 -12
- package/dist/cdcOffsetsTables.js +1 -2
- package/dist/changeEvent.js +1 -2
- package/dist/changeIdentity.js +1 -2
- package/dist/changeListenerCeiling.js +1 -2
- package/dist/columnReference.js +1 -2
- package/dist/columns.js +1 -2
- package/dist/committedChanges.js +1 -2
- package/dist/connectionIdentity.js +1 -2
- package/dist/coreTables.js +1 -2
- package/dist/coreTablesRegistry.js +1 -2
- package/dist/dataTransfers.js +1 -2
- package/dist/dbCause.js +1 -2
- package/dist/dbMetrics.js +1 -2
- package/dist/decimalComparison.js +1 -2
- package/dist/derivedRowId.js +1 -2
- package/dist/dialect.js +1 -2
- package/dist/enumRenames.js +1 -2
- package/dist/expiresMixin.js +1 -2
- package/dist/fieldEncryption.js +1 -2
- package/dist/frameworkTables.js +1 -2
- package/dist/ginIndex.js +1 -2
- package/dist/hybridSearch.js +1 -2
- package/dist/idGenerator.js +1 -2
- package/dist/identifierLimits.js +1 -2
- package/dist/index.d.ts +5 -7
- package/dist/index.js +1 -2
- package/dist/indexAudit.js +45 -44
- package/dist/indexStorage.js +1 -2
- package/dist/joinCompiler.js +1 -2
- package/dist/jsonEagerCompiler.js +1 -2
- package/dist/jsonPatch.js +1 -2
- package/dist/jsonPatchAssignments.js +1 -2
- package/dist/jsonPath.js +1 -2
- package/dist/localFirstMixin.js +1 -2
- package/dist/migrate.js +1 -2
- package/dist/migration.js +1 -2
- package/dist/migrations/appliedAtValue.js +1 -2
- package/dist/migrations/applier.js +1 -2
- package/dist/migrations/boot.js +2 -3
- package/dist/migrations/branchRehearsal.js +1 -2
- package/dist/migrations/columnEquivalence.js +1 -2
- package/dist/migrations/ddlError.js +1 -2
- package/dist/migrations/ddlStatements.js +1 -2
- package/dist/migrations/declaredSchema.js +2 -3
- package/dist/migrations/deployLedger.js +1 -2
- package/dist/migrations/fileBased.js +1 -2
- package/dist/migrations/fileContext.js +1 -2
- package/dist/migrations/fileDiscovery.js +1 -2
- package/dist/migrations/fileSkipProbes.js +1 -2
- package/dist/migrations/fingerprint.js +1 -2
- package/dist/migrations/fkCycles.js +1 -2
- package/dist/migrations/frameworkLiveTables.js +1 -2
- package/dist/migrations/idempotentDdl.js +1 -2
- package/dist/migrations/indexPredicate.js +1 -2
- package/dist/migrations/introspect.js +3 -4
- package/dist/migrations/ledgerRows.js +1 -2
- package/dist/migrations/lock.js +1 -2
- package/dist/migrations/migrationTableExists.js +1 -2
- package/dist/migrations/mssqlColumnDependencies.js +1 -2
- package/dist/migrations/mysqlEngine.js +1 -2
- package/dist/migrations/namespaceCharset.js +1 -2
- package/dist/migrations/planner.js +3 -4
- package/dist/migrations/postgresEnumCheck.js +1 -2
- package/dist/migrations/reactiveTriggerDrift.js +1 -2
- package/dist/migrations/reactiveTriggerName.js +1 -2
- package/dist/migrations/renameMssqlCheck.js +1 -2
- package/dist/migrations/restoreSnapshots.js +1 -2
- package/dist/migrations/resumeLedger.js +1 -2
- package/dist/migrations/rollingDeploy.js +1 -2
- package/dist/migrations/schemaOwner.js +1 -2
- package/dist/migrations/schemaOwnerTable.js +1 -2
- package/dist/migrations/softDropSnapshot.js +1 -2
- package/dist/migrations/sqlLimit.js +1 -2
- package/dist/migrations/sqliteCatalogName.js +1 -2
- package/dist/migrations/sqliteConstraintIdentity.js +1 -2
- package/dist/migrations/sqliteDecimalBoot.js +1 -2
- package/dist/migrations/sqliteDecimalPublication.js +1 -2
- package/dist/migrations/sqliteDecimalReview.js +1 -2
- package/dist/migrations/sqliteDecimalReviewStore.js +1 -2
- package/dist/migrations/sqliteDecimalReviewWitness.js +1 -2
- package/dist/migrations/sqliteDecimalSource.js +1 -2
- package/dist/migrations/sqliteDecimalStage.js +1 -2
- package/dist/migrations/sqliteForeignKeys.js +1 -2
- package/dist/migrations/sqliteMigrationBatch.js +1 -2
- package/dist/migrations/sqliteRetainedSource.js +1 -2
- package/dist/migrations/sqliteRowIdentity.js +1 -2
- package/dist/migrations/sqliteSchemaEpoch.js +1 -2
- package/dist/migrations/sqliteSnapshotGuard.js +1 -2
- package/dist/migrations/sqliteTableContents.js +1 -2
- package/dist/migrations/sqliteTableCopy.js +1 -2
- package/dist/migrations/sqliteTableSchema.js +1 -2
- package/dist/migrations/sqliteWitnessProtection.js +1 -2
- package/dist/migrations/squash.js +1 -2
- package/dist/migrations/storeCharset.js +1 -2
- package/dist/migrations/transactionCause.js +1 -2
- package/dist/migrations/undeclaredCharset.js +1 -2
- package/dist/migrations/uniqueActiveLowering.js +1 -2
- package/dist/mixins.js +1 -2
- package/dist/mssqlDecimalDistinct.js +1 -2
- package/dist/mssqlJsonValueCheck.js +1 -2
- package/dist/mssqlTextStorage.js +1 -2
- package/dist/namespace.js +1 -2
- package/dist/optimisticVersion.js +1 -2
- package/dist/pendingAttribution.js +1 -2
- package/dist/pluginRef.js +1 -2
- package/dist/predicate.js +1 -2
- package/dist/predicateCoercion.js +1 -2
- package/dist/projectedColumn.js +1 -2
- package/dist/queryBuilder.js +1 -2
- package/dist/rawSql.js +1 -2
- package/dist/relations.js +1 -2
- package/dist/relationsRegistry.js +1 -2
- package/dist/replaceInProgress.js +1 -2
- package/dist/requiredColumns.js +1 -2
- package/dist/residency.js +1 -2
- package/dist/retention.js +1 -2
- package/dist/rowDecoder.js +1 -2
- package/dist/rowKey.js +1 -2
- package/dist/rowSchema.js +1 -2
- package/dist/scopeKey.js +1 -2
- package/dist/seed.js +1 -2
- package/dist/snowflake.js +1 -2
- package/dist/sqlCompiler.js +1 -2
- package/dist/sqlError.js +1 -2
- package/dist/sqlMutation.js +1 -2
- package/dist/sqlPoolCapacity.js +1 -2
- package/dist/sqliteDecimal.js +1 -2
- package/dist/sqliteDecimalAggregateSql.js +1 -2
- package/dist/sqliteDecimalColumnSql.js +1 -2
- package/dist/sqliteDecimalConversion.js +1 -2
- package/dist/sqliteDecimalCte.js +1 -2
- package/dist/sqliteDecimalEncodeSql.js +1 -2
- package/dist/sqliteDecimalOutputs.js +1 -2
- package/dist/sqliteDecimalPredicate.js +1 -2
- package/dist/sqliteDecimalQuery.js +1 -2
- package/dist/sqliteDecimalQueryPlan.js +1 -2
- package/dist/sqliteDecimalResultSql.js +1 -2
- package/dist/sqliteDecimalRowQuery.js +1 -2
- package/dist/sqliteDecimalSetQuery.js +1 -2
- package/dist/sqliteDecimalSource.js +1 -2
- package/dist/sqliteDecimalStorage.js +1 -2
- package/dist/sqliteDecimalSubquery.js +1 -2
- package/dist/sqliteDecimalWindowQuery.js +1 -2
- package/dist/sqliteValueCoercion.js +1 -2
- package/dist/stampId.js +1 -2
- package/dist/storeErrors.js +1 -2
- package/dist/storeRefusal.js +1 -2
- package/dist/stream.js +1 -2
- package/dist/subjectGraph.js +1 -2
- package/dist/table.js +1 -2
- package/dist/tableRegistry.js +1 -2
- package/dist/tenantSelection.js +1 -2
- package/dist/transactionOutcome.js +1 -2
- package/dist/transientContention.js +1 -2
- package/dist/typeId.js +1 -2
- package/dist/typedStore.js +1 -2
- package/dist/upsertUpdate.js +1 -2
- package/dist/vectorEmbedding.js +1 -2
- package/dist/view.js +1 -2
- package/dist/wire.js +1 -2
- package/dist/writeAttribution.js +1 -2
- package/dist/writeRecorder.js +1 -2
- package/package.json +3 -3
|
@@ -2,7 +2,7 @@ import { isFrameworkOwnedLiveTable as e, isSoftDropSnapshotName as t, isStagingT
|
|
|
2
2
|
import { withMigrationLock as r } from "./lock.js";
|
|
3
3
|
import { columnLevelChecksMysql as i } from "./applier.js";
|
|
4
4
|
import { Effect as a } from "effect";
|
|
5
|
-
|
|
5
|
+
// src/migrations/undeclaredCharset.ts
|
|
6
6
|
var o = "utf8mb4", s = (r, i) => e(r) && !i.has(r) && !r.startsWith("_cloud_") && !r.startsWith("__turso_internal_") && !t(r) && !n(r), c = (e) => e.columnDefault !== null && e.columnDefault.toUpperCase() !== "NULL", l = (e, t, n, r) => {
|
|
7
7
|
if (n !== o) return {
|
|
8
8
|
tables: [],
|
|
@@ -36,5 +36,4 @@ var o = "utf8mb4", s = (r, i) => e(r) && !i.has(r) && !r.startsWith("_cloud_") &
|
|
|
36
36
|
let n = l(yield* p(e), t.declaredNames, t.charset);
|
|
37
37
|
return yield* g(e, n), n;
|
|
38
38
|
}), { schema: t.lockSchema });
|
|
39
|
-
//#endregion
|
|
40
39
|
export { g as applyUndeclaredCharsetWork, _ as convergeUndeclaredCharset, d as describeUndeclaredCharsetWork, s as isUndeclaredCharsetTable, u as isUndeclaredCharsetWorkEmpty, p as readUndeclaredCharsetColumns, h as undeclaredCharsetStatements, l as undeclaredCharsetWork };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/migrations/uniqueActiveLowering.ts
|
|
2
2
|
var e = (e) => e.unique === !0 && typeof e.where == "string" && e.where.length > 0, t = (e) => e.replace(/"/g, "`"), n = (e) => typeof e == "string" ? e : e.name ?? String(e), r = (e, t) => `_ua_${t}_${e}`.slice(0, 64), i = (i, a) => {
|
|
3
3
|
if (a !== "mysql" && a !== "mariadb" || !i.appliedIndexes.some(e)) return i;
|
|
4
4
|
let o = { ...i.fields }, s = [], c = [];
|
|
@@ -35,5 +35,4 @@ var e = (e) => e.unique === !0 && typeof e.where == "string" && e.where.length >
|
|
|
35
35
|
appliedUniques: [...i.appliedUniques ?? [], ...c]
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
-
//#endregion
|
|
39
38
|
export { i as lowerUniqueActive };
|
package/dist/mixins.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { materializeFields as e } from "./columns.js";
|
|
2
|
-
|
|
2
|
+
// src/mixins.ts
|
|
3
3
|
var t = (t) => ({
|
|
4
4
|
fields: e(t.fields),
|
|
5
5
|
...t.id === void 0 ? {} : { id: t.id },
|
|
@@ -18,5 +18,4 @@ var t = (t) => ({
|
|
|
18
18
|
for (let t of e) r(t);
|
|
19
19
|
return n;
|
|
20
20
|
};
|
|
21
|
-
//#endregion
|
|
22
21
|
export { n as defineMixin, t as mixin, r as resolveMixinGraph };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getTable as e } from "./tableRegistry.js";
|
|
2
2
|
import { prepareProjectedColumn as t } from "./projectedColumn.js";
|
|
3
|
-
|
|
3
|
+
// src/mssqlDecimalDistinct.ts
|
|
4
4
|
var n = (n) => {
|
|
5
5
|
if (!n.distinct && !n.distinctOn?.length || n.aggregations?.length || n.setOp) return;
|
|
6
6
|
let r = t(n), i = n.sourceTable?.tableName === n.table ? n.sourceTable : e(n.table), a = n.joinedProjection ?? (n.projection?.length ? n.projection : Object.keys(i?.fields ?? {})).map((e) => ({
|
|
@@ -47,5 +47,4 @@ var n = (n) => {
|
|
|
47
47
|
}]
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
//#endregion
|
|
51
50
|
export { n as mssqlDecimalDistinct };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/mssqlJsonValueCheck.ts
|
|
2
2
|
var e = (e) => {
|
|
3
3
|
let t = `(N'{"v":' + ${e} + N'}')`, n = `ISJSON(${t}) = 1`, r = `JSON_MODIFY(CASE WHEN ${n} THEN ${t} ELSE N'{}' END, '$.v', NULL)`;
|
|
4
4
|
return `(${e} IS NULL OR (${n} AND ${[
|
|
@@ -38,5 +38,4 @@ var e = (e) => {
|
|
|
38
38
|
let t = e.filter((e) => e.enabled);
|
|
39
39
|
return t.some((e) => e.validation === "container") ? t.some((e) => e.validation === "container" && e.trusted) ? "container" : "unverified" : t.some((e) => e.validation === "value" && e.trusted) ? "value" : "unverified";
|
|
40
40
|
};
|
|
41
|
-
//#endregion
|
|
42
41
|
export { n as classifyMssqlJsonCheck, r as mssqlJsonValidation, e as mssqlJsonValueCheck };
|
package/dist/mssqlTextStorage.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/mssqlTextStorage.ts
|
|
2
2
|
var e = (e, t) => {
|
|
3
3
|
if (e.type === "text" && e.generatedAs === void 0) {
|
|
4
4
|
if (e.maxLength !== void 0) return e.maxLength;
|
|
5
5
|
if (t || e.hasDefault && e.defaultFactory === void 0 || e.oneOf !== void 0 && e.oneOf.length > 0) return 450;
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
|
-
//#endregion
|
|
9
8
|
export { e as mssqlTextStorageLength };
|
package/dist/namespace.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/namespace.ts
|
|
2
2
|
var e = class extends Error {
|
|
3
3
|
_tag = "TenantNamespaceUnresolved";
|
|
4
4
|
constructor(e) {
|
|
@@ -17,5 +17,4 @@ var e = class extends Error {
|
|
|
17
17
|
if (s.length > n) throw new t(`namespace '${s}' for tenant '${a}' exceeds the ${n}-byte identifier limit. Use a shorter tenant id.`);
|
|
18
18
|
return s;
|
|
19
19
|
}, o = (e, t) => e === null ? t : `${e}.${t}`;
|
|
20
|
-
//#endregion
|
|
21
20
|
export { t as TenantNamespaceInvalid, e as TenantNamespaceUnresolved, o as qualifyTable, a as resolveTenantNamespace, i as sanitizeIdentifierFragment };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Schema as e } from "effect";
|
|
2
|
-
|
|
2
|
+
// src/optimisticVersion.ts
|
|
3
3
|
var t = class extends e.TaggedError()("VersionConflict", {
|
|
4
4
|
table: e.String,
|
|
5
5
|
id: e.String,
|
|
@@ -28,5 +28,4 @@ var t = class extends e.TaggedError()("VersionConflict", {
|
|
|
28
28
|
actual: e.current
|
|
29
29
|
});
|
|
30
30
|
}, a = 1;
|
|
31
|
-
//#endregion
|
|
32
31
|
export { a as INITIAL_VERSION, t as VersionConflict, r as planVersionedUpdate, i as settleVersionedUpdate, n as versionColumnOf };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/pendingAttribution.ts
|
|
2
2
|
var e = 3e4, t = 1e4, n = /* @__PURE__ */ new Map(), r = [], i = (e, t) => {
|
|
3
3
|
let n = r[e];
|
|
4
4
|
r[e] = r[t], r[t] = n, r[e].heapIndex = e, n.heapIndex = t;
|
|
@@ -75,5 +75,4 @@ var e = 3e4, t = 1e4, n = /* @__PURE__ */ new Map(), r = [], i = (e, t) => {
|
|
|
75
75
|
for (let e of h.values()) clearTimeout(e);
|
|
76
76
|
h.clear(), m.clear();
|
|
77
77
|
}, S = () => r.length;
|
|
78
|
-
//#endregion
|
|
79
78
|
export { c as attributionKey, v as beginLocalWrite, d as claimPendingAttribution, x as clearPendingAttribution, y as endLocalWrite, S as pendingAttributionCount, u as registerPendingAttribution, b as resolveEchoAttribution };
|
package/dist/pluginRef.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ColumnBuilder as e, text as t } from "./columns.js";
|
|
2
|
-
|
|
2
|
+
// src/pluginRef.ts
|
|
3
3
|
var n = Symbol.for("@voltro/database/pluginRefSpec"), r = (e) => {
|
|
4
4
|
if (typeof e == "object" && e) return ("__definition" in e && typeof e.__definition == "function" ? e.__definition() : e)[n];
|
|
5
5
|
}, i = (r, i = {}) => {
|
|
@@ -13,5 +13,4 @@ var n = Symbol.for("@voltro/database/pluginRefSpec"), r = (e) => {
|
|
|
13
13
|
};
|
|
14
14
|
return new e(o);
|
|
15
15
|
};
|
|
16
|
-
//#endregion
|
|
17
16
|
export { i as pluginRef, r as pluginRefSpecOf };
|
package/dist/predicate.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { columnComparisonOperators as e, columnRef as t, isColumnReference as n } from "./columnReference.js";
|
|
2
2
|
import { authoredError as r } from "./dbCause.js";
|
|
3
3
|
import { compareDecimal as i } from "./decimalComparison.js";
|
|
4
|
-
|
|
4
|
+
// src/predicate.ts
|
|
5
5
|
var a = (e, t) => ({
|
|
6
6
|
column: e,
|
|
7
7
|
op: "eq",
|
|
@@ -269,5 +269,4 @@ var a = (e, t) => ({
|
|
|
269
269
|
conjunctive: t && !n(e.value)
|
|
270
270
|
});
|
|
271
271
|
};
|
|
272
|
-
//#endregion
|
|
273
272
|
export { v as MATCHES_NO_ROWS, S as and, h as arrayContains, _ as arrayHas, g as arrayOverlaps, H as collectSubqueries, t as columnRef, p as contains, a as eq, R as evaluatePredicate, k as exists, s as gt, c as gte, d as inSet, D as inSubquery, n as isColumnReference, b as isNotNull, y as isNull, T as jsonField, l as lt, u as lte, o as neq, w as not, A as notExists, f as notInSet, O as notInSubquery, C as or, z as preparePredicate, x as spatialPredicate, m as startsWith, U as walkLeaves };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/predicateCoercion.ts
|
|
2
2
|
var e = /* @__PURE__ */ new Set(["timestamp", "date"]), t = /^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2})?/, n = (n, r) => {
|
|
3
3
|
if (n === void 0 || r == null || !e.has(n) || r instanceof Date) return r;
|
|
4
4
|
if (typeof r == "number" && Number.isFinite(r)) return new Date(r);
|
|
@@ -9,5 +9,4 @@ var e = /* @__PURE__ */ new Set(["timestamp", "date"]), t = /^\d{4}-\d{2}-\d{2}(
|
|
|
9
9
|
}
|
|
10
10
|
return r;
|
|
11
11
|
}, r = (t, r) => t === void 0 || !e.has(t) ? r : r.map((e) => n(t, e));
|
|
12
|
-
//#endregion
|
|
13
12
|
export { n as coercePredicateValue, r as coercePredicateValues };
|
package/dist/projectedColumn.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getTable as e } from "./tableRegistry.js";
|
|
2
|
-
|
|
2
|
+
// src/projectedColumn.ts
|
|
3
3
|
var t = (t, n) => {
|
|
4
4
|
let r = t.lastIndexOf("."), i = r < 0 ? t : t.slice(r + 1), a = r < 0 ? void 0 : t.slice(0, r), o = a === void 0 || a === n.alias || a === n.table, s = o ? void 0 : n.joins?.find((e) => e.alias === a), c = o ? n.table : s?.table, l = o ? n.sourceTable : s?.sourceTable;
|
|
5
5
|
return (l?.tableName === c ? l : c === void 0 ? void 0 : e(c))?.fields[i];
|
|
@@ -33,5 +33,4 @@ var t = (t, n) => {
|
|
|
33
33
|
return (u?.tableName === l ? u : l === void 0 ? void 0 : e(l))?.fields[a];
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
//#endregion
|
|
37
36
|
export { n as prepareProjectedColumn, t as projectedColumn };
|
package/dist/queryBuilder.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getTable as e, registerTable as t } from "./tableRegistry.js";
|
|
2
|
-
|
|
2
|
+
// src/queryBuilder.ts
|
|
3
3
|
var n = (e) => e.order ?? [], r = (e) => ({
|
|
4
4
|
op: "count",
|
|
5
5
|
alias: e ?? "count"
|
|
@@ -384,5 +384,4 @@ var E = (e, t, n) => D(e, "id", t, n), D = (e, t, n, r, i = "asc") => {
|
|
|
384
384
|
for (let [r, i] of Object.entries(e)) t(i), n[r] = T(i);
|
|
385
385
|
return n;
|
|
386
386
|
};
|
|
387
|
-
//#endregion
|
|
388
387
|
export { o as avg, S as avgOver, l as column, r as count, i as countDistinct, O as databaseHandle, v as denseRank, m as except, p as intersect, y as lag, b as lead, c as max, s as min, n as orderClausesOf, D as paginateBy, E as paginateById, T as queryFor, _ as rank, C as resolveFullTextIndex, g as rowNumber, a as sum, x as sumOver, d as union, f as unionAll };
|
package/dist/rawSql.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// src/rawSql.ts
|
|
2
2
|
var e = (e, ...t) => ({
|
|
3
3
|
_tag: "RawSqlFragment",
|
|
4
4
|
strings: [...e],
|
|
5
5
|
values: [...t]
|
|
6
6
|
}), t = (e) => typeof e == "object" && !!e && e._tag === "RawSqlFragment";
|
|
7
|
-
//#endregion
|
|
8
7
|
export { t as isRawSqlFragment, e as sql };
|
package/dist/relations.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { authoredError as e } from "./dbCause.js";
|
|
2
|
-
|
|
2
|
+
// src/relations.ts
|
|
3
3
|
var t = (e) => typeof e == "function" ? e : () => e, n = (e, n) => ({
|
|
4
4
|
kind: "one",
|
|
5
5
|
target: t(e),
|
|
@@ -65,5 +65,4 @@ var t = (e) => typeof e == "function" ? e : () => e, n = (e, n) => ({
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
//#endregion
|
|
69
68
|
export { f as inferForeignKey, s as isEmptyRelationsSpec, c as isRelationsSpec, u as many, d as manyToMany, l as one, o as relations, g as validateRelationConfig };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getTable as e } from "./tableRegistry.js";
|
|
2
2
|
import { isRelationsSpec as t, validateRelationConfig as n } from "./relations.js";
|
|
3
|
-
|
|
3
|
+
// src/relationsRegistry.ts
|
|
4
4
|
var r = Symbol.for("@voltro/database/relationsRegistry"), i = globalThis, a = i[r] ?? (i[r] = /* @__PURE__ */ new Map()), o = (e) => {
|
|
5
5
|
let t = e.source(), n = a.get(t.tableName);
|
|
6
6
|
if (n === void 0) a.set(t.tableName, new Map(Object.entries(e.relations)));
|
|
@@ -34,5 +34,4 @@ var r = Symbol.for("@voltro/database/relationsRegistry"), i = globalThis, a = i[
|
|
|
34
34
|
}, f = () => {
|
|
35
35
|
a.clear();
|
|
36
36
|
};
|
|
37
|
-
//#endregion
|
|
38
37
|
export { u as allRegisteredRelations, f as clearRelationsRegistry, l as getRelation, c as getRelations, s as registerDiscoveredRelations, o as registerRelations, d as validateRegisteredRelations };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { boolean as e, id as t, text as n, timestamp as r } from "./columns.js";
|
|
2
2
|
import { table as i } from "./table.js";
|
|
3
|
-
|
|
3
|
+
// src/replaceInProgress.ts
|
|
4
4
|
var a = "_voltro_replace_in_progress", o = i(a, {
|
|
5
5
|
id: t({ prefix: "repl" }),
|
|
6
6
|
startedAt: r().default("now"),
|
|
@@ -49,5 +49,4 @@ ${e.all.map((e) => {
|
|
|
49
49
|
}).join("\n")}\n The target of a staged \`replace\` is untouched until one short swap at the end, so none of this is
|
|
50
50
|
a reason to refuse the boot — it is a reason to know the disk is holding a copy of a bundle.`;
|
|
51
51
|
};
|
|
52
|
-
//#endregion
|
|
53
52
|
export { a as REPLACE_IN_PROGRESS_TABLE, s as STAGING_STALE_MINUTES, o as _voltroReplaceInProgressTable, u as interruptedReplaceRefusal, f as stagingLeftoverReport, d as stagingLeftovers, l as stagingNamesOf, c as stagingStaleAfterMs };
|
package/dist/requiredColumns.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/requiredColumns.ts
|
|
2
2
|
var e = (e, t) => {
|
|
3
3
|
let n = [], r = t;
|
|
4
4
|
for (let [t, i] of Object.entries(e.fields)) {
|
|
@@ -22,5 +22,4 @@ var e = (e, t) => {
|
|
|
22
22
|
}));
|
|
23
23
|
return a;
|
|
24
24
|
};
|
|
25
|
-
//#endregion
|
|
26
25
|
export { t as missingConflictColumns, e as missingRequiredColumns };
|
package/dist/residency.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveTenantNamespace as e } from "./namespace.js";
|
|
2
|
-
|
|
2
|
+
// src/residency.ts
|
|
3
3
|
var t = class extends Error {
|
|
4
4
|
_tag = "TenantResidencyUnresolved";
|
|
5
5
|
constructor(e) {
|
|
@@ -48,5 +48,4 @@ var t = class extends Error {
|
|
|
48
48
|
let { store: i, placement: a } = u(e, t, n);
|
|
49
49
|
return await r(i, a), a;
|
|
50
50
|
};
|
|
51
|
-
//#endregion
|
|
52
51
|
export { n as TenantRegionUnavailable, t as TenantResidencyUnresolved, u as bindResidentStore, o as clearResidencyConfig, a as getResidencyConfig, c as isRegionServable, d as provisionResidentTenant, l as residentPlacement, s as resolveTenantHome, i as setResidencyConfig };
|
package/dist/retention.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { and as e, isNull as t, lt as n, or as r } from "./predicate.js";
|
|
2
2
|
import { Effect as i, Metric as a } from "effect";
|
|
3
|
-
|
|
3
|
+
// src/retention.ts
|
|
4
4
|
var o = {
|
|
5
5
|
app: 3,
|
|
6
6
|
plugin: 2,
|
|
@@ -58,5 +58,4 @@ var o = {
|
|
|
58
58
|
let n = Number(e ?? String(t));
|
|
59
59
|
return (Number.isFinite(n) && n > 0 ? n : t) * 36e5;
|
|
60
60
|
};
|
|
61
|
-
//#endregion
|
|
62
61
|
export { f as clearRetentions, l as listRetentionConflicts, d as listRetentions, u as registerRetention, g as retentionTtlMsFromEnv, p as sweepRetention };
|
package/dist/rowDecoder.js
CHANGED
|
@@ -5,7 +5,7 @@ import { projectedColumn as i } from "./projectedColumn.js";
|
|
|
5
5
|
import { hasEncodedSqliteDecimalSource as a } from "./sqliteDecimalQueryPlan.js";
|
|
6
6
|
import { sqliteDecimalOutputs as o } from "./sqliteDecimalOutputs.js";
|
|
7
7
|
import { resolveSqliteDecimalSources as s } from "./sqliteDecimalCte.js";
|
|
8
|
-
|
|
8
|
+
// src/rowDecoder.ts
|
|
9
9
|
var c = (e) => e == null || typeof e == "boolean" ? e : typeof e == "number" ? e !== 0 : typeof e == "bigint" ? e !== 0n : typeof e == "string" ? e === "1" || e.toLowerCase() === "true" : e, l = (e) => {
|
|
10
10
|
if (e == null || typeof e != "string") return e;
|
|
11
11
|
let t = e.trim();
|
|
@@ -169,5 +169,4 @@ var c = (e) => e == null || typeof e == "boolean" ? e : typeof e == "number" ? e
|
|
|
169
169
|
}
|
|
170
170
|
return c ?? t;
|
|
171
171
|
};
|
|
172
|
-
//#endregion
|
|
173
172
|
export { m as decodeCell, w as decodeRowsForTable, g as decodeRowsFromSchema, _ as decodeSelectRows, E as encodeRowForSchema };
|
package/dist/rowKey.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// src/rowKey.ts
|
|
2
2
|
var e = (e) => typeof e == "string" || typeof e == "number" ? [["id", e]] : Object.entries(e).map(([e, t]) => [e, t]), t = (e) => {
|
|
3
3
|
if (typeof e == "string" || typeof e == "number") return String(e);
|
|
4
4
|
let t = Object.entries(e);
|
|
5
5
|
return t.length === 1 ? String(t[0][1]) : t.slice().sort(([e], [t]) => e < t ? -1 : +(e > t)).map(([e, t]) => `${e}=${String(t)}`).join("\0");
|
|
6
6
|
}, n = (e) => typeof e == "object";
|
|
7
|
-
//#endregion
|
|
8
7
|
export { n as isCompositeRowKey, e as rowKeyColumns, t as rowKeyIdentity };
|
package/dist/rowSchema.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { timestampMs as e } from "./wire.js";
|
|
2
2
|
import { Schema as t } from "effect";
|
|
3
|
-
|
|
3
|
+
// src/rowSchema.ts
|
|
4
4
|
var n = (n) => {
|
|
5
5
|
let r = (() => {
|
|
6
6
|
switch (n.type) {
|
|
@@ -27,5 +27,4 @@ var n = (n) => {
|
|
|
27
27
|
for (let [t, r] of Object.entries(e.fields)) i.has(t) || (a[t] = n(r));
|
|
28
28
|
return t.Struct(a);
|
|
29
29
|
};
|
|
30
|
-
//#endregion
|
|
31
30
|
export { n as columnSchema, r as rowSchema };
|
package/dist/scopeKey.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// src/scopeKey.ts
|
|
2
2
|
var e = 255, t = (e) => e == null ? "null" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? JSON.stringify(e) : Array.isArray(e) ? `[${e.map(t).join(",")}]` : typeof e == "object" ? `{${Object.entries(e).filter(([, e]) => e !== void 0).sort(([e], [t]) => e < t ? -1 : +(e > t)).map(([e, n]) => `${JSON.stringify(e)}:${t(n)}`).join(",")}}` : JSON.stringify(String(e)), n = (e) => {
|
|
3
3
|
if (e == null) return null;
|
|
4
4
|
let n = typeof e == "string" ? e : t(e);
|
|
5
5
|
return n.length > 255 ? n.slice(0, 255) : n;
|
|
6
6
|
};
|
|
7
|
-
//#endregion
|
|
8
7
|
export { e as SCOPE_KEY_MAX_LENGTH, n as scopeKeyOf };
|
package/dist/seed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/seed.ts
|
|
2
2
|
var e = (e, t) => ({
|
|
3
3
|
name: e,
|
|
4
4
|
body: t
|
|
@@ -29,5 +29,4 @@ var e = (e, t) => ({
|
|
|
29
29
|
let t = i;
|
|
30
30
|
t !== null && e.changedTables.length !== 0 && await t(e);
|
|
31
31
|
};
|
|
32
|
-
//#endregion
|
|
33
32
|
export { t as defineSeed, c as fireSchemaChangeSeeds, s as fireTenantCreateSeeds, n as isSeedDefinition, o as setSchemaChangeSeedHook, a as setTenantCreateSeedHook };
|
package/dist/snowflake.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/snowflake.ts
|
|
2
2
|
var e = 10n, t = 12n, n = (1n << e) - 1n, r = (1n << t) - 1n, i = t, a = 22n, o = () => {
|
|
3
3
|
let e = process.env.SNOWFLAKE_MACHINE_ID;
|
|
4
4
|
if (e === void 0 || e === "") return 0n;
|
|
@@ -22,5 +22,4 @@ var e = 10n, t = 12n, n = (1n << e) - 1n, r = (1n << t) - 1n, i = t, a = 22n, o
|
|
|
22
22
|
if (n < 0n) throw Error("Snowflake timestamp before configured epoch (2024-01-01). System clock is wrong.");
|
|
23
23
|
return (n << a | e.machineId << i | e.sequence).toString();
|
|
24
24
|
};
|
|
25
|
-
//#endregion
|
|
26
25
|
export { p as generateSnowflake, u as resetSnowflake };
|
package/dist/sqlCompiler.js
CHANGED
|
@@ -11,7 +11,7 @@ import { coercePredicateValue as u } from "./predicateCoercion.js";
|
|
|
11
11
|
import { mssqlDecimalDistinct as d } from "./mssqlDecimalDistinct.js";
|
|
12
12
|
import { compileSqliteDecimalSourcePredicate as f } from "./sqliteDecimalSource.js";
|
|
13
13
|
import { compileSqliteDecimalQuery as p } from "./sqliteDecimalQuery.js";
|
|
14
|
-
|
|
14
|
+
// src/sqlCompiler.ts
|
|
15
15
|
var m = (e) => e.replace(/[A-Z]/g, (e) => e.toLowerCase()), h = (e, t) => {
|
|
16
16
|
let { strings: n, values: r } = e, i = t.unsafe(n[0] ?? "");
|
|
17
17
|
for (let e = 0; e < r.length; e++) i = t`${i}${r[e]}${t.unsafe(n[e + 1] ?? "")}`;
|
|
@@ -356,5 +356,4 @@ var m = (e) => e.replace(/[A-Z]/g, (e) => e.toLowerCase()), h = (e, t) => {
|
|
|
356
356
|
}
|
|
357
357
|
return v(e, t, n, r);
|
|
358
358
|
}, R = (e, t, n = null, r) => v(e, t, n, r);
|
|
359
|
-
//#endregion
|
|
360
359
|
export { L as compilePredicate, h as compileRawFragment, P as compileRowProjection, I as compileSelect, R as compileStoragePredicate, g as escapeLike };
|
package/dist/sqlError.js
CHANGED
package/dist/sqlMutation.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/sqlMutation.ts
|
|
2
2
|
var e = class extends Error {
|
|
3
3
|
code;
|
|
4
4
|
constructor(e) {
|
|
@@ -51,5 +51,4 @@ var e = class extends Error {
|
|
|
51
51
|
let n = i(e, t);
|
|
52
52
|
return e.transactional(async (e) => await a(e, n));
|
|
53
53
|
};
|
|
54
|
-
//#endregion
|
|
55
54
|
export { e as SqlMutationError, s as executeSqlMutations, r as prepareSqlMutation, o as prepareSqlMutationGroup };
|
package/dist/sqlPoolCapacity.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/sqlPoolCapacity.ts
|
|
2
2
|
var e = /* @__PURE__ */ new WeakMap(), t = (t, n) => {
|
|
3
3
|
n !== void 0 && Number.isInteger(n) && n > 0 && e.set(t, n);
|
|
4
4
|
}, n = (t) => {
|
|
@@ -8,5 +8,4 @@ var e = /* @__PURE__ */ new WeakMap(), t = (t, n) => {
|
|
|
8
8
|
let r = t.config.maxConnections;
|
|
9
9
|
return typeof r == "number" && Number.isInteger(r) && r > 0 ? r : void 0;
|
|
10
10
|
};
|
|
11
|
-
//#endregion
|
|
12
11
|
export { t as registerSqlPoolCapacity, n as sqlPoolCapacity };
|
package/dist/sqliteDecimal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/sqliteDecimal.ts
|
|
2
2
|
var e = ({ precision: e, scale: t }) => {
|
|
3
3
|
if (!Number.isSafeInteger(e) || e <= 0 || !Number.isSafeInteger(t) || t < 0 || t > e) throw RangeError("Invalid fixed-point decimal precision or scale");
|
|
4
4
|
return 10n ** BigInt(e);
|
|
@@ -18,5 +18,4 @@ var e = ({ precision: e, scale: t }) => {
|
|
|
18
18
|
let a = (i < 0n ? -i : i).toString().padStart(n.scale + 1, "0"), o = n.scale === 0 ? a : a.slice(0, -n.scale) + "." + a.slice(-n.scale);
|
|
19
19
|
return (i < 0n ? "-" : "") + o;
|
|
20
20
|
};
|
|
21
|
-
//#endregion
|
|
22
21
|
export { n as decodeSqliteDecimal, t as encodeSqliteDecimal };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/sqliteDecimalAggregateSql.ts
|
|
2
2
|
var e = (e, t, n) => {
|
|
3
3
|
let r = n ? t : `SELECT * FROM (${t}) LIMIT -1 OFFSET 0`;
|
|
4
4
|
return `${e} AS${n ? " MATERIALIZED" : ""} (${r})`;
|
|
@@ -57,5 +57,4 @@ var e = (e, t, n) => {
|
|
|
57
57
|
}
|
|
58
58
|
return `${_.length ? `WITH ${_.join(",\n")} ` : ""}SELECT ${f}CASE WHEN count='0' THEN NULL WHEN ltrim(result,'0')='' THEN '0' ELSE sign||ltrim(result,'0') END AS units,count FROM ${y(`decimal_avg_round${T}`)}`;
|
|
59
59
|
};
|
|
60
|
-
//#endregion
|
|
61
60
|
export { n as compileSqliteDecimalAvg, t as compileSqliteDecimalSum };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { encodeSqliteDecimal as e } from "./sqliteDecimal.js";
|
|
2
|
-
|
|
2
|
+
// src/sqliteDecimalColumnSql.ts
|
|
3
3
|
var t = {
|
|
4
4
|
eq: "=",
|
|
5
5
|
neq: "<>",
|
|
@@ -104,5 +104,4 @@ var t = {
|
|
|
104
104
|
values: new Map(o.map(({ column: e, plan: t }) => [e.name, t.value]))
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
|
-
//#endregion
|
|
108
107
|
export { n as compileSqliteDecimalColumnComparison, r as compileSqliteDecimalColumnValue, a as compileSqliteDecimalDecodedRows };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { decodeSqliteDecimal as e, encodeSqliteDecimal as t } from "./sqliteDecimal.js";
|
|
2
|
-
|
|
2
|
+
// src/sqliteDecimalConversion.ts
|
|
3
3
|
var n = (n, r) => {
|
|
4
4
|
if (t("0", r), n.kind === "sortable-v1" && t("0", n.shape), n.value === null) return null;
|
|
5
5
|
if (n.kind === "sortable-v1") return t(e(n.value, n.shape), r);
|
|
@@ -11,5 +11,4 @@ var n = (n, r) => {
|
|
|
11
11
|
if (typeof n.value != "string") throw TypeError("Decimal text conversion requires an exact string source");
|
|
12
12
|
return t(n.value, r);
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { n as convertSqliteDecimalValue };
|
package/dist/sqliteDecimalCte.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { decimal as e, text as t } from "./columns.js";
|
|
2
2
|
import { sqliteDecimalOutputs as n } from "./sqliteDecimalOutputs.js";
|
|
3
3
|
import { compileSqliteDecimalEncodedSource as r } from "./sqliteDecimalEncodeSql.js";
|
|
4
|
-
|
|
4
|
+
// src/sqliteDecimalCte.ts
|
|
5
5
|
var i = (e) => e.replace(/[A-Z]/g, (e) => e.toLowerCase()), a = (e) => {
|
|
6
6
|
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
7
7
|
"and" in e ? e.and.forEach(n) : "or" in e ? e.or.forEach(n) : "not" in e ? n(e.not) : "subquery" in e && r(e.subquery);
|
|
@@ -150,5 +150,4 @@ var i = (e) => e.replace(/[A-Z]/g, (e) => e.toLowerCase()), a = (e) => {
|
|
|
150
150
|
}).compile(), g = p.length ? t`WITH ${t.join(", ", !1)([...s, t.unsafe(p.join(","), h)])} ${t.unsafe(m)}` : t`WITH ${t.join(", ", !1)(s)} SELECT * FROM (${t.unsafe(m, h)})`;
|
|
151
151
|
return t.unsafe(...g.compile());
|
|
152
152
|
};
|
|
153
|
-
//#endregion
|
|
154
153
|
export { c as compileSqliteDecimalCtes, s as resolveSqliteDecimalSources };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { encodeSqliteDecimal as e } from "./sqliteDecimal.js";
|
|
2
|
-
|
|
2
|
+
// src/sqliteDecimalEncodeSql.ts
|
|
3
3
|
var t = (t, n, r = [], i) => {
|
|
4
4
|
e("0", n);
|
|
5
5
|
let a = /* @__PURE__ */ new Set([
|
|
@@ -28,5 +28,4 @@ var t = (t, n, r = [], i) => {
|
|
|
28
28
|
let p = `typeof(value)<>'text' OR instr(value,char(0))<>0 OR unsigned GLOB '*[^0-9.]*' OR instr(fraction,'.')<>0 OR length(integer_part)+length(fraction)=0 OR length(magnitude)>${n.precision} OR substr(fraction,${n.scale + 1}) GLOB '*[1-9]*'`;
|
|
29
29
|
return `(${i ? "" : `WITH ${u.join(",")} `}SELECT ${r.map((e) => `"${e}",`).join("")}CASE WHEN value IS NULL THEN NULL WHEN ${p} THEN abs(-9223372036854775808) WHEN negative AND magnitude<>'0' THEN 'D0'||complement||CAST(10-CAST(substr(trimmed,-1) AS INTEGER) AS TEXT)||substr(padded,length(trimmed)+1) ELSE 'D1'||padded END AS value FROM ${d("complement")})`;
|
|
30
30
|
};
|
|
31
|
-
//#endregion
|
|
32
31
|
export { t as compileSqliteDecimalEncodedSource };
|
|
@@ -2,7 +2,7 @@ import { integer as e } from "./columns.js";
|
|
|
2
2
|
import { getTable as t } from "./tableRegistry.js";
|
|
3
3
|
import { isSqliteDecimalEncodedColumn as n } from "./sqliteDecimalStorage.js";
|
|
4
4
|
import { projectedColumn as r } from "./projectedColumn.js";
|
|
5
|
-
|
|
5
|
+
// src/sqliteDecimalOutputs.ts
|
|
6
6
|
var i = (a, o) => {
|
|
7
7
|
if (a.setOp) {
|
|
8
8
|
let e = a.setOp.queries.map((e) => i(e, o));
|
|
@@ -70,5 +70,4 @@ var i = (a, o) => {
|
|
|
70
70
|
};
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
|
-
//#endregion
|
|
74
73
|
export { i as sqliteDecimalOutputs };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { encodeSqliteDecimal as e } from "./sqliteDecimal.js";
|
|
2
2
|
import { sqliteDecimalResultKey as t } from "./sqliteDecimalResultSql.js";
|
|
3
|
-
|
|
3
|
+
// src/sqliteDecimalPredicate.ts
|
|
4
4
|
var n = (n, r, i) => {
|
|
5
5
|
if (e("0", r), n.path?.length) throw Error("Decimal JSON-path predicates are unsupported");
|
|
6
6
|
if (n.op === "isNull" || n.op === "isNotNull") return n;
|
|
@@ -62,5 +62,4 @@ var n = (n, r, i) => {
|
|
|
62
62
|
value: c(f)
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
-
//#endregion
|
|
66
65
|
export { n as lowerSqliteDecimalPredicate };
|
|
@@ -12,7 +12,7 @@ import { compileSqliteDecimalRowQuery as p } from "./sqliteDecimalRowQuery.js";
|
|
|
12
12
|
import { compileSqliteDecimalAvg as m, compileSqliteDecimalSum as ee } from "./sqliteDecimalAggregateSql.js";
|
|
13
13
|
import { compileSqliteDecimalWindowQuery as h } from "./sqliteDecimalWindowQuery.js";
|
|
14
14
|
import { compilePredicate as g } from "./sqlCompiler.js";
|
|
15
|
-
|
|
15
|
+
// src/sqliteDecimalQuery.ts
|
|
16
16
|
var _ = (a, o, v, y, b, x) => {
|
|
17
17
|
if (!o.onDialectOrElse({
|
|
18
18
|
sqlite: () => !0,
|
|
@@ -179,5 +179,4 @@ var _ = (a, o, v, y, b, x) => {
|
|
|
179
179
|
let i = a(e, n.resultScale), s = new Set((i.ctes ?? []).map((e) => e.name));
|
|
180
180
|
return _(i, t, n, (e) => s.has(e) ? e : o(r, e));
|
|
181
181
|
};
|
|
182
|
-
//#endregion
|
|
183
182
|
export { v as compileSqliteDecimalQuery };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getTable as e } from "./tableRegistry.js";
|
|
2
2
|
import { isSqliteDecimalEncodedColumn as t } from "./sqliteDecimalStorage.js";
|
|
3
|
-
|
|
3
|
+
// src/sqliteDecimalQueryPlan.ts
|
|
4
4
|
var n = (e) => e.replace(/[A-Z]/g, (e) => e.toLowerCase()), r = (e) => {
|
|
5
5
|
if (Object.getPrototypeOf(e) !== Object.prototype) return !1;
|
|
6
6
|
for (let t of Object.values(Object.getOwnPropertyDescriptors(e))) {
|
|
@@ -33,5 +33,4 @@ var n = (e) => e.replace(/[A-Z]/g, (e) => e.toLowerCase()), r = (e) => {
|
|
|
33
33
|
};
|
|
34
34
|
return l(i, /* @__PURE__ */ new Set());
|
|
35
35
|
};
|
|
36
|
-
//#endregion
|
|
37
36
|
export { i as hasEncodedSqliteDecimalSource };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/sqliteDecimalResultSql.ts
|
|
2
2
|
var e = (e, t) => {
|
|
3
3
|
if (!Number.isSafeInteger(e) || e < 1 || !Number.isSafeInteger(t) || t < 0 || t > e) throw RangeError("Invalid decimal result shape");
|
|
4
4
|
}, t = (t, n) => {
|
|
@@ -40,5 +40,4 @@ var e = (e, t) => {
|
|
|
40
40
|
};
|
|
41
41
|
return `(${s(t)} ${i} ${s(r)})`;
|
|
42
42
|
};
|
|
43
|
-
//#endregion
|
|
44
43
|
export { n as compileSqliteDecimalResult, r as compileSqliteDecimalResultComparison, t as sqliteDecimalResultKey };
|
|
@@ -3,7 +3,7 @@ import { isSqliteDecimalEncodedColumn as t } from "./sqliteDecimalStorage.js";
|
|
|
3
3
|
import { prepareProjectedColumn as n } from "./projectedColumn.js";
|
|
4
4
|
import { compileSqliteDecimalDecodedRows as r } from "./sqliteDecimalColumnSql.js";
|
|
5
5
|
import { compileSqliteDecimalSource as i } from "./sqliteDecimalSource.js";
|
|
6
|
-
|
|
6
|
+
// src/sqliteDecimalRowQuery.ts
|
|
7
7
|
var a = (a, o, s, c, l) => {
|
|
8
8
|
if (a.groupBy?.length || a.having) throw Error("Row queries cannot contain aggregate clauses");
|
|
9
9
|
let u = n(a), d = a.sourceTable?.tableName === a.table ? a.sourceTable : e(a.table), f = a.joinedProjection ?? (a.projection?.length ? a.projection : Object.keys(d?.fields ?? {})).map((e) => ({
|
|
@@ -59,5 +59,4 @@ var a = (a, o, s, c, l) => {
|
|
|
59
59
|
}))}` : o``, A = a.take === void 0 ? a.skip === void 0 ? o`` : o` LIMIT -1` : o` LIMIT ${a.take}`, j = a.skip === void 0 ? o`` : o` OFFSET ${a.skip}`, M = C.length ? `WITH ${C.join(",")} ` : "", N = o`SELECT ${a.distinct ? o`DISTINCT ` : o``}${o.join(", ", !1)(O)} FROM ${o(T)}${k}${A}${j}`.compile();
|
|
60
60
|
return o.unsafe(M + N[0], [...b, ...N[1]]);
|
|
61
61
|
};
|
|
62
|
-
//#endregion
|
|
63
62
|
export { a as compileSqliteDecimalRowQuery };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { sqliteDecimalOutputs as e } from "./sqliteDecimalOutputs.js";
|
|
2
|
-
|
|
2
|
+
// src/sqliteDecimalSetQuery.ts
|
|
3
3
|
var t = (t, n, r, i) => {
|
|
4
4
|
let a = (e) => [
|
|
5
5
|
e.table,
|
|
@@ -46,5 +46,4 @@ var t = (t, n, r, i) => {
|
|
|
46
46
|
}, u = l(t);
|
|
47
47
|
return n`WITH ${n.join(", ", !1)(s)} ${u}`;
|
|
48
48
|
};
|
|
49
|
-
//#endregion
|
|
50
49
|
export { t as compileSqliteDecimalSetQuery };
|
|
@@ -5,7 +5,7 @@ import { compileSqliteDecimalSubquery as i } from "./sqliteDecimalSubquery.js";
|
|
|
5
5
|
import { compileSqliteDecimalColumnComparison as a, compileSqliteDecimalColumnValue as o } from "./sqliteDecimalColumnSql.js";
|
|
6
6
|
import { lowerSqliteDecimalPredicate as s } from "./sqliteDecimalPredicate.js";
|
|
7
7
|
import { compileStoragePredicate as c } from "./sqlCompiler.js";
|
|
8
|
-
|
|
8
|
+
// src/sqliteDecimalSource.ts
|
|
9
9
|
var l = (l, u, d, f) => {
|
|
10
10
|
let p = (f) => {
|
|
11
11
|
if ("not" in f) return u`NOT (${p(f.not)})`;
|
|
@@ -59,5 +59,4 @@ var l = (l, u, d, f) => {
|
|
|
59
59
|
where: e.predicate === void 0 ? t`` : t` WHERE ${r(e.predicate)}`
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
-
//#endregion
|
|
63
62
|
export { u as compileSqliteDecimalSource, l as compileSqliteDecimalSourcePredicate };
|