@voltro/database 0.86.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 +5484 -0
- package/THIRD-PARTY-NOTICES.md +2 -226
- 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 +3 -3
- 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 +65 -43
- package/dist/frameworkTables.js +16 -4
- package/dist/ginIndex.js +1 -2
- package/dist/hybridSearch.js +1 -2
- package/dist/idGenerator.js +5 -6
- package/dist/identifierLimits.js +1 -2
- package/dist/index.d.ts +153 -22
- package/dist/index.js +78 -78
- 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 +52 -33
- package/dist/migration.js +1 -2
- package/dist/migrations/appliedAtValue.js +1 -2
- package/dist/migrations/applier.js +400 -386
- 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 +8 -0
- 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 +146 -133
- 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 +188 -187
- 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 +25 -16
- package/dist/migrations/postgresEnumCheck.js +5 -3
- 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 +12 -0
- 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 +28 -22
- package/dist/predicateCoercion.js +1 -2
- package/dist/projectedColumn.js +1 -2
- package/dist/queryBuilder.js +7 -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 +62 -13
- 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/sql.d.ts +2746 -3748
- package/dist/sql.js +15 -14
- package/dist/sqlCompiler.js +89 -73
- package/dist/sqlError.js +1 -2
- package/dist/sqlMutation.js +54 -0
- 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 +5 -3
- package/dist/transientContention.js +1 -2
- package/dist/typeId.js +50 -0
- package/dist/typedStore.js +2 -3
- 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 +22 -22
- package/package.json +3 -4
package/dist/index.js
CHANGED
|
@@ -2,81 +2,81 @@ import { ColumnBuilder as e, SELF_REFERENCE_TARGET as t, array as n, bigint as r
|
|
|
2
2
|
import { pluginRef as P, pluginRefSpecOf as F } from "./pluginRef.js";
|
|
3
3
|
import { columnRef as I, isColumnReference as L } from "./columnReference.js";
|
|
4
4
|
import { authoredError as R, authoredMessageOf as z, causeBranches as B, classifyConstraintViolation as V, describeCharsetRefusal as H, describeDriverError as U, describeRowBindings as W, extractDbCause as G, isForeignKeyViolation as K, isQueryTimeout as q, wireSafeCause as J } from "./dbCause.js";
|
|
5
|
-
import { compareDecimal as Y } from "./decimalComparison.js";
|
|
6
|
-
import { MATCHES_NO_ROWS as
|
|
7
|
-
import { resolveActorSnapshot as
|
|
8
|
-
import { allEnumRenames as
|
|
9
|
-
import { deserializeArraysOnRead as
|
|
10
|
-
import { BOUND_ENCRYPTED_PREFIX as
|
|
11
|
-
import { refuseWrite as
|
|
12
|
-
import { MAX_IDENTIFIER_LENGTH as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
export { lt as AUTO_FILLED_COLUMNS, Me as BOUND_ENCRYPTED_PREFIX, oo as BULK_INSERT_LIMITS, Ei as BranchNameInvalid, Di as BranchTransitionInvalid, Mo as CDC_OFFSETS_TABLE, hr as CHANGE_CLAIM_TTL_ENV, yo as CHANGE_LISTENER_CEILING, e as ColumnBuilder, Fo as DATA_TRANSFERS_TABLE, pt as DEFAULT_ACQUIRE_TIMEOUT_MS, gr as DEFAULT_CHANGE_CLAIM_TTL_HOURS, Gr as DEFAULT_EAGER_FALLBACK_WARN_INTERVAL_MS, Ca as DEFAULT_SOFT_DROP_RETENTION_DAYS, wn as DEFAULT_SUBJECT_GRAPH_DEPTH, Ne as ENCRYPTED_PREFIX, Vo as ENGINE, zn as EagerCardinalityError, da as FILE_MIGRATION_PATTERN, wa as FRAMEWORK_LIVE_TABLES, Pe as FieldDecryptionError, Pr as ID_COLUMN_MAX_LENGTH, $t as INITIAL_VERSION, fa as IrreversibleMigrationError, X as MATCHES_NO_ROWS, Je as MAX_IDENTIFIER_LENGTH, pa as MIGRATION_PHASES, li as MSSQL_TRANSIENT_NUMBERS, ui as MYSQL_TRANSIENT_CODES, ma as MigrationExpectationFailed, ha as MigrationNeedsSqlClient, ga as MigrationSkipped, _r as OccurrenceCounter, di as POSTGRES_TRANSIENT_STATES, Xa as REPLACE_IN_PROGRESS_TABLE, _a as RewriteUnstableError, Ro as SCOPE_KEY_MAX_LENGTH, t as SELF_REFERENCE_TARGET, $r as SHARED_TRANSACTION_SERVICE, fi as SQLITE_TRANSIENT_CODES, Za as STAGING_STALE_MINUTES, Ta as STAGING_TABLE_PREFIX, Bo as SqlClient, Ga as TENANT_SELECTIONS_TABLE, pi as TURSO_TRANSIENT_MESSAGE, xi as TableStreamError, Wn as TenantNamespaceInvalid, Gn as TenantNamespaceUnresolved, Wi as TenantRegionUnavailable, Gi as TenantResidencyUnresolved, ei as TransactionAbortedError, va as TransactionBrokenByBodyError, hi as VOLTRO_EXPIRES_MIXIN_ID, _i as VOLTRO_LOCAL_FIRST_MIXIN_ID, en as VersionConflict, Ye as WARN_IDENTIFIER_LENGTH, Na as _voltroApiKeysTable, No as _voltroCdcOffsetsTable, Io as _voltroDataTransfersTable, Pa as _voltroDevicesTable, Fa as _voltroIdempotencyTable, Ia as _voltroKvTable, La as _voltroMigrationPlansTable, Ra as _voltroMigrationsTable, Po as _voltroMssqlCdcOffsetsTable, za as _voltroPluginMigrationsTable, Qa as _voltroReplaceInProgressTable, Ba as _voltroReplicaObservationsTable, Va as _voltroSchemaOwnerTable, Ha as _voltroSeedsTable, Ua as _voltroTenantSelectionsTable, sr as actorsTable, Bi as admitBranch, Ea as agedSoftDropSnapshots, Ee as allEnumRenames, _n as allRegisteredRelations, _t as allRegisteredTables, Z as and, In as applyJsonPatch, n as array, Q as arrayContains, $ as arrayHas, ee as arrayOverlaps, Bn as attachEagerLoads, Sr as attributionFields, Er as attributionKey, ea as auditAllTableIndexes, ta as auditTableIndexes, R as authoredError, z as authoredMessageOf, Tt as avg, Et as avgOver, Dr as beginLocalWrite, r as bigint, Ki as bindResidentStore, i as boolean, Oi as branchNamespaceName, so as bulkInsertLimitsFor, a as bytes, B as causeBranches, cr as changeDelete, vr as changeDigest, lr as changeInsert, ur as changeSoftDelete, dr as changeUpdate, co as chunkRowsForInsert, Or as claimPendingAttribution, V as classifyConstraintViolation, De as clearEnumRenames, kr as clearPendingAttribution, vn as clearRelationsRegistry, qi as clearResidencyConfig, Eo as clearRetentions, vt as clearTableRegistry, Lr as clearWriteRecorders, nr as coercePredicateForSqlite, Yn as coercePredicateValue, Xn as coercePredicateValues, Un as coerceValueForSqlite, te as collectSubqueries, Dt as column, I as columnRef, sn as columnSchema, lo as columnsPerRow, pr as committedChangeBatchOf, Y as compareDecimal, rr as compileEagerJson, Ln as compileJsonPatch, Zn as compilePredicate, Qn as compileRawFragment, $n as compileRowProjection, er as compileSelect, yr as composeChangeKey, wi as computeEmbedding, Co as connectionIdentity, ne as contains, Ot as count, kt as countDistinct, o as crdtCounter, s as crdtDoc, c as crdtManagedColumns, l as crdtManagedColumnsOf, u as crdtSealed, d as crdtText, Cr as currentWriteAttribution, At as databaseHandle, f as date, p as dbEnum, Kr as dbMetricTagCacheSizeForTests, qr as dbOperationsInFlight, m as decimal, Oe as declareEnumRename, Fe as decodeFieldValue, Dn as decodeRowsForTable, On as decodeRowsFromSchema, Ie as decryptFieldsOnRead, la as defineMigration, ot as defineMixin, ra as defineSeed, Ka as deleteTenantSelection, jt as denseRank, Tn as deriveSubjectGraph, rt as deriveTypeIdPrefix, Fr as derivedRowId, Ir as derivedRowIdLength, Da as describeAgedSoftDropSnapshots, H as describeCharsetRefusal, U as describeDriverError, W as describeRowBindings, Lo as describeTransferRun, Ae as deserializeArraysOnRead, Xe as drainIdentifierWarnings, h as dropped, mr as emitCommittedChanges, Le as encodeFieldValue, kn as encodeRowForSchema, Re as encryptFieldsForWrite, ze as encryptFieldsForWriteBatch, Be as encryptedColumnsOf, Ar as endLocalWrite, ki as enforceBranchLimits, yt as ensureTableRegistered, re as eq, tr as escapeLike, ie as evaluatePredicate, Mt as except, ae as exists, gi as expires, fr as externalChangeEvent, G as extractDbCause, Ve as fieldBinding, ia as fireSchemaChangeSeeds, aa as fireTenantCreateSeeds, na as formatIndexAuditIssue, En as formatSubjectGraph, Wa as frameworkTables, it as generateId, tt as generateSnowflake, g as geography, _ as geometry, ke as getEnumRenames, yn as getRelation, bn as getRelations, Ji as getResidencyConfig, bt as getTable, oe as gt, se as gte, Vn as hasEagerLoads, Ci as hybridSearch, v as id, ce as inSet, le as inSubquery, ln as inferForeignKey, po as insertIgnoreRowOutcome, mo as insertManyRows, ho as insertRow, y as integer, $a as interruptedReplaceRefusal, Nt as intersect, b as interval, ya as irreversible, ba as irreversibleReason, He as isBoundCiphertext, Ai as isBranchNamespace, L as isColumnReference, Mn as isCompositeRowKey, un as isEmptyRelationsSpec, Ue as isEncrypted, We as isFieldDecryptionError, xa as isFileMigration, K as isForeignKeyViolation, Oa as isFrameworkOwnedLiveTable, vi as isLocalFirst, ua as isMigrationDefinition, mt as isMysqlFamily, ji as isNeonConnection, ue as isNotNull, de as isNull, xo as isPrimaryKeyConflictError, q as isQueryTimeout, Ge as isRawEncoding, Yi as isRegionServable, dn as isRelationsSpec, oa as isSeedDefinition, ka as isSoftDropSnapshotName, ht as isSqliteFamily, Aa as isStagingTableName, xt as isTableReactive, ti as isTransactionAbortedError, mi as isTransientContention, Yt as isView, x as json, fe as jsonField, ut as jsonIndex, Fn as jsonPatchAssignments, Pt as lag, Ft as lead, Do as listRetentionConflicts, Oo as listRetentions, yi as localFirst, bi as localFirstTables, pe as lt, me as lte, Jr as makeEagerFallbackReporter, Vi as makeNamespaceBranchExecutor, ni as makeTransactionAbortTracker, fn as many, pn as manyToMany, S as materializeFields, It as max, Sa as migration, Lt as min, uo as missingConflictColumns, fo as missingRequiredColumns, st as mixin, he as neq, Mi as nextBranchState, wo as normaliseTarget, Rn as normalizeJsonPatchValue, ge as not, _e as notExists, ve as notInSet, ye as notInSubquery, C as numeric, Yr as observeDbOp, br as occurrenceWindowMs, ri as onTransaction, mn as one, Hn as oneCardinalityMessage, be as or, Rt as orderClausesOf, zt as paginateBy, Bt as paginateById, xr as parseChangeKey, jr as pendingAttributionCount, w as persistedColumns, Ni as planBranch, Pi as planBranchProvision, Fi as planBranchTeardown, Ii as planBranchTeardownFor, Li as planNeonBranchProvision, Ri as planNeonBranchTeardown, tn as planVersionedUpdate, P as pluginRef, F as pluginRefSpecOf, xe as preparePredicate, So as primaryKeyConflictError, Hi as provisionBranch, Xi as provisionResidentTenant, Kn as qualifyTable, Vt as queryFor, Xt as queryForView, gt as quoteIdent, bo as raiseChangeListenerCeiling, Ht as rank, T as raw, qa as readTenantSelection, E as readableByColumns, D as real, Xr as recordDbOp, Rr as recordsTable, O as reference, Ke as refuseWrite, ir as registerCoreTables, xn as registerDiscoveredRelations, Mr as registerPendingAttribution, Sn as registerRelations, ko as registerRetention, St as registerTable, zr as registerWriteRecorder, hn as relations, ar as requireActors, Ct as requireTable, or as requireTenants, Zr as resetDbMetricTagCacheForTests, nt as resetSnowflake, Zi as residentPlacement, Te as resolveActorSnapshot, zi as resolveBranchMechanism, Qr as resolveEagerFallbackWarnIntervalMs, Nr as resolveEchoAttribution, Ut as resolveFullTextIndex, at as resolveIdScheme, ct as resolveMixinGraph, Qi as resolveTenantHome, qn as resolveTenantNamespace, Ao as retentionTtlMsFromEnv, Nn as rowKeyColumns, Pn as rowKeyIdentity, Wt as rowNumber, cn as rowSchema, ii as runRetryingTransaction, ai as runSavepoint, oi as runStoreTransaction, wr as runWithWriteAttribution, Br as runWriteRecorders, To as sameDatabase, Jn as sanitizeIdentifierFragment, zo as scopeKeyOf, k as selfReference, je as serializeArraysForWrite, A as serverOnlyColumns, $i as setResidencyConfig, sa as setSchemaChangeSeedHook, ca as setTenantCreateSeedHook, si as settleTransactionExit, nn as settleVersionedUpdate, ja as softDropSnapshotStamp, Se as spatialPredicate, Ma as sqlError, eo as stagingLeftoverReport, to as stagingLeftovers, no as stagingNamesOf, ro as stagingStaleAfterMs, io as stampGeneratedId, ao as stampGeneratedIds, Ce as startsWith, qe as storeRefusalOf, Si as streamTable, Gt as sum, Kt as sumOver, Vr as suspendWriteRecorders, Hr as suspendWriteRecordersEffect, jo as sweepRetention, dt as table, Ui as teardownBranch, Ja as tenantSelectionId, j as text, M as timestamp, an as timestampMs, on as timestampMsOrNull, ci as transactionRetrySchedule, qt as union, Jt as unionAll, wt as unregisterTable, Ur as unregisterWriteRecorder, go as updateManyRow, _o as upsertRow, vo as upsertRowOutcome, An as upsertUpdatePatch, jn as upsertUpdateValues, Ze as validateColumnName, Qe as validateIndexName, Cn as validateRegisteredRelations, gn as validateRelationConfig, $e as validateTableName, et as validateTypeIdPrefix, N as vector, ft as vectorDistanceToOpclass, Ti as vectorEmbedding, rn as versionColumnOf, Zt as view, Qt as viewSql, we as walkLeaves, J as wireSafeCause, Tr as withCapturedAttribution, Wr as writeRecordersSuspended, Ya as writeTenantSelection };
|
|
5
|
+
import { compareDecimal as Y, decimalEqualityKey as X } from "./decimalComparison.js";
|
|
6
|
+
import { MATCHES_NO_ROWS as Z, and as Q, arrayContains as $, arrayHas as ee, arrayOverlaps as te, collectSubqueries as ne, contains as re, eq as ie, evaluatePredicate as ae, exists as oe, gt as se, gte as ce, inSet as le, inSubquery as ue, isNotNull as de, isNull as fe, jsonField as pe, lt as me, lte as he, neq as ge, not as _e, notExists as ve, notInSet as ye, notInSubquery as be, or as xe, preparePredicate as Se, spatialPredicate as Ce, startsWith as we, walkLeaves as Te } from "./predicate.js";
|
|
7
|
+
import { resolveActorSnapshot as Ee } from "./actorSnapshot.js";
|
|
8
|
+
import { allEnumRenames as De, clearEnumRenames as Oe, declareEnumRename as ke, getEnumRenames as Ae } from "./enumRenames.js";
|
|
9
|
+
import { deserializeArraysOnRead as je, serializeArraysForWrite as Me } from "./arrayCodec.js";
|
|
10
|
+
import { BOUND_ENCRYPTED_PREFIX as Ne, ENCRYPTED_PREFIX as Pe, FIELD_KEY_ID_PATTERN as Fe, FieldDecryptionError as Ie, ciphertextKeyId as Le, decodeFieldValue as Re, decryptFieldsOnRead as ze, encodeFieldValue as Be, encryptFieldsForWrite as Ve, encryptFieldsForWriteBatch as He, encryptedColumnsOf as Ue, fieldBinding as We, fieldBindingsOf as Ge, isBoundCiphertext as Ke, isEncrypted as qe, isFieldDecryptionError as Je, isRawEncoding as Ye, refuseIdChangeOfSealedRow as Xe } from "./fieldEncryption.js";
|
|
11
|
+
import { refuseWrite as Ze, storeRefusalOf as Qe } from "./storeRefusal.js";
|
|
12
|
+
import { MAX_IDENTIFIER_LENGTH as $e, WARN_IDENTIFIER_LENGTH as et, drainIdentifierWarnings as tt, validateColumnName as nt, validateIndexName as rt, validateTableName as it, validateTypeIdPrefix as at } from "./identifierLimits.js";
|
|
13
|
+
import { encodeTypeIdSuffix as ot, typeId as st, uuidV7Bytes as ct } from "./typeId.js";
|
|
14
|
+
import { generateSnowflake as lt, resetSnowflake as ut } from "./snowflake.js";
|
|
15
|
+
import { deriveTypeIdPrefix as dt, generateId as ft, resolveIdScheme as pt } from "./idGenerator.js";
|
|
16
|
+
import { defineMixin as mt, mixin as ht, resolveMixinGraph as gt } from "./mixins.js";
|
|
17
|
+
import { AUTO_FILLED_COLUMNS as _t, jsonIndex as vt, table as yt, vectorDistanceToOpclass as bt } from "./table.js";
|
|
18
|
+
import { DEFAULT_ACQUIRE_TIMEOUT_MS as xt, isMysqlFamily as St, isSqliteFamily as Ct, quoteIdent as wt } from "./dialect.js";
|
|
19
|
+
import { allRegisteredTables as Tt, clearTableRegistry as Et, ensureTableRegistered as Dt, getTable as Ot, isTableReactive as kt, registerTable as At, requireTable as jt, unregisterTable as Mt } from "./tableRegistry.js";
|
|
20
|
+
import { avg as Nt, avgOver as Pt, column as Ft, count as It, countDistinct as Lt, databaseHandle as Rt, denseRank as zt, except as Bt, intersect as Vt, lag as Ht, lead as Ut, max as Wt, min as Gt, orderClausesOf as Kt, paginateBy as qt, paginateById as Jt, queryFor as Yt, rank as Xt, resolveFullTextIndex as Zt, rowNumber as Qt, sum as $t, sumOver as en, union as tn, unionAll as nn } from "./queryBuilder.js";
|
|
21
|
+
import { isView as rn, queryForView as an, view as on, viewSql as sn } from "./view.js";
|
|
22
|
+
import { INITIAL_VERSION as cn, VersionConflict as ln, planVersionedUpdate as un, settleVersionedUpdate as dn, versionColumnOf as fn } from "./optimisticVersion.js";
|
|
23
|
+
import { timestampMs as pn, timestampMsOrNull as mn } from "./wire.js";
|
|
24
|
+
import { columnSchema as hn, rowSchema as gn } from "./rowSchema.js";
|
|
25
|
+
import { inferForeignKey as _n, isEmptyRelationsSpec as vn, isRelationsSpec as yn, many as bn, manyToMany as xn, one as Sn, relations as Cn, validateRelationConfig as wn } from "./relations.js";
|
|
26
|
+
import { allRegisteredRelations as Tn, clearRelationsRegistry as En, getRelation as Dn, getRelations as On, registerDiscoveredRelations as kn, registerRelations as An, validateRegisteredRelations as jn } from "./relationsRegistry.js";
|
|
27
|
+
import { DEFAULT_SUBJECT_GRAPH_DEPTH as Mn, deriveSubjectGraph as Nn, formatSubjectGraph as Pn } from "./subjectGraph.js";
|
|
28
|
+
import { decodeRowsForTable as Fn, decodeRowsFromSchema as In, decodeSelectRows as Ln, encodeRowForSchema as Rn } from "./rowDecoder.js";
|
|
29
|
+
import { upsertUpdatePatch as zn, upsertUpdateValues as Bn } from "./upsertUpdate.js";
|
|
30
|
+
import { isCompositeRowKey as Vn, rowKeyColumns as Hn, rowKeyIdentity as Un } from "./rowKey.js";
|
|
31
|
+
import { jsonPatchAssignments as Wn } from "./jsonPatchAssignments.js";
|
|
32
|
+
import { applyJsonPatch as Gn, compileJsonPatch as Kn, normalizeJsonPatchValue as qn } from "./jsonPatch.js";
|
|
33
|
+
import { EagerCardinalityError as Jn, attachEagerLoads as Yn, hasEagerLoads as Xn, oneCardinalityMessage as Zn } from "./joinCompiler.js";
|
|
34
|
+
import { coerceValueForSqlite as Qn } from "./sqliteValueCoercion.js";
|
|
35
|
+
import { TenantNamespaceInvalid as $n, TenantNamespaceUnresolved as er, qualifyTable as tr, resolveTenantNamespace as nr, sanitizeIdentifierFragment as rr } from "./namespace.js";
|
|
36
|
+
import { coercePredicateValue as ir, coercePredicateValues as ar } from "./predicateCoercion.js";
|
|
37
|
+
import { compilePredicate as or, compileRawFragment as sr, compileRowProjection as cr, compileSelect as lr, escapeLike as ur } from "./sqlCompiler.js";
|
|
38
|
+
import { coercePredicateForSqlite as dr, compileEagerJson as fr } from "./jsonEagerCompiler.js";
|
|
39
|
+
import { registerCoreTables as pr, requireActors as mr, requireTenants as hr } from "./coreTablesRegistry.js";
|
|
40
|
+
import { actorsTable as gr } from "./coreTables.js";
|
|
41
|
+
import { changeDelete as _r, changeInsert as vr, changeSoftDelete as yr, changeUpdate as br, externalChangeEvent as xr } from "./changeEvent.js";
|
|
42
|
+
import { committedChangeBatchOf as Sr, emitCommittedChanges as Cr } from "./committedChanges.js";
|
|
43
|
+
import { CHANGE_CLAIM_TTL_ENV as wr, DEFAULT_CHANGE_CLAIM_TTL_HOURS as Tr, OccurrenceCounter as Er, changeDigest as Dr, composeChangeKey as Or, occurrenceWindowMs as kr, parseChangeKey as Ar } from "./changeIdentity.js";
|
|
44
|
+
import { attributionFields as jr, currentWriteAttribution as Mr, runWithWriteAttribution as Nr, withCapturedAttribution as Pr } from "./writeAttribution.js";
|
|
45
|
+
import { attributionKey as Fr, beginLocalWrite as Ir, claimPendingAttribution as Lr, clearPendingAttribution as Rr, endLocalWrite as zr, pendingAttributionCount as Br, registerPendingAttribution as Vr, resolveEchoAttribution as Hr } from "./pendingAttribution.js";
|
|
46
|
+
import { ID_COLUMN_MAX_LENGTH as Ur, derivedRowId as Wr, derivedRowIdLength as Gr } from "./derivedRowId.js";
|
|
47
|
+
import { clearWriteRecorders as Kr, recordsTable as qr, registerWriteRecorder as Jr, runWriteRecorders as Yr, suspendWriteRecorders as Xr, suspendWriteRecordersEffect as Zr, unregisterWriteRecorder as Qr, writeImagesObserved as $r, writeRecordersSuspended as ei } from "./writeRecorder.js";
|
|
48
|
+
import { DEFAULT_EAGER_FALLBACK_WARN_INTERVAL_MS as ti, dbMetricTagCacheSizeForTests as ni, dbOperationsInFlight as ri, makeEagerFallbackReporter as ii, observeDbOp as ai, recordDbOp as oi, resetDbMetricTagCacheForTests as si, resolveEagerFallbackWarnIntervalMs as ci } from "./dbMetrics.js";
|
|
49
|
+
import { SHARED_TRANSACTION_SERVICE as li, TransactionAbortedError as ui, isTransactionAbortedError as di, makeTransactionAbortTracker as fi, onTransaction as pi, runRetryingTransaction as mi, runSavepoint as hi, runStoreTransaction as gi, settleTransactionExit as _i, transactionRetrySchedule as vi } from "./transactionOutcome.js";
|
|
50
|
+
import { MSSQL_TRANSIENT_NUMBERS as yi, MYSQL_TRANSIENT_CODES as bi, POSTGRES_TRANSIENT_STATES as xi, SQLITE_TRANSIENT_CODES as Si, TURSO_TRANSIENT_MESSAGE as Ci, isTransientContention as wi } from "./transientContention.js";
|
|
51
|
+
import { VOLTRO_EXPIRES_MIXIN_ID as Ti, expires as Ei } from "./expiresMixin.js";
|
|
52
|
+
import { VOLTRO_LOCAL_FIRST_MIXIN_ID as Di, isLocalFirst as Oi, localFirst as ki, localFirstTables as Ai } from "./localFirstMixin.js";
|
|
53
|
+
import { TableStreamError as ji, streamTable as Mi } from "./stream.js";
|
|
54
|
+
import { hybridSearch as Ni } from "./hybridSearch.js";
|
|
55
|
+
import { computeEmbedding as Pi, vectorEmbedding as Fi } from "./vectorEmbedding.js";
|
|
56
|
+
import { BranchNameInvalid as Ii, BranchTransitionInvalid as Li, branchNamespaceName as Ri, enforceBranchLimits as zi, isBranchNamespace as Bi, isNeonConnection as Vi, nextBranchState as Hi, planBranch as Ui, planBranchProvision as Wi, planBranchTeardown as Gi, planBranchTeardownFor as Ki, planNeonBranchProvision as qi, planNeonBranchTeardown as Ji, resolveBranchMechanism as Yi } from "./branching.js";
|
|
57
|
+
import { admitBranch as Xi, makeNamespaceBranchExecutor as Zi, provisionBranch as Qi, teardownBranch as $i } from "./branchExecute.js";
|
|
58
|
+
import { TenantRegionUnavailable as ea, TenantResidencyUnresolved as ta, bindResidentStore as na, clearResidencyConfig as ra, getResidencyConfig as ia, isRegionServable as aa, provisionResidentTenant as oa, residentPlacement as sa, resolveTenantHome as ca, setResidencyConfig as la } from "./residency.js";
|
|
59
|
+
import { auditAllTableIndexes as ua, auditTableIndexes as da, formatIndexAuditIssue as fa } from "./indexAudit.js";
|
|
60
|
+
import { defineSeed as pa, fireSchemaChangeSeeds as ma, fireTenantCreateSeeds as ha, isSeedDefinition as ga, setSchemaChangeSeedHook as _a, setTenantCreateSeedHook as va } from "./seed.js";
|
|
61
|
+
import { defineMigration as ya, isMigrationDefinition as ba } from "./migration.js";
|
|
62
|
+
import { FILE_MIGRATION_PATTERN as xa, IrreversibleMigrationError as Sa, MIGRATION_PHASES as Ca, MigrationExpectationFailed as wa, MigrationNeedsSqlClient as Ta, MigrationSkipped as Ea, RewriteUnstableError as Da, TransactionBrokenByBodyError as Oa, irreversible as ka, irreversibleReason as Aa, isFileMigration as ja, migration as Ma } from "./migrations/fileBased.js";
|
|
63
|
+
import { DEFAULT_SOFT_DROP_RETENTION_DAYS as Na, FRAMEWORK_LIVE_TABLES as Pa, STAGING_TABLE_PREFIX as Fa, agedSoftDropSnapshots as Ia, describeAgedSoftDropSnapshots as La, isFrameworkOwnedLiveTable as Ra, isSoftDropSnapshotName as za, isStagingTableName as Ba, softDropSnapshotStamp as Va } from "./migrations/frameworkLiveTables.js";
|
|
64
|
+
import { sqlError as Ha } from "./sqlError.js";
|
|
65
|
+
import { _voltroApiKeysTable as Ua, _voltroApiRoleWorkloadBucketsTable as Wa, _voltroDevicesTable as Ga, _voltroIdempotencyTable as Ka, _voltroKvTable as qa, _voltroMigrationPlansTable as Ja, _voltroMigrationsTable as Ya, _voltroPluginMigrationsTable as Xa, _voltroReplicaObservationsTable as Za, _voltroSchemaOwnerTable as Qa, _voltroSeedsTable as $a, _voltroTenantSelectionsTable as eo, frameworkTables as to } from "./frameworkTables.js";
|
|
66
|
+
import { TENANT_SELECTIONS_TABLE as no, deleteTenantSelection as ro, readTenantSelection as io, tenantSelectionId as ao, writeTenantSelection as oo } from "./tenantSelection.js";
|
|
67
|
+
import { REPLACE_IN_PROGRESS_TABLE as so, STAGING_STALE_MINUTES as co, _voltroReplaceInProgressTable as lo, interruptedReplaceRefusal as uo, stagingLeftoverReport as fo, stagingLeftovers as po, stagingNamesOf as mo, stagingStaleAfterMs as ho } from "./replaceInProgress.js";
|
|
68
|
+
import { stampGeneratedId as go, stampGeneratedIds as _o } from "./stampId.js";
|
|
69
|
+
import { BULK_INSERT_LIMITS as vo, bulkInsertLimitsFor as yo, chunkRowsForInsert as bo, columnsPerRow as xo } from "./bulkInsertLimits.js";
|
|
70
|
+
import { missingConflictColumns as So, missingRequiredColumns as Co } from "./requiredColumns.js";
|
|
71
|
+
import { insertIgnoreRowOutcome as wo, insertManyRows as To, insertRow as Eo, updateManyRow as Do, upsertRow as Oo, upsertRowOutcome as ko } from "./typedStore.js";
|
|
72
|
+
import { CHANGE_LISTENER_CEILING as Ao, raiseChangeListenerCeiling as jo } from "./changeListenerCeiling.js";
|
|
73
|
+
import { isPrimaryKeyConflictError as Mo, primaryKeyConflictError as No } from "./storeErrors.js";
|
|
74
|
+
import { connectionIdentity as Po, normaliseTarget as Fo, sameDatabase as Io } from "./connectionIdentity.js";
|
|
75
|
+
import { clearRetentions as Lo, listRetentionConflicts as Ro, listRetentions as zo, registerRetention as Bo, retentionTtlMsFromEnv as Vo, sweepRetention as Ho } from "./retention.js";
|
|
76
|
+
import { CDC_OFFSETS_TABLE as Uo, _voltroCdcOffsetsTable as Wo, _voltroMssqlCdcOffsetsTable as Go } from "./cdcOffsetsTables.js";
|
|
77
|
+
import { DATA_TRANSFERS_TABLE as Ko, _voltroDataTransfersTable as qo, describeTransferRun as Jo } from "./dataTransfers.js";
|
|
78
|
+
import { SCOPE_KEY_MAX_LENGTH as Yo, scopeKeyOf as Xo } from "./scopeKey.js";
|
|
79
|
+
import { SqlClient as Zo } from "effect/sql";
|
|
80
|
+
// src/index.ts
|
|
81
|
+
var Qo = "postgres";
|
|
82
|
+
export { _t as AUTO_FILLED_COLUMNS, Ne as BOUND_ENCRYPTED_PREFIX, vo as BULK_INSERT_LIMITS, Ii as BranchNameInvalid, Li as BranchTransitionInvalid, Uo as CDC_OFFSETS_TABLE, wr as CHANGE_CLAIM_TTL_ENV, Ao as CHANGE_LISTENER_CEILING, e as ColumnBuilder, Ko as DATA_TRANSFERS_TABLE, xt as DEFAULT_ACQUIRE_TIMEOUT_MS, Tr as DEFAULT_CHANGE_CLAIM_TTL_HOURS, ti as DEFAULT_EAGER_FALLBACK_WARN_INTERVAL_MS, Na as DEFAULT_SOFT_DROP_RETENTION_DAYS, Mn as DEFAULT_SUBJECT_GRAPH_DEPTH, Pe as ENCRYPTED_PREFIX, Qo as ENGINE, Jn as EagerCardinalityError, Fe as FIELD_KEY_ID_PATTERN, xa as FILE_MIGRATION_PATTERN, Pa as FRAMEWORK_LIVE_TABLES, Ie as FieldDecryptionError, Ur as ID_COLUMN_MAX_LENGTH, cn as INITIAL_VERSION, Sa as IrreversibleMigrationError, Z as MATCHES_NO_ROWS, $e as MAX_IDENTIFIER_LENGTH, Ca as MIGRATION_PHASES, yi as MSSQL_TRANSIENT_NUMBERS, bi as MYSQL_TRANSIENT_CODES, wa as MigrationExpectationFailed, Ta as MigrationNeedsSqlClient, Ea as MigrationSkipped, Er as OccurrenceCounter, xi as POSTGRES_TRANSIENT_STATES, so as REPLACE_IN_PROGRESS_TABLE, Da as RewriteUnstableError, Yo as SCOPE_KEY_MAX_LENGTH, t as SELF_REFERENCE_TARGET, li as SHARED_TRANSACTION_SERVICE, Si as SQLITE_TRANSIENT_CODES, co as STAGING_STALE_MINUTES, Fa as STAGING_TABLE_PREFIX, Zo as SqlClient, no as TENANT_SELECTIONS_TABLE, Ci as TURSO_TRANSIENT_MESSAGE, ji as TableStreamError, $n as TenantNamespaceInvalid, er as TenantNamespaceUnresolved, ea as TenantRegionUnavailable, ta as TenantResidencyUnresolved, ui as TransactionAbortedError, Oa as TransactionBrokenByBodyError, Ti as VOLTRO_EXPIRES_MIXIN_ID, Di as VOLTRO_LOCAL_FIRST_MIXIN_ID, ln as VersionConflict, et as WARN_IDENTIFIER_LENGTH, Ua as _voltroApiKeysTable, Wa as _voltroApiRoleWorkloadBucketsTable, Wo as _voltroCdcOffsetsTable, qo as _voltroDataTransfersTable, Ga as _voltroDevicesTable, Ka as _voltroIdempotencyTable, qa as _voltroKvTable, Ja as _voltroMigrationPlansTable, Ya as _voltroMigrationsTable, Go as _voltroMssqlCdcOffsetsTable, Xa as _voltroPluginMigrationsTable, lo as _voltroReplaceInProgressTable, Za as _voltroReplicaObservationsTable, Qa as _voltroSchemaOwnerTable, $a as _voltroSeedsTable, eo as _voltroTenantSelectionsTable, gr as actorsTable, Xi as admitBranch, Ia as agedSoftDropSnapshots, De as allEnumRenames, Tn as allRegisteredRelations, Tt as allRegisteredTables, Q as and, Gn as applyJsonPatch, n as array, $ as arrayContains, ee as arrayHas, te as arrayOverlaps, Yn as attachEagerLoads, jr as attributionFields, Fr as attributionKey, ua as auditAllTableIndexes, da as auditTableIndexes, R as authoredError, z as authoredMessageOf, Nt as avg, Pt as avgOver, Ir as beginLocalWrite, r as bigint, na as bindResidentStore, i as boolean, Ri as branchNamespaceName, yo as bulkInsertLimitsFor, a as bytes, B as causeBranches, _r as changeDelete, Dr as changeDigest, vr as changeInsert, yr as changeSoftDelete, br as changeUpdate, bo as chunkRowsForInsert, Le as ciphertextKeyId, Lr as claimPendingAttribution, V as classifyConstraintViolation, Oe as clearEnumRenames, Rr as clearPendingAttribution, En as clearRelationsRegistry, ra as clearResidencyConfig, Lo as clearRetentions, Et as clearTableRegistry, Kr as clearWriteRecorders, dr as coercePredicateForSqlite, ir as coercePredicateValue, ar as coercePredicateValues, Qn as coerceValueForSqlite, ne as collectSubqueries, Ft as column, I as columnRef, hn as columnSchema, xo as columnsPerRow, Sr as committedChangeBatchOf, Y as compareDecimal, fr as compileEagerJson, Kn as compileJsonPatch, or as compilePredicate, sr as compileRawFragment, cr as compileRowProjection, lr as compileSelect, Or as composeChangeKey, Pi as computeEmbedding, Po as connectionIdentity, re as contains, It as count, Lt as countDistinct, o as crdtCounter, s as crdtDoc, c as crdtManagedColumns, l as crdtManagedColumnsOf, u as crdtSealed, d as crdtText, Mr as currentWriteAttribution, Rt as databaseHandle, f as date, p as dbEnum, ni as dbMetricTagCacheSizeForTests, ri as dbOperationsInFlight, m as decimal, X as decimalEqualityKey, ke as declareEnumRename, Re as decodeFieldValue, Fn as decodeRowsForTable, In as decodeRowsFromSchema, Ln as decodeSelectRows, ze as decryptFieldsOnRead, ya as defineMigration, mt as defineMixin, pa as defineSeed, ro as deleteTenantSelection, zt as denseRank, Nn as deriveSubjectGraph, dt as deriveTypeIdPrefix, Wr as derivedRowId, Gr as derivedRowIdLength, La as describeAgedSoftDropSnapshots, H as describeCharsetRefusal, U as describeDriverError, W as describeRowBindings, Jo as describeTransferRun, je as deserializeArraysOnRead, tt as drainIdentifierWarnings, h as dropped, Cr as emitCommittedChanges, Be as encodeFieldValue, Rn as encodeRowForSchema, ot as encodeTypeIdSuffix, Ve as encryptFieldsForWrite, He as encryptFieldsForWriteBatch, Ue as encryptedColumnsOf, zr as endLocalWrite, zi as enforceBranchLimits, Dt as ensureTableRegistered, ie as eq, ur as escapeLike, ae as evaluatePredicate, Bt as except, oe as exists, Ei as expires, xr as externalChangeEvent, G as extractDbCause, We as fieldBinding, Ge as fieldBindingsOf, ma as fireSchemaChangeSeeds, ha as fireTenantCreateSeeds, fa as formatIndexAuditIssue, Pn as formatSubjectGraph, to as frameworkTables, ft as generateId, lt as generateSnowflake, g as geography, _ as geometry, Ae as getEnumRenames, Dn as getRelation, On as getRelations, ia as getResidencyConfig, Ot as getTable, se as gt, ce as gte, Xn as hasEagerLoads, Ni as hybridSearch, v as id, le as inSet, ue as inSubquery, _n as inferForeignKey, wo as insertIgnoreRowOutcome, To as insertManyRows, Eo as insertRow, y as integer, uo as interruptedReplaceRefusal, Vt as intersect, b as interval, ka as irreversible, Aa as irreversibleReason, Ke as isBoundCiphertext, Bi as isBranchNamespace, L as isColumnReference, Vn as isCompositeRowKey, vn as isEmptyRelationsSpec, qe as isEncrypted, Je as isFieldDecryptionError, ja as isFileMigration, K as isForeignKeyViolation, Ra as isFrameworkOwnedLiveTable, Oi as isLocalFirst, ba as isMigrationDefinition, St as isMysqlFamily, Vi as isNeonConnection, de as isNotNull, fe as isNull, Mo as isPrimaryKeyConflictError, q as isQueryTimeout, Ye as isRawEncoding, aa as isRegionServable, yn as isRelationsSpec, ga as isSeedDefinition, za as isSoftDropSnapshotName, Ct as isSqliteFamily, Ba as isStagingTableName, kt as isTableReactive, di as isTransactionAbortedError, wi as isTransientContention, rn as isView, x as json, pe as jsonField, vt as jsonIndex, Wn as jsonPatchAssignments, Ht as lag, Ut as lead, Ro as listRetentionConflicts, zo as listRetentions, ki as localFirst, Ai as localFirstTables, me as lt, he as lte, ii as makeEagerFallbackReporter, Zi as makeNamespaceBranchExecutor, fi as makeTransactionAbortTracker, bn as many, xn as manyToMany, S as materializeFields, Wt as max, Ma as migration, Gt as min, So as missingConflictColumns, Co as missingRequiredColumns, ht as mixin, ge as neq, Hi as nextBranchState, Fo as normaliseTarget, qn as normalizeJsonPatchValue, _e as not, ve as notExists, ye as notInSet, be as notInSubquery, C as numeric, ai as observeDbOp, kr as occurrenceWindowMs, pi as onTransaction, Sn as one, Zn as oneCardinalityMessage, xe as or, Kt as orderClausesOf, qt as paginateBy, Jt as paginateById, Ar as parseChangeKey, Br as pendingAttributionCount, w as persistedColumns, Ui as planBranch, Wi as planBranchProvision, Gi as planBranchTeardown, Ki as planBranchTeardownFor, qi as planNeonBranchProvision, Ji as planNeonBranchTeardown, un as planVersionedUpdate, P as pluginRef, F as pluginRefSpecOf, Se as preparePredicate, No as primaryKeyConflictError, Qi as provisionBranch, oa as provisionResidentTenant, tr as qualifyTable, Yt as queryFor, an as queryForView, wt as quoteIdent, jo as raiseChangeListenerCeiling, Xt as rank, T as raw, io as readTenantSelection, E as readableByColumns, D as real, oi as recordDbOp, qr as recordsTable, O as reference, Xe as refuseIdChangeOfSealedRow, Ze as refuseWrite, pr as registerCoreTables, kn as registerDiscoveredRelations, Vr as registerPendingAttribution, An as registerRelations, Bo as registerRetention, At as registerTable, Jr as registerWriteRecorder, Cn as relations, mr as requireActors, jt as requireTable, hr as requireTenants, si as resetDbMetricTagCacheForTests, ut as resetSnowflake, sa as residentPlacement, Ee as resolveActorSnapshot, Yi as resolveBranchMechanism, ci as resolveEagerFallbackWarnIntervalMs, Hr as resolveEchoAttribution, Zt as resolveFullTextIndex, pt as resolveIdScheme, gt as resolveMixinGraph, ca as resolveTenantHome, nr as resolveTenantNamespace, Vo as retentionTtlMsFromEnv, Hn as rowKeyColumns, Un as rowKeyIdentity, Qt as rowNumber, gn as rowSchema, mi as runRetryingTransaction, hi as runSavepoint, gi as runStoreTransaction, Nr as runWithWriteAttribution, Yr as runWriteRecorders, Io as sameDatabase, rr as sanitizeIdentifierFragment, Xo as scopeKeyOf, k as selfReference, Me as serializeArraysForWrite, A as serverOnlyColumns, la as setResidencyConfig, _a as setSchemaChangeSeedHook, va as setTenantCreateSeedHook, _i as settleTransactionExit, dn as settleVersionedUpdate, Va as softDropSnapshotStamp, Ce as spatialPredicate, Ha as sqlError, fo as stagingLeftoverReport, po as stagingLeftovers, mo as stagingNamesOf, ho as stagingStaleAfterMs, go as stampGeneratedId, _o as stampGeneratedIds, we as startsWith, Qe as storeRefusalOf, Mi as streamTable, $t as sum, en as sumOver, Xr as suspendWriteRecorders, Zr as suspendWriteRecordersEffect, Ho as sweepRetention, yt as table, $i as teardownBranch, ao as tenantSelectionId, j as text, M as timestamp, pn as timestampMs, mn as timestampMsOrNull, vi as transactionRetrySchedule, st as typeId, tn as union, nn as unionAll, Mt as unregisterTable, Qr as unregisterWriteRecorder, Do as updateManyRow, Oo as upsertRow, ko as upsertRowOutcome, zn as upsertUpdatePatch, Bn as upsertUpdateValues, ct as uuidV7Bytes, nt as validateColumnName, rt as validateIndexName, jn as validateRegisteredRelations, wn as validateRelationConfig, it as validateTableName, at as validateTypeIdPrefix, N as vector, bt as vectorDistanceToOpclass, Fi as vectorEmbedding, fn as versionColumnOf, on as view, sn as viewSql, Te as walkLeaves, J as wireSafeCause, Pr as withCapturedAttribution, $r as writeImagesObserved, ei as writeRecordersSuspended, oo as writeTenantSelection };
|
package/dist/indexAudit.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ansi as e } from "@voltro/logger";
|
|
2
|
-
|
|
2
|
+
// src/indexAudit.ts
|
|
3
3
|
var t = (e) => {
|
|
4
4
|
if (typeof e == "string") return e;
|
|
5
5
|
if ("jsonPath" in e) {
|
|
@@ -7,55 +7,56 @@ var t = (e) => {
|
|
|
7
7
|
return `(json:${t}->${n.join(".")}${r ? "::num" : ""})`;
|
|
8
8
|
}
|
|
9
9
|
return `(${e.expr})`;
|
|
10
|
-
}, n = (e) => e.map(t), r =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
10
|
+
}, n = (e) => e.map(t), r = {
|
|
11
|
+
btree: !0,
|
|
12
|
+
gist: !1,
|
|
13
|
+
gin: !1,
|
|
14
|
+
brin: !1,
|
|
15
|
+
hnsw: !1
|
|
16
|
+
}, i = (e) => typeof e == "string" ? JSON.stringify(["column", e]) : "jsonPath" in e ? JSON.stringify([
|
|
17
|
+
"json",
|
|
18
|
+
e.jsonPath.column,
|
|
19
|
+
e.jsonPath.path,
|
|
20
|
+
e.jsonPath.numeric ?? !1
|
|
21
|
+
]) : JSON.stringify(["expression", e.expr]), a = (e, t) => {
|
|
22
|
+
if (!r[e.kind ?? "btree"] || !r[t.kind ?? "btree"] || e.fields.length === 0 || e.fields.length > t.fields.length || !e.fields.every((e, n) => i(e) === i(t.fields[n]))) return;
|
|
23
|
+
let n = e.where?.trim() || void 0, a = t.where?.trim() || void 0;
|
|
24
|
+
if ((a === void 0 || a === n) && (!e.unique || t.unique && e.fields.length === t.fields.length)) return e.fields.length === t.fields.length ? "duplicate-fields" : "redundant-prefix";
|
|
25
|
+
}, o = (e) => {
|
|
26
|
+
let t = [], r = e.appliedIndexes, i = e.tableName;
|
|
27
|
+
for (let e = 0; e < r.length; e++) {
|
|
28
|
+
let o = r[e];
|
|
29
|
+
for (let s = e + 1; s < r.length; s++) {
|
|
30
|
+
let e = r[s], c = a(o, e), l = a(e, o);
|
|
31
|
+
if (!c && !l) continue;
|
|
32
|
+
let [u, d, f] = c && (!l || o.name < e.name) ? [
|
|
33
|
+
o,
|
|
34
|
+
e,
|
|
35
|
+
c
|
|
36
|
+
] : [
|
|
37
|
+
e,
|
|
38
|
+
o,
|
|
39
|
+
l
|
|
40
|
+
], p = f === "duplicate-fields" ? `has two indexes on the same fields [${n(u.fields).join(", ")}]: '${o.name}' and '${e.name}'.` : `index '${u.name}' on [${n(u.fields).join(", ")}] is a leading prefix of '${d.name}' on [${n(d.fields).join(", ")}].`;
|
|
41
|
+
t.push({
|
|
42
|
+
kind: f,
|
|
43
|
+
table: i,
|
|
44
|
+
redundant: u,
|
|
45
|
+
coveredBy: d,
|
|
46
|
+
message: `'${i}' ${p} '${d.name}' covers its B-tree lookups without losing row coverage or uniqueness. Drop '${u.name}' unless profiling justifies the smaller index for cache locality. Applies to supported B-tree dialects (Postgres / MySQL / MariaDB / MSSQL / SQLite).`
|
|
45
47
|
});
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
return t;
|
|
49
|
-
},
|
|
51
|
+
}, s = (e) => {
|
|
50
52
|
let t = [];
|
|
51
|
-
for (let n of e) t.push(...
|
|
53
|
+
for (let n of e) t.push(...o(n));
|
|
52
54
|
return t;
|
|
53
|
-
},
|
|
54
|
-
let i = r.color ?? !0, a = r.indent ?? " ", o = (t) =>
|
|
55
|
+
}, c = "\x1B[", l = `${c}38;2;245;158;11m`, u = `${c}38;2;16;185;129m`, d = (t, n) => `${t}${n}${e.reset}`, f = (e, t, n) => e ? typeof t == "function" ? t(n) : d(t, n) : n, p = (t, r = {}) => {
|
|
56
|
+
let i = r.color ?? !0, a = r.indent ?? " ", o = (t) => f(i, e.dim, t.padEnd(11)), s = (t) => f(i, (t) => e.bold(e.brand(t)), t), c = (t) => f(i, e.brightRed24, t), d = (e) => f(i, u, e), p = (e) => f(i, l, e), m = (t) => f(i, e.dim, t), h = `${p("index audit")} ${m("·")} ${f(i, e.bold, t.kind)}`, g = t.redundant.fields.length, _ = n(t.coveredBy.fields.slice(g)), v = (e, t) => {
|
|
55
57
|
let n = e.slice(0, t), r = e.slice(t), i = [];
|
|
56
|
-
return n.length > 0 && i.push(
|
|
58
|
+
return n.length > 0 && i.push(d(`[${n.join(", ")}]`)), r.length > 0 && i.push(p(`+ [${r.join(", ")}]`)), i.join(" ");
|
|
57
59
|
}, y = [];
|
|
58
|
-
return y.push(h), y.push(""), y.push(`${o("table")}${s(t.table)}`), y.push(""), y.push(`${o("redundant")}${
|
|
60
|
+
return y.push(h), y.push(""), y.push(`${o("table")}${s(t.table)}`), y.push(""), y.push(`${o("redundant")}${c(t.redundant.name)}`), y.push(`${o("")}${v(n(t.redundant.fields), g)}`), y.push(""), y.push(`${o("covered by")}${d(t.coveredBy.name)}`), y.push(`${o("")}${v(n(t.coveredBy.fields), g)}`), _.length > 0 && y.push(`${o("")}${m(`└ extra columns: ${_.join(", ")}`)}`), y.push(""), t.kind === "redundant-prefix" ? (y.push(`${o("why")}B-tree indexes serve queries that filter on a LEADING PREFIX of`), y.push(`${o("")}their column list. The wider index already covers every`), y.push(`${o("")}query the narrower one can serve.`), y.push(`${o("")}${m("Same rule on Postgres / MySQL / MariaDB / MSSQL / SQLite.")}`)) : (y.push(`${o("why")}Two indexes on the same columns under different names.`), y.push(`${o("")}The B-tree engine builds both — same coverage, double cost.`), y.push(`${o("")}${m("Same rule on Postgres / MySQL / MariaDB / MSSQL / SQLite.")}`)), t.redundant.where && y.push(`${o("filter")}${t.redundant.where}`), y.push(`${o("")}Row coverage and uniqueness are preserved by the kept index.`), y.push(""), y.push(`${o("cost")}Matching ${s("INSERT")} / ${s("UPDATE")} / ${s("DELETE")} on this table writes`), y.push(`${o("")}to ${f(i, e.bold, "both")} B-trees. Pure write overhead, zero read benefit.`), y.push(""), y.push(`${o("fix")}Drop ${c(t.redundant.name)}`), y.push(`${o("")}${m("Keep only if profiling shows the smaller index gives a")}`), y.push(`${o("")}${m("measurable cache-locality boost on a write-heavy hot path.")}`), y.push(`${o("")}${m("Silence with VOLTRO_INDEX_AUDIT=off if intentional.")}`), y.map((e) => `${a}${e}`).join("\n");
|
|
59
61
|
};
|
|
60
|
-
|
|
61
|
-
export { o as auditAllTableIndexes, a as auditTableIndexes, f as formatIndexAuditIssue };
|
|
62
|
+
export { s as auditAllTableIndexes, o as auditTableIndexes, p as formatIndexAuditIssue };
|
package/dist/indexStorage.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveGinOpclass as e } from "./ginIndex.js";
|
|
2
2
|
import { vectorDistanceToOpclass as t } from "./table.js";
|
|
3
|
-
|
|
3
|
+
// src/indexStorage.ts
|
|
4
4
|
var n = (e, n = "float32") => {
|
|
5
5
|
let r = e?.hnsw, i = r?.m ?? 16, a = r?.efConstruction ?? 64;
|
|
6
6
|
for (let [e, t] of Object.entries({
|
|
@@ -54,5 +54,4 @@ var n = (e, n = "float32") => {
|
|
|
54
54
|
skip: !1
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
|
-
//#endregion
|
|
58
57
|
export { r as indexKindForDialect, i as indexStorageShape, a as pgIndexClauses, n as resolveHnswOptions };
|
package/dist/joinCompiler.js
CHANGED
|
@@ -3,7 +3,7 @@ import { authoredError as t } from "./dbCause.js";
|
|
|
3
3
|
import { decimalEqualityKey as n } from "./decimalComparison.js";
|
|
4
4
|
import { inferForeignKey as r, validateRelationConfig as i } from "./relations.js";
|
|
5
5
|
import { getRelations as a } from "./relationsRegistry.js";
|
|
6
|
-
|
|
6
|
+
// src/joinCompiler.ts
|
|
7
7
|
var o = class extends Error {
|
|
8
8
|
_tag = "EagerCardinalityError";
|
|
9
9
|
constructor(e) {
|
|
@@ -156,5 +156,4 @@ var o = class extends Error {
|
|
|
156
156
|
for (let [e, n] of Object.entries(t)) e in r || (r[e] = n);
|
|
157
157
|
});
|
|
158
158
|
}, y = (e) => e.eager !== void 0 && Object.keys(e.eager).length > 0;
|
|
159
|
-
//#endregion
|
|
160
159
|
export { o as EagerCardinalityError, c as attachEagerLoads, y as hasEagerLoads, s as oneCardinalityMessage };
|
|
@@ -10,7 +10,7 @@ import { decodeCell as l } from "./rowDecoder.js";
|
|
|
10
10
|
import { EagerCardinalityError as u, oneCardinalityMessage as d } from "./joinCompiler.js";
|
|
11
11
|
import { coerceValueForSqlite as f } from "./sqliteValueCoercion.js";
|
|
12
12
|
import { compilePredicate as p } from "./sqlCompiler.js";
|
|
13
|
-
|
|
13
|
+
// src/jsonEagerCompiler.ts
|
|
14
14
|
var m = (e, t, n) => {
|
|
15
15
|
if (e.eager === void 0) return null;
|
|
16
16
|
let r = v(e.table, e.eager, e.sourceTable);
|
|
@@ -432,5 +432,4 @@ var m = (e, t, n) => {
|
|
|
432
432
|
value: f(t.value)
|
|
433
433
|
};
|
|
434
434
|
};
|
|
435
|
-
//#endregion
|
|
436
435
|
export { $ as coercePredicateForSqlite, f as coerceValueForSqlite, m as compileEagerJson };
|
package/dist/jsonPatch.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/jsonPatch.ts
|
|
2
2
|
var e = (e) => typeof e == "object" && !!e && !Array.isArray(e), t = (e) => JSON.parse(JSON.stringify(e ?? null)), n = (n, r, i) => {
|
|
3
3
|
let [a, ...o] = r.split("."), s = t(i), c = n[a], l = (t, n) => {
|
|
4
4
|
if (n === o.length) return s;
|
|
@@ -74,5 +74,4 @@ var e = (e) => typeof e == "object" && !!e && !Array.isArray(e), t = (e) => JSON
|
|
|
74
74
|
}
|
|
75
75
|
return n`${n(s)} = ${b}`;
|
|
76
76
|
};
|
|
77
|
-
//#endregion
|
|
78
77
|
export { n as applyJsonPatch, r as compileJsonPatch, t as normalizeJsonPatchValue };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { authoredError as e } from "./dbCause.js";
|
|
2
2
|
import { rowKeyColumns as t } from "./rowKey.js";
|
|
3
|
-
|
|
3
|
+
// src/jsonPatchAssignments.ts
|
|
4
4
|
var n = (n, r, i) => {
|
|
5
5
|
let a = new Set(t(n).map(([e]) => e)), o = r.split(".")[0];
|
|
6
6
|
return Object.fromEntries(Object.entries(i ?? {}).filter(([t, n]) => {
|
|
@@ -9,5 +9,4 @@ var n = (n, r, i) => {
|
|
|
9
9
|
return !0;
|
|
10
10
|
}));
|
|
11
11
|
};
|
|
12
|
-
//#endregion
|
|
13
12
|
export { n as jsonPatchAssignments };
|
package/dist/jsonPath.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { quoteIdent as e } from "./dialect.js";
|
|
2
|
-
|
|
2
|
+
// src/jsonPath.ts
|
|
3
3
|
var t = /^[A-Za-z_][A-Za-z0-9_]*$/, n = (e) => "$" + e.map((e) => typeof e == "number" ? `[${e}]` : t.test(e) ? `.${e}` : `."${e.replace(/"/g, "\\\"")}"`).join(""), r = (e) => "{" + e.map((e) => {
|
|
4
4
|
let t = String(e);
|
|
5
5
|
return /^[A-Za-z0-9_]+$/.test(t) ? t : `"${t.replace(/(["\\])/g, "\\$1")}"`;
|
|
@@ -27,5 +27,4 @@ var t = /^[A-Za-z_][A-Za-z0-9_]*$/, n = (e) => "$" + e.map((e) => typeof e == "n
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
//#endregion
|
|
31
30
|
export { i as jsonPathSql };
|
package/dist/localFirstMixin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineMixin as e } from "./mixins.js";
|
|
2
|
-
|
|
2
|
+
// src/localFirstMixin.ts
|
|
3
3
|
var t = "voltro/localFirst", n = () => e({
|
|
4
4
|
id: t,
|
|
5
5
|
fields: {}
|
|
@@ -8,5 +8,4 @@ var t = "voltro/localFirst", n = () => e({
|
|
|
8
8
|
for (let n of Object.values(e)) r(n) && t.push(n.tableName);
|
|
9
9
|
return t;
|
|
10
10
|
};
|
|
11
|
-
//#endregion
|
|
12
11
|
export { t as VOLTRO_LOCAL_FIRST_MIXIN_ID, r as isLocalFirst, n as localFirst, i as localFirstTables };
|