turbine-orm 0.93.1 → 0.94.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/README.md +49 -23
- package/dist/adapters/cockroachdb.d.ts +3 -3
- package/dist/adapters/cockroachdb.js +7 -11
- package/dist/adapters/index.d.ts +1 -1
- package/dist/adapters/yugabytedb.js +1 -1
- package/dist/better-sqlite3.d.ts +132 -0
- package/dist/better-sqlite3.js +303 -0
- package/dist/catalog-metadata.d.ts +250 -0
- package/dist/catalog-metadata.js +730 -0
- package/dist/cjs/adapters/cockroachdb.d.ts +3 -3
- package/dist/cjs/adapters/cockroachdb.js +7 -11
- package/dist/cjs/adapters/index.d.ts +1 -1
- package/dist/cjs/adapters/yugabytedb.js +1 -1
- package/dist/cjs/better-sqlite3.d.ts +132 -0
- package/dist/cjs/better-sqlite3.js +311 -0
- package/dist/cjs/catalog-metadata.d.ts +250 -0
- package/dist/cjs/catalog-metadata.js +747 -0
- package/dist/cjs/cli/compile-query.d.ts +6 -3
- package/dist/cjs/cli/compile-query.js +24 -3
- package/dist/cjs/cli/config.d.ts +35 -10
- package/dist/cjs/cli/config.js +173 -42
- package/dist/cjs/cli/d1-config.d.ts +14 -0
- package/dist/cjs/cli/d1-config.js +9 -0
- package/dist/cjs/cli/d1-local.d.ts +31 -0
- package/dist/cjs/cli/d1-local.js +298 -0
- package/dist/cjs/cli/d1-migrations.d.ts +16 -0
- package/dist/cjs/cli/d1-migrations.js +156 -0
- package/dist/cjs/cli/d1-project.d.ts +23 -0
- package/dist/cjs/cli/d1-project.js +314 -0
- package/dist/cjs/cli/d1-seed.d.ts +35 -0
- package/dist/cjs/cli/d1-seed.js +220 -0
- package/dist/cjs/cli/destructive.js +1 -2
- package/dist/cjs/cli/error-catalog.d.ts +3 -3
- package/dist/cjs/cli/error-catalog.js +21 -3
- package/dist/cjs/cli/index.d.ts +13 -8
- package/dist/cjs/cli/index.js +503 -71
- package/dist/cjs/cli/libsql-migrate-command.d.ts +5 -0
- package/dist/cjs/cli/libsql-migrate-command.js +82 -0
- package/dist/cjs/cli/libsql-migrate-status.d.ts +33 -0
- package/dist/cjs/cli/libsql-migrate-status.js +189 -0
- package/dist/cjs/cli/libsql-migrate.d.ts +14 -0
- package/dist/cjs/cli/libsql-migrate.js +522 -0
- package/dist/cjs/cli/libsql-project-config.d.ts +11 -0
- package/dist/cjs/cli/libsql-project-config.js +59 -0
- package/dist/cjs/cli/libsql-project.d.ts +52 -0
- package/dist/cjs/cli/libsql-project.js +409 -0
- package/dist/cjs/cli/libsql-seed-command.d.ts +29 -0
- package/dist/cjs/cli/libsql-seed-command.js +93 -0
- package/dist/cjs/cli/loader.d.ts +6 -5
- package/dist/cjs/cli/loader.js +53 -9
- package/dist/cjs/cli/mcp.d.ts +16 -1
- package/dist/cjs/cli/mcp.js +219 -125
- package/dist/cjs/cli/migrate.d.ts +2 -2
- package/dist/cjs/cli/migrate.js +29 -14
- package/dist/cjs/cli/mssql-doctor.d.ts +44 -0
- package/dist/cjs/cli/mssql-doctor.js +277 -0
- package/dist/cjs/cli/mssql-migrate-command.d.ts +9 -0
- package/dist/cjs/cli/mssql-migrate-command.js +230 -0
- package/dist/cjs/cli/mssql-migrate-connection.d.ts +51 -0
- package/dist/cjs/cli/mssql-migrate-connection.js +255 -0
- package/dist/cjs/cli/mssql-migrate-sql.d.ts +12 -0
- package/dist/cjs/cli/mssql-migrate-sql.js +282 -0
- package/dist/cjs/cli/mssql-migrate.d.ts +45 -0
- package/dist/cjs/cli/mssql-migrate.js +296 -0
- package/dist/cjs/cli/mssql-project.d.ts +34 -0
- package/dist/cjs/cli/mssql-project.js +171 -0
- package/dist/cjs/cli/mssql-seed.d.ts +7 -0
- package/dist/cjs/cli/mssql-seed.js +78 -0
- package/dist/cjs/cli/mssql-tools.d.ts +37 -0
- package/dist/cjs/cli/mssql-tools.js +354 -0
- package/dist/cjs/cli/mysql-doctor.d.ts +48 -0
- package/dist/cjs/cli/mysql-doctor.js +323 -0
- package/dist/cjs/cli/mysql-migrate-command.d.ts +7 -0
- package/dist/cjs/cli/mysql-migrate-command.js +290 -0
- package/dist/cjs/cli/mysql-migrate-sql.d.ts +18 -0
- package/dist/cjs/cli/mysql-migrate-sql.js +166 -0
- package/dist/cjs/cli/mysql-migrate.d.ts +77 -0
- package/dist/cjs/cli/mysql-migrate.js +619 -0
- package/dist/cjs/cli/mysql-project.d.ts +49 -0
- package/dist/cjs/cli/mysql-project.js +284 -0
- package/dist/cjs/cli/mysql-push-command.d.ts +7 -0
- package/dist/cjs/cli/mysql-push-command.js +94 -0
- package/dist/cjs/cli/mysql-push.d.ts +15 -0
- package/dist/cjs/cli/mysql-push.js +98 -0
- package/dist/cjs/cli/mysql-schema-command.d.ts +5 -0
- package/dist/cjs/cli/mysql-schema-command.js +58 -0
- package/dist/cjs/cli/mysql-schema-ddl.d.ts +37 -0
- package/dist/cjs/cli/mysql-schema-ddl.js +234 -0
- package/dist/cjs/cli/mysql-schema-snapshot.d.ts +21 -0
- package/dist/cjs/cli/mysql-schema-snapshot.js +127 -0
- package/dist/cjs/cli/mysql-schema.d.ts +27 -0
- package/dist/cjs/cli/mysql-schema.js +206 -0
- package/dist/cjs/cli/mysql-seed-loader.cjs +58 -0
- package/dist/cjs/cli/mysql-seed-loader.d.cts +3 -0
- package/dist/cjs/cli/mysql-seed.d.ts +6 -0
- package/dist/cjs/cli/mysql-seed.js +83 -0
- package/dist/cjs/cli/mysql-tools.d.ts +44 -0
- package/dist/cjs/cli/mysql-tools.js +336 -0
- package/dist/cjs/cli/no-follow.d.ts +29 -0
- package/dist/cjs/cli/no-follow.js +73 -0
- package/dist/cjs/cli/pii-predicate-guard.d.ts +1 -1
- package/dist/cjs/cli/pii-predicate-guard.js +2 -2
- package/dist/cjs/cli/pii-tags.d.ts +2 -2
- package/dist/cjs/cli/pii-tags.js +1 -1
- package/dist/cjs/cli/prisma-schema.js +2 -2
- package/dist/cjs/cli/sql-statements.d.ts +1 -1
- package/dist/cjs/cli/sql-statements.js +1 -1
- package/dist/cjs/cli/sqlite-doctor.d.ts +35 -0
- package/dist/cjs/cli/sqlite-doctor.js +400 -0
- package/dist/cjs/cli/sqlite-migrate-command.d.ts +4 -0
- package/dist/cjs/cli/sqlite-migrate-command.js +175 -0
- package/dist/cjs/cli/sqlite-migrate.d.ts +61 -0
- package/dist/cjs/cli/sqlite-migrate.js +692 -0
- package/dist/cjs/cli/sqlite-project.d.ts +42 -0
- package/dist/cjs/cli/sqlite-project.js +254 -0
- package/dist/cjs/cli/sqlite-schema-command.d.ts +4 -0
- package/dist/cjs/cli/sqlite-schema-command.js +82 -0
- package/dist/cjs/cli/sqlite-schema-ddl.d.ts +25 -0
- package/dist/cjs/cli/sqlite-schema-ddl.js +252 -0
- package/dist/cjs/cli/sqlite-schema.d.ts +25 -0
- package/dist/cjs/cli/sqlite-schema.js +334 -0
- package/dist/cjs/cli/sqlite-seed.d.ts +4 -0
- package/dist/cjs/cli/sqlite-seed.js +94 -0
- package/dist/cjs/cli/sqlite-tools.d.ts +24 -0
- package/dist/cjs/cli/sqlite-tools.js +169 -0
- package/dist/cjs/cli/studio.js +9 -9
- package/dist/cjs/cli/tool-capabilities.d.ts +72 -0
- package/dist/cjs/cli/tool-capabilities.js +120 -0
- package/dist/cjs/cli/tool-command.d.ts +11 -0
- package/dist/cjs/cli/tool-command.js +49 -0
- package/dist/cjs/cli/ui.d.ts +1 -1
- package/dist/cjs/cli/ui.js +1 -1
- package/dist/cjs/client.d.ts +20 -20
- package/dist/cjs/client.js +65 -344
- package/dist/cjs/connection-url.d.ts +1 -1
- package/dist/cjs/connection-url.js +1 -1
- package/dist/cjs/core.d.ts +58 -0
- package/dist/cjs/core.js +225 -0
- package/dist/cjs/d1/catalog-metadata.d.ts +5 -0
- package/dist/cjs/d1/catalog-metadata.js +230 -0
- package/dist/cjs/d1/catalog.d.ts +15 -0
- package/dist/cjs/d1/catalog.js +88 -0
- package/dist/cjs/d1/generate.d.ts +8 -0
- package/dist/cjs/d1/generate.js +163 -0
- package/dist/cjs/d1/introspect.d.ts +21 -0
- package/dist/cjs/d1/introspect.js +74 -0
- package/dist/cjs/d1/migrate.d.ts +29 -0
- package/dist/cjs/d1/migrate.js +222 -0
- package/dist/cjs/d1/migrations/sql.d.ts +2 -0
- package/dist/cjs/d1/migrations/sql.js +109 -0
- package/dist/cjs/d1/pool.d.ts +14 -0
- package/dist/cjs/d1/pool.js +90 -0
- package/dist/cjs/d1/sql.d.ts +5 -0
- package/dist/cjs/d1/sql.js +140 -0
- package/dist/cjs/d1/sqlite-dialect.d.ts +16 -0
- package/dist/cjs/d1/sqlite-dialect.js +579 -0
- package/dist/cjs/d1/types.d.ts +29 -0
- package/dist/cjs/d1/types.js +2 -0
- package/dist/cjs/d1.d.ts +53 -0
- package/dist/cjs/d1.js +220 -0
- package/dist/cjs/dialect.d.ts +33 -5
- package/dist/cjs/dialect.js +8 -6
- package/dist/cjs/errors.d.ts +38 -1
- package/dist/cjs/errors.js +72 -18
- package/dist/cjs/generate.d.ts +19 -3
- package/dist/cjs/generate.js +330 -97
- package/dist/cjs/global-filters-config.js +4 -4
- package/dist/cjs/index-advisor.js +6 -6
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/introspect.d.ts +59 -356
- package/dist/cjs/introspect.js +158 -984
- package/dist/cjs/libsql/bindings.d.ts +2 -0
- package/dist/cjs/libsql/bindings.js +78 -0
- package/dist/cjs/libsql/dialect.d.ts +3 -0
- package/dist/cjs/libsql/dialect.js +48 -0
- package/dist/cjs/libsql/generate.d.ts +4 -0
- package/dist/cjs/libsql/generate.js +56 -0
- package/dist/cjs/libsql/introspect.d.ts +16 -0
- package/dist/cjs/libsql/introspect.js +295 -0
- package/dist/cjs/libsql/pool.d.ts +42 -0
- package/dist/cjs/libsql/pool.js +275 -0
- package/dist/cjs/libsql/seed-cleanup.d.ts +2 -0
- package/dist/cjs/libsql/seed-cleanup.js +19 -0
- package/dist/cjs/libsql/values.d.ts +20 -0
- package/dist/cjs/libsql/values.js +75 -0
- package/dist/cjs/libsql-seed.d.ts +19 -0
- package/dist/cjs/libsql-seed.js +50 -0
- package/dist/cjs/libsql.d.ts +28 -0
- package/dist/cjs/libsql.js +88 -0
- package/dist/cjs/live-query.d.ts +33 -0
- package/dist/cjs/live-query.js +172 -0
- package/dist/cjs/log-codes.d.ts +1 -1
- package/dist/cjs/log-codes.js +4 -0
- package/dist/cjs/mssql-seed.d.ts +27 -0
- package/dist/cjs/mssql-seed.js +118 -0
- package/dist/cjs/mssql.d.ts +7 -7
- package/dist/cjs/mssql.js +365 -53
- package/dist/cjs/mysql-seed.d.ts +25 -0
- package/dist/cjs/mysql-seed.js +169 -0
- package/dist/cjs/mysql.d.ts +18 -6
- package/dist/cjs/mysql.js +602 -94
- package/dist/cjs/neon-http/client.d.ts +95 -0
- package/dist/cjs/neon-http/client.js +291 -0
- package/dist/cjs/neon-http/sql.d.ts +3 -0
- package/dist/cjs/neon-http/sql.js +116 -0
- package/dist/cjs/neon-http.d.ts +5 -0
- package/dist/cjs/neon-http.js +8 -0
- package/dist/cjs/neon-ws/load-driver.cjs +44 -0
- package/dist/cjs/neon-ws/load-driver.d.cts +9 -0
- package/dist/cjs/neon-ws/recovery.d.ts +14 -0
- package/dist/cjs/neon-ws/recovery.js +69 -0
- package/dist/cjs/neon-ws/snapshot.d.ts +3 -0
- package/dist/cjs/neon-ws/snapshot.js +17 -0
- package/dist/cjs/neon-ws/transport.d.ts +112 -0
- package/dist/cjs/neon-ws/transport.js +290 -0
- package/dist/cjs/neon-ws.d.ts +26 -0
- package/dist/cjs/neon-ws.js +189 -0
- package/dist/cjs/nested-write.d.ts +34 -3
- package/dist/cjs/nested-write.js +117 -24
- package/dist/cjs/notification-hub/consumer.d.ts +22 -0
- package/dist/cjs/notification-hub/consumer.js +111 -0
- package/dist/cjs/notification-hub.d.ts +41 -0
- package/dist/cjs/notification-hub.js +373 -0
- package/dist/cjs/pg-catalog-text.d.ts +96 -0
- package/dist/cjs/pg-catalog-text.js +213 -0
- package/dist/cjs/pg-types.d.ts +46 -2
- package/dist/cjs/pipeline-submittable.d.ts +15 -5
- package/dist/cjs/pipeline-submittable.js +103 -48
- package/dist/cjs/pipeline.d.ts +5 -2
- package/dist/cjs/pipeline.js +111 -41
- package/dist/cjs/plan-divergence.d.ts +1 -1
- package/dist/cjs/plan-divergence.js +1 -1
- package/dist/cjs/powdb-introspect.d.ts +1 -1
- package/dist/cjs/powdb-introspect.js +5 -5
- package/dist/cjs/powdb-shared.d.ts +5 -5
- package/dist/cjs/powdb-shared.js +6 -5
- package/dist/cjs/powdb.d.ts +28 -10
- package/dist/cjs/powdb.js +80 -28
- package/dist/cjs/powql.d.ts +50 -28
- package/dist/cjs/powql.js +47 -33
- package/dist/cjs/prisma-compat.js +4 -5
- package/dist/cjs/prisma-schema-fingerprint.d.ts +1 -1
- package/dist/cjs/prisma-schema-fingerprint.js +1 -1
- package/dist/cjs/query/aggregates.d.ts +0 -13
- package/dist/cjs/query/aggregates.js +105 -238
- package/dist/cjs/query/batched-loader.d.ts +1 -1
- package/dist/cjs/query/batched-loader.js +18 -20
- package/dist/cjs/query/builder.d.ts +108 -144
- package/dist/cjs/query/builder.js +592 -893
- package/dist/cjs/query/compound-unique.d.ts +18 -3
- package/dist/cjs/query/compound-unique.js +110 -43
- package/dist/cjs/query/cursor-tuple.d.ts +17 -0
- package/dist/cjs/query/cursor-tuple.js +121 -0
- package/dist/cjs/query/expr.d.ts +2 -0
- package/dist/cjs/query/expr.js +40 -23
- package/dist/cjs/query/filters.d.ts +39 -7
- package/dist/cjs/query/filters.js +77 -19
- package/dist/cjs/query/normalize-args.d.ts +1 -1
- package/dist/cjs/query/normalize-args.js +7 -5
- package/dist/cjs/query/option-surface.d.ts +1 -1
- package/dist/cjs/query/option-surface.js +5 -3
- package/dist/cjs/query/pg-type-parsers.d.ts +126 -0
- package/dist/cjs/query/pg-type-parsers.js +306 -0
- package/dist/cjs/query/relation-names.d.ts +4 -2
- package/dist/cjs/query/relation-names.js +21 -12
- package/dist/cjs/query/relations.d.ts +19 -7
- package/dist/cjs/query/relations.js +329 -260
- package/dist/cjs/query/row-lock.js +3 -3
- package/dist/cjs/query/sql-comment.js +3 -3
- package/dist/cjs/query/stream-idle.d.ts +11 -1
- package/dist/cjs/query/stream-idle.js +53 -13
- package/dist/cjs/query/stream-signal.d.ts +21 -0
- package/dist/cjs/query/stream-signal.js +132 -0
- package/dist/cjs/query/temporal-parsers.d.ts +101 -0
- package/dist/cjs/query/temporal-parsers.js +362 -0
- package/dist/cjs/query/types.d.ts +67 -20
- package/dist/cjs/query/utils.d.ts +2 -878
- package/dist/cjs/query/utils.js +25 -2058
- package/dist/cjs/query/warn-registry.d.ts +1 -1
- package/dist/cjs/query/warn-registry.js +1 -1
- package/dist/cjs/query/where-compile.d.ts +4 -1
- package/dist/cjs/query/where-compile.js +18 -14
- package/dist/cjs/query/where.d.ts +14 -7
- package/dist/cjs/query/where.js +244 -436
- package/dist/cjs/query/writes.d.ts +33 -2
- package/dist/cjs/query/writes.js +104 -77
- package/dist/cjs/query-utils.d.ts +687 -0
- package/dist/cjs/query-utils.js +1444 -0
- package/dist/cjs/realtime.d.ts +1 -1
- package/dist/cjs/realtime.js +3 -3
- package/dist/cjs/schema-builder.js +2 -2
- package/dist/cjs/schema-metadata.d.ts +13 -3
- package/dist/cjs/schema-metadata.js +33 -5
- package/dist/cjs/schema-sql.d.ts +15 -24
- package/dist/cjs/schema-sql.js +53 -63
- package/dist/cjs/schema.d.ts +37 -2
- package/dist/cjs/schema.js +29 -2
- package/dist/cjs/seed.js +5 -5
- package/dist/cjs/serverless.d.ts +24 -71
- package/dist/cjs/serverless.js +24 -71
- package/dist/cjs/sql.d.ts +111 -0
- package/dist/cjs/sql.js +335 -0
- package/dist/cjs/sqlite-seed.d.ts +17 -0
- package/dist/cjs/sqlite-seed.js +31 -0
- package/dist/cjs/sqlite.d.ts +32 -19
- package/dist/cjs/sqlite.js +865 -652
- package/dist/cjs/supplied-pool-types.js +10 -9
- package/dist/cjs/transaction-control.js +6 -1
- package/dist/cjs/transaction-outcome.d.ts +61 -0
- package/dist/cjs/transaction-outcome.js +239 -0
- package/dist/cjs/transaction-state.d.ts +82 -13
- package/dist/cjs/transaction-state.js +222 -56
- package/dist/cjs/transaction-transport.d.ts +38 -0
- package/dist/cjs/transaction-transport.js +157 -0
- package/dist/cjs/typed-sql.d.ts +1 -1
- package/dist/cjs/typed-sql.js +1 -1
- package/dist/cli/compile-query.d.ts +6 -3
- package/dist/cli/compile-query.js +25 -4
- package/dist/cli/config.d.ts +35 -10
- package/dist/cli/config.js +170 -43
- package/dist/cli/d1-config.d.ts +14 -0
- package/dist/cli/d1-config.js +6 -0
- package/dist/cli/d1-local.d.ts +31 -0
- package/dist/cli/d1-local.js +285 -0
- package/dist/cli/d1-migrations.d.ts +16 -0
- package/dist/cli/d1-migrations.js +151 -0
- package/dist/cli/d1-project.d.ts +23 -0
- package/dist/cli/d1-project.js +304 -0
- package/dist/cli/d1-seed.d.ts +35 -0
- package/dist/cli/d1-seed.js +213 -0
- package/dist/cli/destructive.js +1 -2
- package/dist/cli/error-catalog.d.ts +3 -3
- package/dist/cli/error-catalog.js +21 -3
- package/dist/cli/index.d.ts +13 -8
- package/dist/cli/index.js +500 -71
- package/dist/cli/libsql-migrate-command.d.ts +5 -0
- package/dist/cli/libsql-migrate-command.js +77 -0
- package/dist/cli/libsql-migrate-status.d.ts +33 -0
- package/dist/cli/libsql-migrate-status.js +182 -0
- package/dist/cli/libsql-migrate.d.ts +14 -0
- package/dist/cli/libsql-migrate.js +516 -0
- package/dist/cli/libsql-project-config.d.ts +11 -0
- package/dist/cli/libsql-project-config.js +55 -0
- package/dist/cli/libsql-project.d.ts +52 -0
- package/dist/cli/libsql-project.js +391 -0
- package/dist/cli/libsql-seed-command.d.ts +29 -0
- package/dist/cli/libsql-seed-command.js +85 -0
- package/dist/cli/loader.d.ts +6 -5
- package/dist/cli/loader.js +50 -9
- package/dist/cli/mcp.d.ts +16 -1
- package/dist/cli/mcp.js +220 -127
- package/dist/cli/migrate.d.ts +2 -2
- package/dist/cli/migrate.js +29 -14
- package/dist/cli/mssql-doctor.d.ts +44 -0
- package/dist/cli/mssql-doctor.js +237 -0
- package/dist/cli/mssql-migrate-command.d.ts +9 -0
- package/dist/cli/mssql-migrate-command.js +192 -0
- package/dist/cli/mssql-migrate-connection.d.ts +51 -0
- package/dist/cli/mssql-migrate-connection.js +245 -0
- package/dist/cli/mssql-migrate-sql.d.ts +12 -0
- package/dist/cli/mssql-migrate-sql.js +275 -0
- package/dist/cli/mssql-migrate.d.ts +45 -0
- package/dist/cli/mssql-migrate.js +290 -0
- package/dist/cli/mssql-project.d.ts +34 -0
- package/dist/cli/mssql-project.js +160 -0
- package/dist/cli/mssql-seed.d.ts +7 -0
- package/dist/cli/mssql-seed.js +73 -0
- package/dist/cli/mssql-tools.d.ts +37 -0
- package/dist/cli/mssql-tools.js +341 -0
- package/dist/cli/mysql-doctor.d.ts +48 -0
- package/dist/cli/mysql-doctor.js +316 -0
- package/dist/cli/mysql-migrate-command.d.ts +7 -0
- package/dist/cli/mysql-migrate-command.js +285 -0
- package/dist/cli/mysql-migrate-sql.d.ts +18 -0
- package/dist/cli/mysql-migrate-sql.js +162 -0
- package/dist/cli/mysql-migrate.d.ts +77 -0
- package/dist/cli/mysql-migrate.js +606 -0
- package/dist/cli/mysql-project.d.ts +49 -0
- package/dist/cli/mysql-project.js +272 -0
- package/dist/cli/mysql-push-command.d.ts +7 -0
- package/dist/cli/mysql-push-command.js +89 -0
- package/dist/cli/mysql-push.d.ts +15 -0
- package/dist/cli/mysql-push.js +95 -0
- package/dist/cli/mysql-schema-command.d.ts +5 -0
- package/dist/cli/mysql-schema-command.js +54 -0
- package/dist/cli/mysql-schema-ddl.d.ts +37 -0
- package/dist/cli/mysql-schema-ddl.js +227 -0
- package/dist/cli/mysql-schema-snapshot.d.ts +21 -0
- package/dist/cli/mysql-schema-snapshot.js +119 -0
- package/dist/cli/mysql-schema.d.ts +27 -0
- package/dist/cli/mysql-schema.js +200 -0
- package/dist/cli/mysql-seed-loader.cjs +25 -0
- package/dist/cli/mysql-seed-loader.d.cts +3 -0
- package/dist/cli/mysql-seed.d.ts +6 -0
- package/dist/cli/mysql-seed.js +75 -0
- package/dist/cli/mysql-tools.d.ts +44 -0
- package/dist/cli/mysql-tools.js +290 -0
- package/dist/cli/no-follow.d.ts +29 -0
- package/dist/cli/no-follow.js +67 -0
- package/dist/cli/pii-predicate-guard.d.ts +1 -1
- package/dist/cli/pii-predicate-guard.js +2 -2
- package/dist/cli/pii-tags.d.ts +2 -2
- package/dist/cli/pii-tags.js +1 -1
- package/dist/cli/prisma-schema.js +2 -2
- package/dist/cli/sql-statements.d.ts +1 -1
- package/dist/cli/sql-statements.js +1 -1
- package/dist/cli/sqlite-doctor.d.ts +35 -0
- package/dist/cli/sqlite-doctor.js +392 -0
- package/dist/cli/sqlite-migrate-command.d.ts +4 -0
- package/dist/cli/sqlite-migrate-command.js +171 -0
- package/dist/cli/sqlite-migrate.d.ts +61 -0
- package/dist/cli/sqlite-migrate.js +681 -0
- package/dist/cli/sqlite-project.d.ts +42 -0
- package/dist/cli/sqlite-project.js +244 -0
- package/dist/cli/sqlite-schema-command.d.ts +4 -0
- package/dist/cli/sqlite-schema-command.js +79 -0
- package/dist/cli/sqlite-schema-ddl.d.ts +25 -0
- package/dist/cli/sqlite-schema-ddl.js +248 -0
- package/dist/cli/sqlite-schema.d.ts +25 -0
- package/dist/cli/sqlite-schema.js +330 -0
- package/dist/cli/sqlite-seed.d.ts +4 -0
- package/dist/cli/sqlite-seed.js +57 -0
- package/dist/cli/sqlite-tools.d.ts +24 -0
- package/dist/cli/sqlite-tools.js +163 -0
- package/dist/cli/studio.js +9 -9
- package/dist/cli/tool-capabilities.d.ts +72 -0
- package/dist/cli/tool-capabilities.js +114 -0
- package/dist/cli/tool-command.d.ts +11 -0
- package/dist/cli/tool-command.js +45 -0
- package/dist/cli/ui.d.ts +1 -1
- package/dist/cli/ui.js +1 -1
- package/dist/client.d.ts +20 -20
- package/dist/client.js +62 -341
- package/dist/connection-url.d.ts +1 -1
- package/dist/connection-url.js +1 -1
- package/dist/core.d.ts +58 -0
- package/dist/core.js +220 -0
- package/dist/d1/catalog-metadata.d.ts +5 -0
- package/dist/d1/catalog-metadata.js +227 -0
- package/dist/d1/catalog.d.ts +15 -0
- package/dist/d1/catalog.js +82 -0
- package/dist/d1/generate.d.ts +8 -0
- package/dist/d1/generate.js +160 -0
- package/dist/d1/introspect.d.ts +21 -0
- package/dist/d1/introspect.js +71 -0
- package/dist/d1/migrate.d.ts +29 -0
- package/dist/d1/migrate.js +217 -0
- package/dist/d1/migrations/sql.d.ts +2 -0
- package/dist/d1/migrations/sql.js +106 -0
- package/dist/d1/pool.d.ts +14 -0
- package/dist/d1/pool.js +86 -0
- package/dist/d1/sql.d.ts +5 -0
- package/dist/d1/sql.js +135 -0
- package/dist/d1/sqlite-dialect.d.ts +16 -0
- package/dist/d1/sqlite-dialect.js +572 -0
- package/dist/d1/types.d.ts +29 -0
- package/dist/d1/types.js +1 -0
- package/dist/d1.d.ts +53 -0
- package/dist/d1.js +215 -0
- package/dist/dialect.d.ts +33 -5
- package/dist/dialect.js +6 -4
- package/dist/errors.d.ts +38 -1
- package/dist/errors.js +68 -17
- package/dist/generate.d.ts +19 -3
- package/dist/generate.js +330 -97
- package/dist/global-filters-config.js +2 -2
- package/dist/index-advisor.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/introspect.d.ts +59 -356
- package/dist/introspect.js +116 -943
- package/dist/libsql/bindings.d.ts +2 -0
- package/dist/libsql/bindings.js +75 -0
- package/dist/libsql/dialect.d.ts +3 -0
- package/dist/libsql/dialect.js +45 -0
- package/dist/libsql/generate.d.ts +4 -0
- package/dist/libsql/generate.js +53 -0
- package/dist/libsql/introspect.d.ts +16 -0
- package/dist/libsql/introspect.js +289 -0
- package/dist/libsql/pool.d.ts +42 -0
- package/dist/libsql/pool.js +270 -0
- package/dist/libsql/seed-cleanup.d.ts +2 -0
- package/dist/libsql/seed-cleanup.js +15 -0
- package/dist/libsql/values.d.ts +20 -0
- package/dist/libsql/values.js +68 -0
- package/dist/libsql-seed.d.ts +19 -0
- package/dist/libsql-seed.js +46 -0
- package/dist/libsql.d.ts +28 -0
- package/dist/libsql.js +79 -0
- package/dist/live-query.d.ts +33 -0
- package/dist/live-query.js +169 -0
- package/dist/log-codes.d.ts +1 -1
- package/dist/log-codes.js +4 -0
- package/dist/mssql-seed.d.ts +27 -0
- package/dist/mssql-seed.js +114 -0
- package/dist/mssql.d.ts +7 -7
- package/dist/mssql.js +366 -54
- package/dist/mysql-seed.d.ts +25 -0
- package/dist/mysql-seed.js +165 -0
- package/dist/mysql.d.ts +18 -6
- package/dist/mysql.js +603 -95
- package/dist/neon-http/client.d.ts +95 -0
- package/dist/neon-http/client.js +286 -0
- package/dist/neon-http/sql.d.ts +3 -0
- package/dist/neon-http/sql.js +112 -0
- package/dist/neon-http.d.ts +5 -0
- package/dist/neon-http.js +2 -0
- package/dist/neon-ws/load-driver.cjs +11 -0
- package/dist/neon-ws/load-driver.d.cts +9 -0
- package/dist/neon-ws/recovery.d.ts +14 -0
- package/dist/neon-ws/recovery.js +66 -0
- package/dist/neon-ws/snapshot.d.ts +3 -0
- package/dist/neon-ws/snapshot.js +15 -0
- package/dist/neon-ws/transport.d.ts +112 -0
- package/dist/neon-ws/transport.js +286 -0
- package/dist/neon-ws.d.ts +26 -0
- package/dist/neon-ws.js +182 -0
- package/dist/nested-write.d.ts +34 -3
- package/dist/nested-write.js +114 -22
- package/dist/notification-hub/consumer.d.ts +22 -0
- package/dist/notification-hub/consumer.js +106 -0
- package/dist/notification-hub.d.ts +41 -0
- package/dist/notification-hub.js +370 -0
- package/dist/pg-catalog-text.d.ts +96 -0
- package/dist/pg-catalog-text.js +208 -0
- package/dist/pg-types.d.ts +46 -2
- package/dist/pipeline-submittable.d.ts +15 -5
- package/dist/pipeline-submittable.js +105 -50
- package/dist/pipeline.d.ts +5 -2
- package/dist/pipeline.js +113 -43
- package/dist/plan-divergence.d.ts +1 -1
- package/dist/plan-divergence.js +1 -1
- package/dist/powdb-introspect.d.ts +1 -1
- package/dist/powdb-introspect.js +5 -5
- package/dist/powdb-shared.d.ts +5 -5
- package/dist/powdb-shared.js +6 -5
- package/dist/powdb.d.ts +28 -10
- package/dist/powdb.js +80 -28
- package/dist/powql.d.ts +50 -28
- package/dist/powql.js +49 -35
- package/dist/prisma-compat.js +4 -5
- package/dist/prisma-schema-fingerprint.d.ts +1 -1
- package/dist/prisma-schema-fingerprint.js +1 -1
- package/dist/query/aggregates.d.ts +0 -13
- package/dist/query/aggregates.js +97 -230
- package/dist/query/batched-loader.d.ts +1 -1
- package/dist/query/batched-loader.js +5 -7
- package/dist/query/builder.d.ts +108 -144
- package/dist/query/builder.js +563 -864
- package/dist/query/compound-unique.d.ts +18 -3
- package/dist/query/compound-unique.js +99 -33
- package/dist/query/cursor-tuple.d.ts +17 -0
- package/dist/query/cursor-tuple.js +114 -0
- package/dist/query/expr.d.ts +2 -0
- package/dist/query/expr.js +32 -16
- package/dist/query/filters.d.ts +39 -7
- package/dist/query/filters.js +69 -14
- package/dist/query/normalize-args.d.ts +1 -1
- package/dist/query/normalize-args.js +4 -2
- package/dist/query/option-surface.d.ts +1 -1
- package/dist/query/option-surface.js +4 -2
- package/dist/query/pg-type-parsers.d.ts +126 -0
- package/dist/query/pg-type-parsers.js +296 -0
- package/dist/query/relation-names.d.ts +4 -2
- package/dist/query/relation-names.js +15 -7
- package/dist/query/relations.d.ts +19 -7
- package/dist/query/relations.js +293 -227
- package/dist/query/row-lock.js +1 -1
- package/dist/query/sql-comment.js +1 -1
- package/dist/query/stream-idle.d.ts +11 -1
- package/dist/query/stream-idle.js +51 -13
- package/dist/query/stream-signal.d.ts +21 -0
- package/dist/query/stream-signal.js +125 -0
- package/dist/query/temporal-parsers.d.ts +101 -0
- package/dist/query/temporal-parsers.js +354 -0
- package/dist/query/types.d.ts +67 -20
- package/dist/query/utils.d.ts +2 -878
- package/dist/query/utils.js +5 -2003
- package/dist/query/warn-registry.d.ts +1 -1
- package/dist/query/warn-registry.js +1 -1
- package/dist/query/where-compile.d.ts +4 -1
- package/dist/query/where-compile.js +14 -10
- package/dist/query/where.d.ts +14 -7
- package/dist/query/where.js +236 -430
- package/dist/query/writes.d.ts +33 -2
- package/dist/query/writes.js +90 -65
- package/dist/query-utils.d.ts +687 -0
- package/dist/query-utils.js +1390 -0
- package/dist/realtime.d.ts +1 -1
- package/dist/realtime.js +3 -3
- package/dist/schema-builder.js +2 -2
- package/dist/schema-metadata.d.ts +13 -3
- package/dist/schema-metadata.js +33 -5
- package/dist/schema-sql.d.ts +15 -24
- package/dist/schema-sql.js +50 -60
- package/dist/schema.d.ts +37 -2
- package/dist/schema.js +29 -2
- package/dist/seed.js +5 -5
- package/dist/serverless.d.ts +24 -71
- package/dist/serverless.js +24 -71
- package/dist/sql.d.ts +111 -0
- package/dist/sql.js +321 -0
- package/dist/sqlite-seed.d.ts +17 -0
- package/dist/sqlite-seed.js +27 -0
- package/dist/sqlite.d.ts +32 -19
- package/dist/sqlite.js +859 -648
- package/dist/supplied-pool-types.js +2 -1
- package/dist/transaction-control.js +6 -1
- package/dist/transaction-outcome.d.ts +61 -0
- package/dist/transaction-outcome.js +234 -0
- package/dist/transaction-state.d.ts +82 -13
- package/dist/transaction-state.js +220 -57
- package/dist/transaction-transport.d.ts +38 -0
- package/dist/transaction-transport.js +153 -0
- package/dist/typed-sql.d.ts +1 -1
- package/dist/typed-sql.js +1 -1
- package/package.json +239 -13
- package/skills/turbine-orm/SKILL.md +6 -5
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.cmdMssqlMigrate = void 0;
|
|
37
|
+
exports.showMssqlMigrationHelp = showMssqlMigrationHelp;
|
|
38
|
+
exports.createMssqlMigrationCommand = createMssqlMigrationCommand;
|
|
39
|
+
/** SQL Server migration command adapter. Engine selection remains in the shared dispatcher. */
|
|
40
|
+
const node_fs_1 = require("node:fs");
|
|
41
|
+
const errors_js_1 = require("../errors.js");
|
|
42
|
+
const introspect_js_1 = require("../introspect.js");
|
|
43
|
+
const migrate_js_1 = require("./migrate.js");
|
|
44
|
+
const native = __importStar(require("./mssql-migrate.js"));
|
|
45
|
+
const mssql_migrate_sql_js_1 = require("./mssql-migrate-sql.js");
|
|
46
|
+
const ui_js_1 = require("./ui.js");
|
|
47
|
+
function showMssqlMigrationHelp() {
|
|
48
|
+
(0, ui_js_1.banner)();
|
|
49
|
+
(0, ui_js_1.info)('SQL Server SQL-first migrations (--engine mssql, --schema dbo):');
|
|
50
|
+
(0, ui_js_1.info)('migrate create <name> | up [--step N] | deploy [--wait[=seconds]] | down [--step N] | status [--exit-code]');
|
|
51
|
+
(0, ui_js_1.info)('up/down/deploy accept --dry-run. up/down require confirmation or --allow-destructive for destructive SQL.');
|
|
52
|
+
(0, ui_js_1.info)('deploy permits supported destructive SQL without prompting. Each selected run commits atomically.');
|
|
53
|
+
(0, ui_js_1.info)('--wait takes 1..2147483 whole seconds; omit it for no lock wait. Bare --wait means 300 seconds.');
|
|
54
|
+
(0, ui_js_1.info)('Use explicit schema.object names in UP/DOWN SQL. GO on its own line separates native batches.');
|
|
55
|
+
(0, ui_js_1.info)('Drift overrides, no-transaction, sqlcmd, procedural/dynamic SQL and code-first recipes are unsupported.');
|
|
56
|
+
}
|
|
57
|
+
function validate(args, config, sub, argv) {
|
|
58
|
+
if (String(config.engine) !== 'mssql')
|
|
59
|
+
throw new errors_js_1.ValidationError('SQL Server migration commands require engine "mssql".');
|
|
60
|
+
if (config.adapter !== undefined ||
|
|
61
|
+
args.auto ||
|
|
62
|
+
args.fromDiff ||
|
|
63
|
+
args.recipe ||
|
|
64
|
+
args.allowPending ||
|
|
65
|
+
args.allowPooler ||
|
|
66
|
+
args.withSchema ||
|
|
67
|
+
config.schemaFileConfigured ||
|
|
68
|
+
args.force ||
|
|
69
|
+
args.allowDrift) {
|
|
70
|
+
throw new errors_js_1.ValidationError('SQL Server migrations refuse adapters, schema diff/recipes/schemaFile, --force, --allow-drift, --allow-pending and --allow-pooler. Use explicit UP/DOWN SQL.');
|
|
71
|
+
}
|
|
72
|
+
const supported = new Set([
|
|
73
|
+
'command',
|
|
74
|
+
'subcommand',
|
|
75
|
+
'positional',
|
|
76
|
+
'engine',
|
|
77
|
+
'url',
|
|
78
|
+
'schema',
|
|
79
|
+
'step',
|
|
80
|
+
'dryRun',
|
|
81
|
+
'exitCode',
|
|
82
|
+
'wait',
|
|
83
|
+
'allowDestructive',
|
|
84
|
+
'verbose',
|
|
85
|
+
'help',
|
|
86
|
+
]);
|
|
87
|
+
for (const key of Object.keys(args)) {
|
|
88
|
+
if (!supported.has(key))
|
|
89
|
+
throw new errors_js_1.ValidationError(`SQL Server migrate does not support option "${key}".`);
|
|
90
|
+
}
|
|
91
|
+
// Preserve the shared parser but refuse missing operands, including flags
|
|
92
|
+
// swallowed by an earlier duplicate that the parsed object no longer shows.
|
|
93
|
+
const valueFlags = new Set(['--url', '-u', '--schema', '-s']);
|
|
94
|
+
for (let i = 1; i < argv.length; i++) {
|
|
95
|
+
if (!valueFlags.has(argv[i]))
|
|
96
|
+
continue;
|
|
97
|
+
const value = argv[i + 1];
|
|
98
|
+
if (!value?.trim() || value.startsWith('-')) {
|
|
99
|
+
throw new errors_js_1.ValidationError(`SQL Server migrate ${argv[i]} requires a value.`);
|
|
100
|
+
}
|
|
101
|
+
i++;
|
|
102
|
+
}
|
|
103
|
+
for (const key of ['url', 'schema']) {
|
|
104
|
+
if (Object.hasOwn(args, key) && (!args[key]?.trim() || args[key].startsWith('-'))) {
|
|
105
|
+
throw new errors_js_1.ValidationError(`SQL Server migrate option "${key}" requires a value.`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (args.allowDestructive && !['up', 'down', 'deploy'].includes(sub))
|
|
109
|
+
throw new errors_js_1.ValidationError('--allow-destructive only applies to migrate up/down/deploy.');
|
|
110
|
+
if (args.exitCode && !['status', 'list'].includes(sub))
|
|
111
|
+
throw new errors_js_1.ValidationError('--exit-code only applies to migrate status.');
|
|
112
|
+
if (args.wait !== undefined && sub !== 'deploy')
|
|
113
|
+
throw new errors_js_1.ValidationError('--wait only applies to migrate deploy.');
|
|
114
|
+
if (args.wait !== undefined && (!Number.isInteger(args.wait) || args.wait < 1 || args.wait * 1000 > 2147483647)) {
|
|
115
|
+
throw new errors_js_1.ValidationError('SQL Server migration --wait must be whole seconds between 1 and 2147483; omit it for no wait.');
|
|
116
|
+
}
|
|
117
|
+
if (args.step !== undefined && (!['up', 'down'].includes(sub) || !Number.isSafeInteger(args.step) || args.step < 1)) {
|
|
118
|
+
throw new errors_js_1.ValidationError('--step must be a positive safe integer for SQL Server migrate up/down.');
|
|
119
|
+
}
|
|
120
|
+
if (args.dryRun && !['up', 'down', 'deploy'].includes(sub))
|
|
121
|
+
throw new errors_js_1.ValidationError('--dry-run only applies to migrate up/down/deploy.');
|
|
122
|
+
}
|
|
123
|
+
function inventory(files, direction) {
|
|
124
|
+
native.assertMssqlMigrationFiles(files, direction);
|
|
125
|
+
for (const file of files) {
|
|
126
|
+
const sql = (0, mssql_migrate_sql_js_1.parseMssqlMigrationContent)((0, node_fs_1.readFileSync)(file.path, 'utf8'), file.filename)[direction];
|
|
127
|
+
(0, ui_js_1.label)('Migration', (0, introspect_js_1.printableCatalogName)(file.filename));
|
|
128
|
+
if ((0, mssql_migrate_sql_js_1.scanMssqlMigrationDestructive)(sql).length)
|
|
129
|
+
(0, ui_js_1.warn)('DESTRUCTIVE SQL Server migration.');
|
|
130
|
+
console.log(sql);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/** A separate factory permits observable command tests without replacing shared CLI configuration. */
|
|
134
|
+
function createMssqlMigrationCommand(runner = native) {
|
|
135
|
+
return async function cmdMssqlMigrate(args, config, confirmDestructive, argv = process.argv.slice(2)) {
|
|
136
|
+
const sub = args.subcommand;
|
|
137
|
+
if (!sub || sub === 'help') {
|
|
138
|
+
showMssqlMigrationHelp();
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (!['create', 'up', 'deploy', 'down', 'status', 'list'].includes(sub))
|
|
142
|
+
throw new errors_js_1.ValidationError(`Unknown migrate subcommand: ${sub}`);
|
|
143
|
+
validate(args, config, sub, argv);
|
|
144
|
+
(0, ui_js_1.banner)();
|
|
145
|
+
if (sub === 'create') {
|
|
146
|
+
const name = args.positional[0];
|
|
147
|
+
if (!name || args.positional.length !== 1)
|
|
148
|
+
throw new errors_js_1.ValidationError('Usage: turbine migrate create <name>');
|
|
149
|
+
const file = (0, migrate_js_1.createMigration)(config.migrationsDir, name);
|
|
150
|
+
(0, ui_js_1.success)(`Created ${(0, introspect_js_1.printableCatalogName)(file.path)}`);
|
|
151
|
+
(0, ui_js_1.info)('Edit its UP/DOWN SQL Server SQL; qualify user objects with their schema.');
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (args.positional.length)
|
|
155
|
+
throw new errors_js_1.ValidationError(`Unexpected arguments for migrate ${sub}.`);
|
|
156
|
+
if (!config.url)
|
|
157
|
+
throw new errors_js_1.ValidationError('SQL Server migrations require --url, config.url or MSSQL DATABASE_URL.');
|
|
158
|
+
(0, ui_js_1.label)('SQL Server schema', (0, introspect_js_1.printableCatalogName)(config.schema));
|
|
159
|
+
(0, ui_js_1.label)('Migrations', (0, introspect_js_1.printableCatalogName)(config.migrationsDir));
|
|
160
|
+
const ignored = (0, migrate_js_1.listIgnoredSqlFiles)(config.migrationsDir);
|
|
161
|
+
for (const name of ignored)
|
|
162
|
+
(0, ui_js_1.warn)(`Not a migration (expected YYYYMMDDHHMMSS_name.sql): ${(0, introspect_js_1.printableCatalogName)(name)}`);
|
|
163
|
+
const options = { schema: config.schema };
|
|
164
|
+
if (sub === 'status' || sub === 'list') {
|
|
165
|
+
const statuses = await runner.migrateMssqlStatus(config.url, config.migrationsDir, options);
|
|
166
|
+
console.log((0, ui_js_1.table)(['Status', 'Migration', 'Applied at'], statuses.map((s) => [
|
|
167
|
+
s.missingFile ? 'Missing file' : s.checksumValid === false ? 'Drifted' : s.applied ? 'Applied' : 'Pending',
|
|
168
|
+
(0, introspect_js_1.printableCatalogName)(s.file.filename),
|
|
169
|
+
s.appliedAt?.toISOString() ?? '-',
|
|
170
|
+
])));
|
|
171
|
+
const problems = (0, migrate_js_1.statusGateProblems)((0, migrate_js_1.summarizeMigrationStatus)(statuses), ignored.map(introspect_js_1.printableCatalogName));
|
|
172
|
+
if (problems.length)
|
|
173
|
+
(0, ui_js_1.warn)(`Migration history is not clean: ${problems.join(', ')}`);
|
|
174
|
+
if (args.exitCode && problems.length)
|
|
175
|
+
process.exitCode = 2;
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (args.dryRun) {
|
|
179
|
+
const plan = await runner.inspectMssqlMigrationDeploy(config.url, config.migrationsDir, options);
|
|
180
|
+
if (plan.mismatches.length)
|
|
181
|
+
throw new errors_js_1.MigrationError(`SQL Server migration checksum drift or missing files: ${plan.mismatches.map((m) => (0, introspect_js_1.printableCatalogName)(m.name)).join(', ')}.`);
|
|
182
|
+
const rollback = sub === 'down'
|
|
183
|
+
? await runner.planMssqlMigrationRollback(config.url, config.migrationsDir, { ...options, step: args.step })
|
|
184
|
+
: undefined;
|
|
185
|
+
if (rollback?.missing.length)
|
|
186
|
+
throw new errors_js_1.MigrationError(`Missing rollback files: ${rollback.missing.map(introspect_js_1.printableCatalogName).join(', ')}.`);
|
|
187
|
+
const files = rollback?.files ?? (sub === 'up' ? plan.pending.slice(0, args.step) : plan.pending);
|
|
188
|
+
inventory(files, sub === 'down' ? 'down' : 'up');
|
|
189
|
+
for (const order of plan.outOfOrder)
|
|
190
|
+
(0, ui_js_1.warn)(`Out of order: ${(0, introspect_js_1.printableCatalogName)(order.applied)} predates ${(0, introspect_js_1.printableCatalogName)(order.newestPrior)}.`);
|
|
191
|
+
(0, ui_js_1.info)(`Dry run: ${files.length} migration(s); no database or history changes made.`);
|
|
192
|
+
(0, ui_js_1.info)('SQL validity, database triggers and transaction state are checked during execution.');
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (sub === 'deploy')
|
|
196
|
+
(0, ui_js_1.warn)('Deploy permits supported destructive SQL Server migrations without prompting.');
|
|
197
|
+
const execute = (allowDestructive) => sub === 'down'
|
|
198
|
+
? runner.migrateMssqlDown(config.url, config.migrationsDir, { ...options, step: args.step, allowDestructive })
|
|
199
|
+
: sub === 'deploy'
|
|
200
|
+
? runner.migrateMssqlDeploy(config.url, config.migrationsDir, {
|
|
201
|
+
...options,
|
|
202
|
+
lockWaitMs: args.wait === undefined ? undefined : args.wait * 1000,
|
|
203
|
+
})
|
|
204
|
+
: runner.migrateMssqlUp(config.url, config.migrationsDir, { ...options, step: args.step, allowDestructive });
|
|
205
|
+
let result;
|
|
206
|
+
try {
|
|
207
|
+
result = await execute(args.allowDestructive === true);
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
if (!(error instanceof errors_js_1.MigrationError) ||
|
|
211
|
+
!error.message.includes('DESTRUCTIVE') ||
|
|
212
|
+
sub === 'deploy' ||
|
|
213
|
+
args.allowDestructive)
|
|
214
|
+
throw error;
|
|
215
|
+
if (!(await confirmDestructive(error.message)))
|
|
216
|
+
throw new errors_js_1.MigrationError('Aborted; no SQL Server migrations or history changes were committed.');
|
|
217
|
+
result = await execute(true);
|
|
218
|
+
}
|
|
219
|
+
if (result.errors.length)
|
|
220
|
+
throw new errors_js_1.MigrationError('SQL Server migration runner returned errors; no success can be reported.');
|
|
221
|
+
const files = 'applied' in result ? result.applied : result.rolledBack;
|
|
222
|
+
(0, ui_js_1.success)(`${files.length} migration(s) ${sub === 'down' ? 'rolled back' : 'applied'}`);
|
|
223
|
+
for (const file of files)
|
|
224
|
+
(0, ui_js_1.info)((0, introspect_js_1.printableCatalogName)(file.filename));
|
|
225
|
+
if ('outOfOrder' in result)
|
|
226
|
+
for (const order of result.outOfOrder)
|
|
227
|
+
(0, ui_js_1.warn)(`Applied ${(0, introspect_js_1.printableCatalogName)(order.applied)} out of order, before ${(0, introspect_js_1.printableCatalogName)(order.newestPrior)}.`);
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
exports.cmdMssqlMigrate = createMssqlMigrationCommand();
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface MssqlMigrationConfig extends Record<string, unknown> {
|
|
2
|
+
server: string;
|
|
3
|
+
database: string;
|
|
4
|
+
options?: Record<string, unknown>;
|
|
5
|
+
pool?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export type MssqlMigrationTarget = string | MssqlMigrationConfig;
|
|
8
|
+
export interface MssqlMigrationOptions {
|
|
9
|
+
schema?: string;
|
|
10
|
+
lockWaitMs?: number;
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
adapter?: never;
|
|
13
|
+
dialect?: never;
|
|
14
|
+
}
|
|
15
|
+
export interface MssqlMigrationRequest {
|
|
16
|
+
input(name: string, value: unknown): MssqlMigrationRequest;
|
|
17
|
+
query(sql: string): Promise<{
|
|
18
|
+
recordset?: Record<string, unknown>[];
|
|
19
|
+
}>;
|
|
20
|
+
batch(sql: string): Promise<unknown>;
|
|
21
|
+
cancel(): unknown;
|
|
22
|
+
}
|
|
23
|
+
interface NativePool {
|
|
24
|
+
connect(): Promise<unknown>;
|
|
25
|
+
close(): Promise<unknown>;
|
|
26
|
+
on(event: 'error', listener: (error: unknown) => void): unknown;
|
|
27
|
+
}
|
|
28
|
+
interface NativeTransaction {
|
|
29
|
+
begin(): Promise<unknown>;
|
|
30
|
+
commit(): Promise<unknown>;
|
|
31
|
+
rollback(): Promise<unknown>;
|
|
32
|
+
on(event: 'rollback', listener: (aborted: boolean) => void): unknown;
|
|
33
|
+
}
|
|
34
|
+
/** Structural optional-peer seam; never a PostgreSQL-compatible pool. */
|
|
35
|
+
export interface MssqlMigrationDriver {
|
|
36
|
+
ConnectionPool: new (config: MssqlMigrationConfig) => NativePool;
|
|
37
|
+
Transaction: new (pool: NativePool) => NativeTransaction;
|
|
38
|
+
Request: new (transaction: NativeTransaction) => MssqlMigrationRequest;
|
|
39
|
+
}
|
|
40
|
+
export declare const MSSQL_MIGRATION_LOCK = "turbine:migrations:v1";
|
|
41
|
+
export declare function quoteMssqlMigrationIdentifier(identifier: string): string;
|
|
42
|
+
export declare function mssqlMigrationConfig(target: MssqlMigrationTarget): MssqlMigrationConfig;
|
|
43
|
+
export declare function validateMssqlMigrationOptions(options?: MssqlMigrationOptions): void;
|
|
44
|
+
export interface MssqlMigrationSession {
|
|
45
|
+
query(sql: string, params?: Record<string, unknown>): Promise<Record<string, unknown>[]>;
|
|
46
|
+
batch(sql: string): Promise<void>;
|
|
47
|
+
assertActive(): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
/** Every Request uses this one Transaction, which pins the physical connection. */
|
|
50
|
+
export declare function withMssqlMigrationSession<T>(target: MssqlMigrationTarget, options: MssqlMigrationOptions, work: (session: MssqlMigrationSession) => Promise<T>, driverLoader?: () => Promise<MssqlMigrationDriver>): Promise<T>;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MSSQL_MIGRATION_LOCK = void 0;
|
|
7
|
+
exports.quoteMssqlMigrationIdentifier = quoteMssqlMigrationIdentifier;
|
|
8
|
+
exports.mssqlMigrationConfig = mssqlMigrationConfig;
|
|
9
|
+
exports.validateMssqlMigrationOptions = validateMssqlMigrationOptions;
|
|
10
|
+
exports.withMssqlMigrationSession = withMssqlMigrationSession;
|
|
11
|
+
/** Owned native SQL Server connection/transaction used only by the migration lifecycle. */
|
|
12
|
+
const errors_js_1 = require("../errors.js");
|
|
13
|
+
const optional_peer_import_cjs_1 = __importDefault(require("../optional-peer-import.cjs"));
|
|
14
|
+
exports.MSSQL_MIGRATION_LOCK = 'turbine:migrations:v1';
|
|
15
|
+
const UNKNOWN_COMMIT = 'SQL Server COMMIT acknowledgement failed; outcome is unknown. Inspect migration status before retrying.';
|
|
16
|
+
function quoteMssqlMigrationIdentifier(identifier) {
|
|
17
|
+
if (typeof identifier !== 'string' ||
|
|
18
|
+
!identifier ||
|
|
19
|
+
identifier.length > 128 ||
|
|
20
|
+
[...identifier].some((ch) => ch.charCodeAt(0) < 32 || ch.charCodeAt(0) === 127)) {
|
|
21
|
+
throw new errors_js_1.MigrationError('SQL Server migration schema must be a nonempty identifier of at most 128 characters without control characters.');
|
|
22
|
+
}
|
|
23
|
+
return `[${identifier.replace(/\]/g, ']]')}]`;
|
|
24
|
+
}
|
|
25
|
+
function mssqlMigrationConfig(target) {
|
|
26
|
+
let config;
|
|
27
|
+
if (typeof target === 'string') {
|
|
28
|
+
try {
|
|
29
|
+
const url = new URL(target);
|
|
30
|
+
const database = decodeURIComponent(url.pathname.slice(1));
|
|
31
|
+
if (url.protocol !== 'mssql:' || !url.hostname || !database || database.includes('/') || url.search || url.hash) {
|
|
32
|
+
throw new Error('invalid URL');
|
|
33
|
+
}
|
|
34
|
+
config = {
|
|
35
|
+
server: url.hostname,
|
|
36
|
+
port: url.port ? Number(url.port) : 1433,
|
|
37
|
+
database,
|
|
38
|
+
user: decodeURIComponent(url.username),
|
|
39
|
+
password: decodeURIComponent(url.password),
|
|
40
|
+
options: { encrypt: false, trustServerCertificate: true },
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
throw new errors_js_1.MigrationError('SQL Server migrations require mssql://host/database without query or fragment, or a native config object.');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else if (target &&
|
|
48
|
+
typeof target === 'object' &&
|
|
49
|
+
typeof target.server === 'string' &&
|
|
50
|
+
typeof target.database === 'string' &&
|
|
51
|
+
target.server &&
|
|
52
|
+
target.database &&
|
|
53
|
+
!('connect' in target) &&
|
|
54
|
+
!('request' in target)) {
|
|
55
|
+
config = target;
|
|
56
|
+
}
|
|
57
|
+
else
|
|
58
|
+
throw new errors_js_1.MigrationError('SQL Server migrations require an owned native connection config, never a borrowed pool.');
|
|
59
|
+
return {
|
|
60
|
+
...config,
|
|
61
|
+
pool: { ...config.pool, min: 0, max: 1 },
|
|
62
|
+
options: { ...config.options, abortTransactionOnError: true, enableImplicitTransactions: false, useUTC: true },
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function validateMssqlMigrationOptions(options = {}) {
|
|
66
|
+
quoteMssqlMigrationIdentifier(options.schema ?? 'dbo');
|
|
67
|
+
if (options.adapter !== undefined || options.dialect !== undefined) {
|
|
68
|
+
throw new errors_js_1.MigrationError('SQL Server migrations do not accept PostgreSQL adapters or caller-supplied dialects.');
|
|
69
|
+
}
|
|
70
|
+
if (options.lockWaitMs !== undefined &&
|
|
71
|
+
(!Number.isInteger(options.lockWaitMs) || options.lockWaitMs < 0 || options.lockWaitMs > 2147483647)) {
|
|
72
|
+
throw new errors_js_1.MigrationError('SQL Server migration lockWaitMs must be an integer between 0 and 2147483647.');
|
|
73
|
+
}
|
|
74
|
+
options.signal?.throwIfAborted();
|
|
75
|
+
}
|
|
76
|
+
async function loadDriver() {
|
|
77
|
+
let mod;
|
|
78
|
+
try {
|
|
79
|
+
mod = await (0, optional_peer_import_cjs_1.default)('mssql');
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
throw new errors_js_1.MigrationError("SQL Server migrations require the optional peer 'mssql'. Install it with npm i mssql.");
|
|
83
|
+
}
|
|
84
|
+
const driver = (mod.default ?? mod);
|
|
85
|
+
if (typeof driver.ConnectionPool !== 'function' ||
|
|
86
|
+
typeof driver.Transaction !== 'function' ||
|
|
87
|
+
typeof driver.Request !== 'function') {
|
|
88
|
+
throw new errors_js_1.MigrationError('SQL Server migration driver requires ConnectionPool, Transaction and Request.');
|
|
89
|
+
}
|
|
90
|
+
return driver;
|
|
91
|
+
}
|
|
92
|
+
/** Every Request uses this one Transaction, which pins the physical connection. */
|
|
93
|
+
async function withMssqlMigrationSession(target, options, work, driverLoader = loadDriver) {
|
|
94
|
+
validateMssqlMigrationOptions(options);
|
|
95
|
+
const config = mssqlMigrationConfig(target);
|
|
96
|
+
const requestedTimeout = config.requestTimeout ?? 15000;
|
|
97
|
+
if (!Number.isSafeInteger(requestedTimeout) ||
|
|
98
|
+
Number(requestedTimeout) < 0 ||
|
|
99
|
+
Number(requestedTimeout) > 2147483647) {
|
|
100
|
+
throw new errors_js_1.MigrationError('SQL Server migration native requestTimeout must be an integer between 0 and 2147483647.');
|
|
101
|
+
}
|
|
102
|
+
const lockTimeout = options.lockWaitMs ? options.lockWaitMs + 1000 : 0;
|
|
103
|
+
// Pool configuration works on all supported mssql majors. A Request.timeout
|
|
104
|
+
// property is ignored by the native driver; newer per-request overrides are
|
|
105
|
+
// deliberately not required. Preserve an explicit unlimited timeout (0).
|
|
106
|
+
config.requestTimeout =
|
|
107
|
+
requestedTimeout === 0 || lockTimeout > 2147483647 ? 0 : Math.max(Number(requestedTimeout), lockTimeout);
|
|
108
|
+
const driver = await driverLoader();
|
|
109
|
+
options.signal?.throwIfAborted();
|
|
110
|
+
const nativePool = new driver.ConnectionPool(config);
|
|
111
|
+
let transaction;
|
|
112
|
+
let aborted = false;
|
|
113
|
+
let begun = false;
|
|
114
|
+
let committed = false;
|
|
115
|
+
let commitAttempted = false;
|
|
116
|
+
let primary;
|
|
117
|
+
let failed = false;
|
|
118
|
+
let result;
|
|
119
|
+
const cleanup = [];
|
|
120
|
+
let poolError;
|
|
121
|
+
nativePool.on('error', (error) => {
|
|
122
|
+
poolError = error;
|
|
123
|
+
});
|
|
124
|
+
let sessionId;
|
|
125
|
+
async function request(sql, params, batch, recovery = false) {
|
|
126
|
+
if (!recovery) {
|
|
127
|
+
options.signal?.throwIfAborted();
|
|
128
|
+
if (poolError !== undefined)
|
|
129
|
+
throw poolError;
|
|
130
|
+
if (aborted)
|
|
131
|
+
throw new errors_js_1.MigrationError('SQL Server rolled back the migration transaction.');
|
|
132
|
+
}
|
|
133
|
+
const req = new driver.Request(transaction);
|
|
134
|
+
for (const [key, value] of Object.entries(params))
|
|
135
|
+
req.input(key, value);
|
|
136
|
+
const cancel = () => {
|
|
137
|
+
try {
|
|
138
|
+
req.cancel();
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
cleanup.push(error);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
if (!recovery)
|
|
145
|
+
options.signal?.addEventListener('abort', cancel, { once: true });
|
|
146
|
+
try {
|
|
147
|
+
const response = batch ? await req.batch(sql) : await req.query(sql);
|
|
148
|
+
if (!recovery)
|
|
149
|
+
options.signal?.throwIfAborted();
|
|
150
|
+
return response.recordset ?? [];
|
|
151
|
+
}
|
|
152
|
+
finally {
|
|
153
|
+
if (!recovery)
|
|
154
|
+
options.signal?.removeEventListener('abort', cancel);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const session = {
|
|
158
|
+
query: (sql, params = {}) => request(sql, params, false),
|
|
159
|
+
batch: async (sql) => {
|
|
160
|
+
await request(sql, {}, true);
|
|
161
|
+
},
|
|
162
|
+
assertActive: async () => {
|
|
163
|
+
const state = (await request('SELECT XACT_STATE() AS xactState, @@TRANCOUNT AS transactionCount, @@SPID AS sessionId;', {}, false))[0];
|
|
164
|
+
if (state?.xactState !== 1 ||
|
|
165
|
+
state.transactionCount !== 1 ||
|
|
166
|
+
(sessionId !== undefined && state.sessionId !== sessionId)) {
|
|
167
|
+
throw new errors_js_1.MigrationError('SQL Server migration transaction ownership was lost or is uncommittable (XACT_STATE/@@TRANCOUNT).');
|
|
168
|
+
}
|
|
169
|
+
sessionId = state.sessionId;
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
try {
|
|
173
|
+
// Native connect initializes the pool; Transaction.begin pins its checkout.
|
|
174
|
+
// This is not pg.Pool.connect, and the native error listener is installed above.
|
|
175
|
+
await nativePool.connect();
|
|
176
|
+
transaction = new driver.Transaction(nativePool);
|
|
177
|
+
transaction.on('rollback', () => {
|
|
178
|
+
aborted = true;
|
|
179
|
+
});
|
|
180
|
+
await transaction.begin();
|
|
181
|
+
begun = true;
|
|
182
|
+
await session.assertActive();
|
|
183
|
+
// Session options are confined to this owned pool; no application/borrowed handle is mutated.
|
|
184
|
+
await session.query('SET XACT_ABORT ON; SET QUOTED_IDENTIFIER ON;');
|
|
185
|
+
const lock = (await session.query(`DECLARE @result int;
|
|
186
|
+
EXEC @result = sys.sp_getapplock @Resource=@resource, @LockMode='Exclusive',
|
|
187
|
+
@LockOwner='Transaction', @LockTimeout=@wait, @DbPrincipal='public';
|
|
188
|
+
SELECT @result AS lockResult;`, { resource: exports.MSSQL_MIGRATION_LOCK, wait: options.lockWaitMs ?? 0 }))[0]?.lockResult;
|
|
189
|
+
if (lock !== 0 && lock !== 1) {
|
|
190
|
+
throw new errors_js_1.MigrationError(`SQL Server migration application lock was not acquired within ${options.lockWaitMs ?? 0}ms (result ${String(lock)}).`);
|
|
191
|
+
}
|
|
192
|
+
await session.assertActive();
|
|
193
|
+
result = await work(session);
|
|
194
|
+
await session.assertActive();
|
|
195
|
+
options.signal?.throwIfAborted();
|
|
196
|
+
try {
|
|
197
|
+
commitAttempted = true;
|
|
198
|
+
await transaction.commit();
|
|
199
|
+
committed = true;
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
throw Object.assign(new errors_js_1.MigrationError(UNKNOWN_COMMIT), { cause: error });
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
failed = true;
|
|
207
|
+
primary = error;
|
|
208
|
+
}
|
|
209
|
+
finally {
|
|
210
|
+
if (transaction && !committed && !aborted) {
|
|
211
|
+
let ended = false;
|
|
212
|
+
let pinReleased = false;
|
|
213
|
+
if (begun) {
|
|
214
|
+
try {
|
|
215
|
+
const state = (await request('SELECT XACT_STATE() AS xactState, @@TRANCOUNT AS transactionCount;', {}, false, true))[0];
|
|
216
|
+
ended = state?.xactState === 0 && state.transactionCount === 0;
|
|
217
|
+
}
|
|
218
|
+
catch (error) {
|
|
219
|
+
// Native COMMIT can release its physical pin even when acknowledgement
|
|
220
|
+
// fails. ENOTBEGUN is then expected and says nothing about the outcome.
|
|
221
|
+
pinReleased = commitAttempted && error?.code === 'ENOTBEGUN';
|
|
222
|
+
if (!aborted && !pinReleased)
|
|
223
|
+
cleanup.push(error);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
if (!aborted && !pinReleased) {
|
|
227
|
+
try {
|
|
228
|
+
await transaction.rollback();
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
const code = error?.code;
|
|
232
|
+
if (!(ended && (code === 'ENOTBEGUN' || code === 'EABORT')))
|
|
233
|
+
cleanup.push(error);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
try {
|
|
238
|
+
await nativePool.close();
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
cleanup.push(error);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (cleanup.length) {
|
|
245
|
+
const failures = new AggregateError(failed ? [primary, ...cleanup] : cleanup, committed
|
|
246
|
+
? 'SQL Server migrations committed, but connection cleanup failed.'
|
|
247
|
+
: commitAttempted
|
|
248
|
+
? `${UNKNOWN_COMMIT} Connection cleanup also failed.`
|
|
249
|
+
: 'SQL Server migration failed; cleanup also failed. Inspect server transaction state before retrying.');
|
|
250
|
+
throw Object.assign(new errors_js_1.MigrationError(failures.message), { cause: failures });
|
|
251
|
+
}
|
|
252
|
+
if (failed)
|
|
253
|
+
throw primary;
|
|
254
|
+
return result;
|
|
255
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DestructiveStatement } from './destructive.js';
|
|
2
|
+
import type { ParsedMigration } from './migrate.js';
|
|
3
|
+
/** Shared UP/DOWN format, with section-looking lines inside literals/comments preserved. */
|
|
4
|
+
export declare function parseMssqlMigrationContent(content: string, source?: string): ParsedMigration;
|
|
5
|
+
/** GO is a client batch separator, never sent to SQL Server. GO counts/sqlcmd are unsupported. */
|
|
6
|
+
export declare function splitMssqlMigrationBatches(sql: string): string[];
|
|
7
|
+
/** Conservative preflight for authored transactional DDL/DML, not a security sandbox. */
|
|
8
|
+
export declare function assertMssqlMigrationSql(sql: string): void;
|
|
9
|
+
/** Candidate names for a second reserved-name check using the actual database collation. */
|
|
10
|
+
export declare function mssqlMigrationIdentifiers(sql: string): string[];
|
|
11
|
+
/** Intentionally conservative: all ALTER/UPDATE/DELETE/MERGE/TRUNCATE/DROP require consent. */
|
|
12
|
+
export declare function scanMssqlMigrationDestructive(sql: string): DestructiveStatement[];
|