@dbsp/adapter-pgsql 6.0.0 → 7.0.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/dist/index.js CHANGED
@@ -47,24 +47,23 @@ import {
47
47
  PG_OPERATION_PACK_ARTIFACT,
48
48
  PG_RULE_PACK_ARTIFACT,
49
49
  PartialIndexPredicateNewEnumValueError,
50
+ PgAdapter,
51
+ PgAdvisoryLockOptionsError,
50
52
  PgConvergeRefusalError,
51
53
  PgDatabaseReadOnlyError,
52
54
  PgExecutionContractDerivationError,
53
55
  PgLedgerStorageUnsupportedError,
54
56
  PgPhysicalModelInputError,
55
57
  PgPhysicalNameCollisionError,
58
+ PgPinnedConnectionAbortSignalError,
59
+ PgPreparedStatementReplayError,
60
+ PgRawSqlTransactionControlError,
56
61
  PgResolvableRelationIdentityReadError,
57
- PgsqlAdapter,
58
- PgsqlAdvisoryLockOptionsError,
59
- PgsqlPinnedConnectionAbortSignalError,
60
- PgsqlPreparedStatementReplayError,
61
- PgsqlRawSqlTransactionControlError,
62
- PgsqlTransactionAbortSignalError,
63
- PgsqlTransactionAbortedCommitError,
64
- PgsqlTransactionAbortedError,
65
- PgsqlTransactionOptionsError,
66
- PgsqlTransactionTimeoutError,
67
- PlanCompiler,
62
+ PgTransactionAbortSignalError,
63
+ PgTransactionAbortedCommitError,
64
+ PgTransactionAbortedError,
65
+ PgTransactionOptionsError,
66
+ PgTransactionTimeoutError,
68
67
  RawIndexPredicateFallbackError,
69
68
  ReferencedKeyRemovalError,
70
69
  SET_NOT_NULL_RULE_ID,
@@ -100,12 +99,11 @@ import {
100
99
  classifyPgWrite,
101
100
  classifyRemovalEffectsClosure,
102
101
  collectAndValidateParamRefs,
103
- comparePgsqlDatabaseSchema,
102
+ comparePgDatabaseSchema,
104
103
  compareSchemata2 as compareSchemata,
105
104
  compileDelete,
106
105
  compileInsert,
107
106
  compileMutation,
108
- compilePlan,
109
107
  compileSetOperation,
110
108
  compileUpdate,
111
109
  compileUpsert,
@@ -122,15 +120,15 @@ import {
122
120
  createLogicalIdentityAdoptionRule,
123
121
  createManualSqlOperationRuntime,
124
122
  createParamRef,
123
+ createPgAdapter,
124
+ createPgCompileOnlyAdapter,
125
125
  createPgExecutionContract,
126
+ createPgGeneratedManagedStep,
126
127
  createPgObservationIssuer,
127
128
  createPgPhysicalModel,
128
129
  createPgTransitionLessor,
129
130
  createPgTransitionPack,
130
131
  createPgTransitionRunPersister,
131
- createPgsqlAdapter,
132
- createPgsqlCompileOnlyAdapter,
133
- createPgsqlGeneratedManagedStep,
134
132
  createPostLockAdmissionEvidence,
135
133
  createSetNotNullRule,
136
134
  createTypeCastParamRef,
@@ -138,7 +136,7 @@ import {
138
136
  decodeGeneratedPostcondition,
139
137
  decodeGeneratedPostconditionPayload,
140
138
  defaultFkDerivation,
141
- derivePostgresqlCapabilitiesForVersion,
139
+ derivePgCapabilitiesForVersion,
142
140
  ensureDbspMetaLedger,
143
141
  ensurePgLedger,
144
142
  ensurePgLedgerStorageVersion,
@@ -161,19 +159,9 @@ import {
161
159
  generatedPostconditionForChange,
162
160
  getNamingPluginForDbCasing,
163
161
  identityNaming,
164
- init_assert_field,
165
- init_ast_helpers,
166
- init_compiler,
167
- init_db_type,
168
- init_naming_plugin,
169
- init_param_ref,
170
- init_validate,
171
162
  introspect,
172
- isBatchValuesJoinDecision,
173
163
  isGeneratedMutationDestructive,
174
- isJoinDecision,
175
164
  isPgDatabaseReadOnlyError,
176
- isPrecompiledJoinDecision,
177
165
  isReservedKeyword,
178
166
  mapColumnType,
179
167
  mapOnDeleteAction,
@@ -246,13 +234,7 @@ import {
246
234
  withGeneratedPostconditionSession,
247
235
  withPgTransitionRunLock,
248
236
  withPgTransitionTransaction
249
- } from "./chunk-NXGMFZ4E.js";
250
-
251
- // src/index.ts
252
- init_assert_field();
253
- init_ast_helpers();
254
- init_compiler();
255
- init_db_type();
237
+ } from "./chunk-5BBN6TPD.js";
256
238
 
257
239
  // src/explain/explain.ts
258
240
  function buildExplain(query, options = {}) {
@@ -428,24 +410,6 @@ function vectorDims(column) {
428
410
  return fn3("vector_dims", exprRef2(column));
429
411
  }
430
412
 
431
- // src/naming.ts
432
- init_naming_plugin();
433
- function resolveLogicalName(model, dbName, casing) {
434
- const plugin = getNamingPluginForDbCasing(casing);
435
- const logicalName = plugin.toModel(dbName);
436
- if (model.getTable(logicalName)) {
437
- return logicalName;
438
- }
439
- if (logicalName !== dbName && model.getTable(dbName)) {
440
- return dbName;
441
- }
442
- return void 0;
443
- }
444
-
445
- // src/index.ts
446
- init_naming_plugin();
447
- init_param_ref();
448
-
449
413
  // src/redact-params.ts
450
414
  var DEFAULT_REDACTION_PATTERNS = Object.freeze([
451
415
  /^[^@\s]+@[^@\s]+\.[^@\s]+$/,
@@ -486,7 +450,7 @@ function matchesAnyPattern(value, patterns) {
486
450
  // src/transition/release.ts
487
451
  import { randomUUID } from "crypto";
488
452
  import { isDeepStrictEqual } from "util";
489
- import { projectLedgerChain } from "@dbsp/core";
453
+ import { projectLedgerChain } from "@dbsp/core/internal";
490
454
  import * as transitionTypes from "@dbsp/types";
491
455
  import { refusalFor } from "@dbsp/types";
492
456
  var sameControllerIdentity2 = transitionTypes.sameControllerIdentity ?? ((recorded, current) => recorded.name === current.name && recorded.oid === current.oid);
@@ -659,7 +623,6 @@ async function releasePgManagedAddress(input) {
659
623
  }
660
624
 
661
625
  // src/transition/public-api.ts
662
- init_validate();
663
626
  function convergePg(pool, physical, options = {}) {
664
627
  try {
665
628
  validateIdentifier(physical.schema, "schema");
@@ -688,7 +651,7 @@ import {
688
651
  projectLedgerChain as projectLedgerChain2,
689
652
  resourceScopeCovers,
690
653
  transitionPlanDigest
691
- } from "@dbsp/core";
654
+ } from "@dbsp/core/internal";
692
655
  import { sameLedgerAddress } from "@dbsp/types";
693
656
  var PgReconcileTransitionRunError = class extends Error {
694
657
  constructor(stage, originalCause) {
@@ -1127,9 +1090,6 @@ function executionIdsForRun(journal) {
1127
1090
  executionIds.add(`dbsp.generator.execution.${journal.run.runId}`);
1128
1091
  return [...executionIds];
1129
1092
  }
1130
-
1131
- // src/index.ts
1132
- init_validate();
1133
1093
  export {
1134
1094
  ADD_CHECK_RULE_ID,
1135
1095
  ALTER_AUTHORITY_OBSERVATION,
@@ -1180,24 +1140,23 @@ export {
1180
1140
  PG_OPERATION_PACK_ARTIFACT,
1181
1141
  PG_RULE_PACK_ARTIFACT,
1182
1142
  PartialIndexPredicateNewEnumValueError,
1143
+ PgAdapter,
1144
+ PgAdvisoryLockOptionsError,
1183
1145
  PgConvergeRefusalError,
1184
1146
  PgDatabaseReadOnlyError,
1185
1147
  PgExecutionContractDerivationError,
1186
1148
  PgLedgerStorageUnsupportedError,
1187
1149
  PgPhysicalModelInputError,
1188
1150
  PgPhysicalNameCollisionError,
1151
+ PgPinnedConnectionAbortSignalError,
1152
+ PgPreparedStatementReplayError,
1153
+ PgRawSqlTransactionControlError,
1189
1154
  PgReconcileTransitionRunError,
1190
- PgsqlAdapter,
1191
- PgsqlAdvisoryLockOptionsError,
1192
- PgsqlPinnedConnectionAbortSignalError,
1193
- PgsqlPreparedStatementReplayError,
1194
- PgsqlRawSqlTransactionControlError,
1195
- PgsqlTransactionAbortSignalError,
1196
- PgsqlTransactionAbortedCommitError,
1197
- PgsqlTransactionAbortedError,
1198
- PgsqlTransactionOptionsError,
1199
- PgsqlTransactionTimeoutError,
1200
- PlanCompiler,
1155
+ PgTransactionAbortSignalError,
1156
+ PgTransactionAbortedCommitError,
1157
+ PgTransactionAbortedError,
1158
+ PgTransactionOptionsError,
1159
+ PgTransactionTimeoutError,
1201
1160
  RawIndexPredicateFallbackError,
1202
1161
  ReferencedKeyRemovalError,
1203
1162
  SET_NOT_NULL_RULE_ID,
@@ -1239,12 +1198,11 @@ export {
1239
1198
  classifyPgWrite,
1240
1199
  classifyRemovalEffectsClosure,
1241
1200
  collectAndValidateParamRefs,
1242
- comparePgsqlDatabaseSchema,
1201
+ comparePgDatabaseSchema,
1243
1202
  compareSchemata,
1244
1203
  compileDelete,
1245
1204
  compileInsert,
1246
1205
  compileMutation,
1247
- compilePlan,
1248
1206
  compileSetOperation,
1249
1207
  compileUpdate,
1250
1208
  compileUpsert,
@@ -1262,22 +1220,22 @@ export {
1262
1220
  createLogicalIdentityAdoptionRule,
1263
1221
  createManualSqlOperationRuntime,
1264
1222
  createParamRef,
1223
+ createPgAdapter,
1224
+ createPgCompileOnlyAdapter,
1265
1225
  createPgExecutionContract,
1226
+ createPgGeneratedManagedStep,
1266
1227
  createPgObservationIssuer,
1267
1228
  createPgPhysicalModel,
1268
1229
  createPgTransitionLessor,
1269
1230
  createPgTransitionPack,
1270
1231
  createPgTransitionRunPersister,
1271
- createPgsqlAdapter,
1272
- createPgsqlCompileOnlyAdapter,
1273
- createPgsqlGeneratedManagedStep,
1274
1232
  createSetNotNullRule,
1275
1233
  createTypeCastParamRef,
1276
1234
  dbTypesEqual,
1277
1235
  decodeGeneratedPostcondition,
1278
1236
  decodeGeneratedPostconditionPayload,
1279
1237
  defaultFkDerivation,
1280
- derivePostgresqlCapabilitiesForVersion,
1238
+ derivePgCapabilitiesForVersion,
1281
1239
  ensureDbspMetaLedger,
1282
1240
  ensurePgLedger,
1283
1241
  ensurePgLedgerStorageVersion,
@@ -1305,11 +1263,8 @@ export {
1305
1263
  identityNaming,
1306
1264
  innerProduct,
1307
1265
  introspect,
1308
- isBatchValuesJoinDecision,
1309
1266
  isGeneratedMutationDestructive,
1310
- isJoinDecision,
1311
1267
  isPgDatabaseReadOnlyError,
1312
- isPrecompiledJoinDecision,
1313
1268
  isReservedKeyword,
1314
1269
  l2Distance,
1315
1270
  mapColumnType,
@@ -1368,7 +1323,6 @@ export {
1368
1323
  renderPgTableReaddressStatements,
1369
1324
  renderSetNotNullLockSql,
1370
1325
  reservationsForRemovalClosure,
1371
- resolveLogicalName,
1372
1326
  runPgReinitializePreflight,
1373
1327
  sanitizeForDisplay,
1374
1328
  score,