noormme 1.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/LICENSE +21 -0
- package/README.md +727 -0
- package/dist/cjs/cache/cache-manager.d.ts +76 -0
- package/dist/cjs/cache/cache-manager.js +169 -0
- package/dist/cjs/cli/commands/analyze.d.ts +7 -0
- package/dist/cjs/cli/commands/analyze.js +132 -0
- package/dist/cjs/cli/commands/generate.d.ts +7 -0
- package/dist/cjs/cli/commands/generate.js +514 -0
- package/dist/cjs/cli/commands/init.d.ts +7 -0
- package/dist/cjs/cli/commands/init.js +470 -0
- package/dist/cjs/cli/commands/inspect.d.ts +7 -0
- package/dist/cjs/cli/commands/inspect.js +365 -0
- package/dist/cjs/cli/commands/migrate.d.ts +8 -0
- package/dist/cjs/cli/commands/migrate.js +218 -0
- package/dist/cjs/cli/commands/optimize.d.ts +8 -0
- package/dist/cjs/cli/commands/optimize.js +156 -0
- package/dist/cjs/cli/commands/status.d.ts +6 -0
- package/dist/cjs/cli/commands/status.js +267 -0
- package/dist/cjs/cli/commands/watch.d.ts +7 -0
- package/dist/cjs/cli/commands/watch.js +216 -0
- package/dist/cjs/cli/index.d.ts +2 -0
- package/dist/cjs/cli/index.js +157 -0
- package/dist/cjs/dialect/database-introspector.d.ts +61 -0
- package/dist/cjs/dialect/database-introspector.js +85 -0
- package/dist/cjs/dialect/dialect-adapter-base.d.ts +94 -0
- package/dist/cjs/dialect/dialect-adapter-base.js +24 -0
- package/dist/cjs/dialect/dialect-adapter.d.ts +115 -0
- package/dist/cjs/dialect/dialect-adapter.js +2 -0
- package/dist/cjs/dialect/dialect.d.ts +34 -0
- package/dist/cjs/dialect/dialect.js +2 -0
- package/dist/cjs/dialect/sqlite/sqlite-adapter.d.ts +80 -0
- package/dist/cjs/dialect/sqlite/sqlite-adapter.js +23 -0
- package/dist/cjs/dialect/sqlite/sqlite-auto-indexer.d.ts +181 -0
- package/dist/cjs/dialect/sqlite/sqlite-auto-indexer.js +541 -0
- package/dist/cjs/dialect/sqlite/sqlite-auto-optimizer.d.ts +102 -0
- package/dist/cjs/dialect/sqlite/sqlite-auto-optimizer.js +373 -0
- package/dist/cjs/dialect/sqlite/sqlite-dialect-config.d.ts +41 -0
- package/dist/cjs/dialect/sqlite/sqlite-dialect-config.js +2 -0
- package/dist/cjs/dialect/sqlite/sqlite-dialect.d.ts +55 -0
- package/dist/cjs/dialect/sqlite/sqlite-dialect.js +51 -0
- package/dist/cjs/dialect/sqlite/sqlite-driver.d.ts +42 -0
- package/dist/cjs/dialect/sqlite/sqlite-driver.js +152 -0
- package/dist/cjs/dialect/sqlite/sqlite-introspector.d.ts +36 -0
- package/dist/cjs/dialect/sqlite/sqlite-introspector.js +236 -0
- package/dist/cjs/dialect/sqlite/sqlite-query-compiler.d.ts +16 -0
- package/dist/cjs/dialect/sqlite/sqlite-query-compiler.js +43 -0
- package/dist/cjs/driver/connection-provider.d.ts +8 -0
- package/dist/cjs/driver/connection-provider.js +2 -0
- package/dist/cjs/driver/database-connection.d.ts +35 -0
- package/dist/cjs/driver/database-connection.js +2 -0
- package/dist/cjs/driver/default-connection-provider.d.ts +12 -0
- package/dist/cjs/driver/default-connection-provider.js +19 -0
- package/dist/cjs/driver/driver.d.ts +61 -0
- package/dist/cjs/driver/driver.js +22 -0
- package/dist/cjs/driver/dummy-driver.d.ts +75 -0
- package/dist/cjs/driver/dummy-driver.js +83 -0
- package/dist/cjs/driver/runtime-driver.d.ts +47 -0
- package/dist/cjs/driver/runtime-driver.js +165 -0
- package/dist/cjs/driver/single-connection-provider.d.ts +11 -0
- package/dist/cjs/driver/single-connection-provider.js +29 -0
- package/dist/cjs/dynamic/dynamic-reference-builder.d.ts +18 -0
- package/dist/cjs/dynamic/dynamic-reference-builder.js +36 -0
- package/dist/cjs/dynamic/dynamic-table-builder.d.ts +16 -0
- package/dist/cjs/dynamic/dynamic-table-builder.js +46 -0
- package/dist/cjs/dynamic/dynamic.d.ts +124 -0
- package/dist/cjs/dynamic/dynamic.js +132 -0
- package/dist/cjs/errors/NoormError.d.ts +56 -0
- package/dist/cjs/errors/NoormError.js +158 -0
- package/dist/cjs/expression/expression-builder.d.ts +920 -0
- package/dist/cjs/expression/expression-builder.js +128 -0
- package/dist/cjs/expression/expression-wrapper.d.ts +631 -0
- package/dist/cjs/expression/expression-wrapper.js +134 -0
- package/dist/cjs/expression/expression.d.ts +198 -0
- package/dist/cjs/expression/expression.js +15 -0
- package/dist/cjs/helpers/sqlite.d.ts +189 -0
- package/dist/cjs/helpers/sqlite.js +204 -0
- package/dist/cjs/index.d.ts +211 -0
- package/dist/cjs/index.js +223 -0
- package/dist/cjs/kysely.d.ts +848 -0
- package/dist/cjs/kysely.js +924 -0
- package/dist/cjs/logging/logger.d.ts +96 -0
- package/dist/cjs/logging/logger.js +179 -0
- package/dist/cjs/noormme.d.ts +137 -0
- package/dist/cjs/noormme.js +521 -0
- package/dist/cjs/operation-node/add-column-node.d.ts +13 -0
- package/dist/cjs/operation-node/add-column-node.js +18 -0
- package/dist/cjs/operation-node/add-constraint-node.d.ts +13 -0
- package/dist/cjs/operation-node/add-constraint-node.js +18 -0
- package/dist/cjs/operation-node/add-index-node.d.ts +21 -0
- package/dist/cjs/operation-node/add-index-node.js +31 -0
- package/dist/cjs/operation-node/aggregate-function-node.d.ts +27 -0
- package/dist/cjs/operation-node/aggregate-function-node.js +58 -0
- package/dist/cjs/operation-node/alias-node.d.ts +13 -0
- package/dist/cjs/operation-node/alias-node.js +19 -0
- package/dist/cjs/operation-node/alter-column-node.d.ts +21 -0
- package/dist/cjs/operation-node/alter-column-node.js +20 -0
- package/dist/cjs/operation-node/alter-table-node.d.ts +36 -0
- package/dist/cjs/operation-node/alter-table-node.js +32 -0
- package/dist/cjs/operation-node/and-node.d.ts +13 -0
- package/dist/cjs/operation-node/and-node.js +19 -0
- package/dist/cjs/operation-node/binary-operation-node.d.ts +14 -0
- package/dist/cjs/operation-node/binary-operation-node.js +20 -0
- package/dist/cjs/operation-node/case-node.d.ts +19 -0
- package/dist/cjs/operation-node/case-node.js +42 -0
- package/dist/cjs/operation-node/cast-node.d.ts +13 -0
- package/dist/cjs/operation-node/cast-node.js +19 -0
- package/dist/cjs/operation-node/check-constraint-node.d.ts +14 -0
- package/dist/cjs/operation-node/check-constraint-node.js +20 -0
- package/dist/cjs/operation-node/collate-node.d.ts +13 -0
- package/dist/cjs/operation-node/collate-node.js +19 -0
- package/dist/cjs/operation-node/column-definition-node.d.ts +36 -0
- package/dist/cjs/operation-node/column-definition-node.js +42 -0
- package/dist/cjs/operation-node/column-node.d.ts +13 -0
- package/dist/cjs/operation-node/column-node.js +19 -0
- package/dist/cjs/operation-node/column-update-node.d.ts +13 -0
- package/dist/cjs/operation-node/column-update-node.js +19 -0
- package/dist/cjs/operation-node/common-table-expression-name-node.d.ts +15 -0
- package/dist/cjs/operation-node/common-table-expression-name-node.js +23 -0
- package/dist/cjs/operation-node/common-table-expression-node.d.ts +18 -0
- package/dist/cjs/operation-node/common-table-expression-node.js +25 -0
- package/dist/cjs/operation-node/constraint-node.d.ts +5 -0
- package/dist/cjs/operation-node/constraint-node.js +2 -0
- package/dist/cjs/operation-node/create-index-node.d.ts +27 -0
- package/dist/cjs/operation-node/create-index-node.js +31 -0
- package/dist/cjs/operation-node/create-schema-node.d.ts +16 -0
- package/dist/cjs/operation-node/create-schema-node.js +26 -0
- package/dist/cjs/operation-node/create-table-node.d.ts +32 -0
- package/dist/cjs/operation-node/create-table-node.js +56 -0
- package/dist/cjs/operation-node/create-type-node.d.ts +17 -0
- package/dist/cjs/operation-node/create-type-node.js +26 -0
- package/dist/cjs/operation-node/create-view-node.d.ts +24 -0
- package/dist/cjs/operation-node/create-view-node.js +25 -0
- package/dist/cjs/operation-node/data-type-node.d.ts +18 -0
- package/dist/cjs/operation-node/data-type-node.js +86 -0
- package/dist/cjs/operation-node/default-insert-value-node.d.ts +11 -0
- package/dist/cjs/operation-node/default-insert-value-node.js +17 -0
- package/dist/cjs/operation-node/default-value-node.d.ts +12 -0
- package/dist/cjs/operation-node/default-value-node.js +18 -0
- package/dist/cjs/operation-node/delete-query-node.d.ts +46 -0
- package/dist/cjs/operation-node/delete-query-node.js +52 -0
- package/dist/cjs/operation-node/drop-column-node.d.ts +13 -0
- package/dist/cjs/operation-node/drop-column-node.js +19 -0
- package/dist/cjs/operation-node/drop-constraint-node.d.ts +17 -0
- package/dist/cjs/operation-node/drop-constraint-node.js +25 -0
- package/dist/cjs/operation-node/drop-index-node.d.ts +19 -0
- package/dist/cjs/operation-node/drop-index-node.js +26 -0
- package/dist/cjs/operation-node/drop-schema-node.d.ts +17 -0
- package/dist/cjs/operation-node/drop-schema-node.js +26 -0
- package/dist/cjs/operation-node/drop-table-node.d.ts +17 -0
- package/dist/cjs/operation-node/drop-table-node.js +25 -0
- package/dist/cjs/operation-node/drop-type-node.d.ts +16 -0
- package/dist/cjs/operation-node/drop-type-node.js +24 -0
- package/dist/cjs/operation-node/drop-view-node.d.ts +18 -0
- package/dist/cjs/operation-node/drop-view-node.js +25 -0
- package/dist/cjs/operation-node/explain-node.d.ts +14 -0
- package/dist/cjs/operation-node/explain-node.js +19 -0
- package/dist/cjs/operation-node/fetch-node.d.ts +15 -0
- package/dist/cjs/operation-node/fetch-node.js +19 -0
- package/dist/cjs/operation-node/foreign-key-constraint-node.d.ts +33 -0
- package/dist/cjs/operation-node/foreign-key-constraint-node.js +28 -0
- package/dist/cjs/operation-node/from-node.d.ts +13 -0
- package/dist/cjs/operation-node/from-node.js +24 -0
- package/dist/cjs/operation-node/function-node.d.ts +13 -0
- package/dist/cjs/operation-node/function-node.js +19 -0
- package/dist/cjs/operation-node/generated-node.d.ts +19 -0
- package/dist/cjs/operation-node/generated-node.js +31 -0
- package/dist/cjs/operation-node/group-by-item-node.d.ts +12 -0
- package/dist/cjs/operation-node/group-by-item-node.js +18 -0
- package/dist/cjs/operation-node/group-by-node.d.ts +14 -0
- package/dist/cjs/operation-node/group-by-node.js +24 -0
- package/dist/cjs/operation-node/having-node.d.ts +13 -0
- package/dist/cjs/operation-node/having-node.js +28 -0
- package/dist/cjs/operation-node/identifier-node.d.ts +12 -0
- package/dist/cjs/operation-node/identifier-node.js +18 -0
- package/dist/cjs/operation-node/insert-query-node.d.ts +40 -0
- package/dist/cjs/operation-node/insert-query-node.js +31 -0
- package/dist/cjs/operation-node/join-node.d.ts +18 -0
- package/dist/cjs/operation-node/join-node.js +37 -0
- package/dist/cjs/operation-node/json-operator-chain-node.d.ts +16 -0
- package/dist/cjs/operation-node/json-operator-chain-node.js +25 -0
- package/dist/cjs/operation-node/json-path-leg-node.d.ts +14 -0
- package/dist/cjs/operation-node/json-path-leg-node.js +19 -0
- package/dist/cjs/operation-node/json-path-node.d.ts +16 -0
- package/dist/cjs/operation-node/json-path-node.js +25 -0
- package/dist/cjs/operation-node/json-reference-node.d.ts +17 -0
- package/dist/cjs/operation-node/json-reference-node.js +25 -0
- package/dist/cjs/operation-node/limit-node.d.ts +12 -0
- package/dist/cjs/operation-node/limit-node.js +18 -0
- package/dist/cjs/operation-node/list-node.d.ts +12 -0
- package/dist/cjs/operation-node/list-node.js +18 -0
- package/dist/cjs/operation-node/matched-node.d.ts +13 -0
- package/dist/cjs/operation-node/matched-node.js +19 -0
- package/dist/cjs/operation-node/merge-query-node.d.ts +30 -0
- package/dist/cjs/operation-node/merge-query-node.js +45 -0
- package/dist/cjs/operation-node/modify-column-node.d.ts +13 -0
- package/dist/cjs/operation-node/modify-column-node.js +18 -0
- package/dist/cjs/operation-node/offset-node.d.ts +12 -0
- package/dist/cjs/operation-node/offset-node.js +18 -0
- package/dist/cjs/operation-node/on-conflict-node.d.ts +30 -0
- package/dist/cjs/operation-node/on-conflict-node.js +68 -0
- package/dist/cjs/operation-node/on-duplicate-key-node.d.ts +14 -0
- package/dist/cjs/operation-node/on-duplicate-key-node.js +18 -0
- package/dist/cjs/operation-node/on-node.d.ts +13 -0
- package/dist/cjs/operation-node/on-node.js +28 -0
- package/dist/cjs/operation-node/operation-node-source.d.ts +5 -0
- package/dist/cjs/operation-node/operation-node-source.js +7 -0
- package/dist/cjs/operation-node/operation-node-transformer.d.ts +238 -0
- package/dist/cjs/operation-node/operation-node-transformer.js +929 -0
- package/dist/cjs/operation-node/operation-node-visitor.d.ts +201 -0
- package/dist/cjs/operation-node/operation-node-visitor.js +115 -0
- package/dist/cjs/operation-node/operation-node.d.ts +4 -0
- package/dist/cjs/operation-node/operation-node.js +2 -0
- package/dist/cjs/operation-node/operator-node.d.ts +32 -0
- package/dist/cjs/operation-node/operator-node.js +107 -0
- package/dist/cjs/operation-node/or-action-node.d.ts +12 -0
- package/dist/cjs/operation-node/or-action-node.js +18 -0
- package/dist/cjs/operation-node/or-node.d.ts +13 -0
- package/dist/cjs/operation-node/or-node.js +19 -0
- package/dist/cjs/operation-node/order-by-item-node.d.ts +18 -0
- package/dist/cjs/operation-node/order-by-item-node.js +25 -0
- package/dist/cjs/operation-node/order-by-node.d.ts +14 -0
- package/dist/cjs/operation-node/order-by-node.js +24 -0
- package/dist/cjs/operation-node/output-node.d.ts +13 -0
- package/dist/cjs/operation-node/output-node.js +26 -0
- package/dist/cjs/operation-node/over-node.d.ts +19 -0
- package/dist/cjs/operation-node/over-node.js +35 -0
- package/dist/cjs/operation-node/parens-node.d.ts +12 -0
- package/dist/cjs/operation-node/parens-node.js +18 -0
- package/dist/cjs/operation-node/partition-by-item-node.d.ts +13 -0
- package/dist/cjs/operation-node/partition-by-item-node.js +18 -0
- package/dist/cjs/operation-node/partition-by-node.d.ts +14 -0
- package/dist/cjs/operation-node/partition-by-node.js +24 -0
- package/dist/cjs/operation-node/primary-key-constraint-node.d.ts +29 -0
- package/dist/cjs/operation-node/primary-key-constraint-node.js +30 -0
- package/dist/cjs/operation-node/primitive-value-list-node.d.ts +17 -0
- package/dist/cjs/operation-node/primitive-value-list-node.js +18 -0
- package/dist/cjs/operation-node/query-node.d.ts +60 -0
- package/dist/cjs/operation-node/query-node.js +102 -0
- package/dist/cjs/operation-node/raw-node.d.ts +16 -0
- package/dist/cjs/operation-node/raw-node.js +28 -0
- package/dist/cjs/operation-node/reference-node.d.ts +17 -0
- package/dist/cjs/operation-node/reference-node.js +27 -0
- package/dist/cjs/operation-node/references-node.d.ts +22 -0
- package/dist/cjs/operation-node/references-node.js +38 -0
- package/dist/cjs/operation-node/refresh-materialized-view-node.d.ts +17 -0
- package/dist/cjs/operation-node/refresh-materialized-view-node.js +25 -0
- package/dist/cjs/operation-node/rename-column-node.d.ts +14 -0
- package/dist/cjs/operation-node/rename-column-node.js +20 -0
- package/dist/cjs/operation-node/rename-constraint-node.d.ts +14 -0
- package/dist/cjs/operation-node/rename-constraint-node.js +20 -0
- package/dist/cjs/operation-node/returning-node.d.ts +14 -0
- package/dist/cjs/operation-node/returning-node.js +26 -0
- package/dist/cjs/operation-node/schemable-identifier-node.d.ts +15 -0
- package/dist/cjs/operation-node/schemable-identifier-node.js +26 -0
- package/dist/cjs/operation-node/select-all-node.d.ts +11 -0
- package/dist/cjs/operation-node/select-all-node.js +17 -0
- package/dist/cjs/operation-node/select-modifier-node.d.ts +16 -0
- package/dist/cjs/operation-node/select-modifier-node.js +25 -0
- package/dist/cjs/operation-node/select-query-node.d.ts +67 -0
- package/dist/cjs/operation-node/select-query-node.js +129 -0
- package/dist/cjs/operation-node/selection-node.d.ts +20 -0
- package/dist/cjs/operation-node/selection-node.js +32 -0
- package/dist/cjs/operation-node/set-operation-node.d.ts +15 -0
- package/dist/cjs/operation-node/set-operation-node.js +20 -0
- package/dist/cjs/operation-node/simple-reference-expression-node.d.ts +3 -0
- package/dist/cjs/operation-node/simple-reference-expression-node.js +2 -0
- package/dist/cjs/operation-node/table-node.d.ts +14 -0
- package/dist/cjs/operation-node/table-node.js +25 -0
- package/dist/cjs/operation-node/top-node.d.ts +14 -0
- package/dist/cjs/operation-node/top-node.js +19 -0
- package/dist/cjs/operation-node/tuple-node.d.ts +12 -0
- package/dist/cjs/operation-node/tuple-node.js +18 -0
- package/dist/cjs/operation-node/unary-operation-node.d.ts +13 -0
- package/dist/cjs/operation-node/unary-operation-node.js +19 -0
- package/dist/cjs/operation-node/unique-constraint-node.d.ts +20 -0
- package/dist/cjs/operation-node/unique-constraint-node.js +28 -0
- package/dist/cjs/operation-node/update-query-node.d.ts +39 -0
- package/dist/cjs/operation-node/update-query-node.js +50 -0
- package/dist/cjs/operation-node/using-node.d.ts +13 -0
- package/dist/cjs/operation-node/using-node.js +24 -0
- package/dist/cjs/operation-node/value-list-node.d.ts +12 -0
- package/dist/cjs/operation-node/value-list-node.js +18 -0
- package/dist/cjs/operation-node/value-node.d.ts +14 -0
- package/dist/cjs/operation-node/value-node.js +25 -0
- package/dist/cjs/operation-node/values-node.d.ts +15 -0
- package/dist/cjs/operation-node/values-node.js +18 -0
- package/dist/cjs/operation-node/when-node.d.ts +14 -0
- package/dist/cjs/operation-node/when-node.js +24 -0
- package/dist/cjs/operation-node/where-node.d.ts +13 -0
- package/dist/cjs/operation-node/where-node.js +28 -0
- package/dist/cjs/operation-node/with-node.d.ts +16 -0
- package/dist/cjs/operation-node/with-node.js +25 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/parser/binary-operation-parser.d.ts +21 -0
- package/dist/cjs/parser/binary-operation-parser.js +74 -0
- package/dist/cjs/parser/coalesce-parser.d.ts +12 -0
- package/dist/cjs/parser/coalesce-parser.js +2 -0
- package/dist/cjs/parser/collate-parser.d.ts +1 -0
- package/dist/cjs/parser/collate-parser.js +2 -0
- package/dist/cjs/parser/data-type-parser.d.ts +5 -0
- package/dist/cjs/parser/data-type-parser.js +14 -0
- package/dist/cjs/parser/default-value-parser.d.ts +4 -0
- package/dist/cjs/parser/default-value-parser.js +10 -0
- package/dist/cjs/parser/delete-from-parser.d.ts +9 -0
- package/dist/cjs/parser/delete-from-parser.js +2 -0
- package/dist/cjs/parser/expression-parser.d.ts +20 -0
- package/dist/cjs/parser/expression-parser.js +30 -0
- package/dist/cjs/parser/fetch-parser.d.ts +2 -0
- package/dist/cjs/parser/fetch-parser.js +17 -0
- package/dist/cjs/parser/group-by-parser.d.ts +6 -0
- package/dist/cjs/parser/group-by-parser.js +11 -0
- package/dist/cjs/parser/identifier-parser.d.ts +2 -0
- package/dist/cjs/parser/identifier-parser.js +22 -0
- package/dist/cjs/parser/insert-values-parser.d.ts +14 -0
- package/dist/cjs/parser/insert-values-parser.js +64 -0
- package/dist/cjs/parser/join-parser.d.ts +10 -0
- package/dist/cjs/parser/join-parser.js +30 -0
- package/dist/cjs/parser/merge-into-parser.d.ts +7 -0
- package/dist/cjs/parser/merge-into-parser.js +2 -0
- package/dist/cjs/parser/merge-parser.d.ts +9 -0
- package/dist/cjs/parser/merge-parser.js +31 -0
- package/dist/cjs/parser/on-commit-action-parse.d.ts +2 -0
- package/dist/cjs/parser/on-commit-action-parse.js +10 -0
- package/dist/cjs/parser/on-modify-action-parser.d.ts +2 -0
- package/dist/cjs/parser/on-modify-action-parser.js +10 -0
- package/dist/cjs/parser/order-by-parser.d.ts +25 -0
- package/dist/cjs/parser/order-by-parser.js +71 -0
- package/dist/cjs/parser/parse-utils.d.ts +10 -0
- package/dist/cjs/parser/parse-utils.js +38 -0
- package/dist/cjs/parser/partition-by-parser.d.ts +6 -0
- package/dist/cjs/parser/partition-by-parser.js +8 -0
- package/dist/cjs/parser/reference-parser.d.ts +31 -0
- package/dist/cjs/parser/reference-parser.js +104 -0
- package/dist/cjs/parser/returning-parser.d.ts +8 -0
- package/dist/cjs/parser/returning-parser.js +2 -0
- package/dist/cjs/parser/savepoint-parser.d.ts +4 -0
- package/dist/cjs/parser/savepoint-parser.js +11 -0
- package/dist/cjs/parser/select-from-parser.d.ts +6 -0
- package/dist/cjs/parser/select-from-parser.js +2 -0
- package/dist/cjs/parser/select-parser.d.ts +36 -0
- package/dist/cjs/parser/select-parser.js +50 -0
- package/dist/cjs/parser/set-operation-parser.d.ts +5 -0
- package/dist/cjs/parser/set-operation-parser.js +16 -0
- package/dist/cjs/parser/table-parser.d.ts +24 -0
- package/dist/cjs/parser/table-parser.js +54 -0
- package/dist/cjs/parser/top-parser.d.ts +2 -0
- package/dist/cjs/parser/top-parser.js +19 -0
- package/dist/cjs/parser/tuple-parser.d.ts +47 -0
- package/dist/cjs/parser/tuple-parser.js +2 -0
- package/dist/cjs/parser/unary-operation-parser.d.ts +8 -0
- package/dist/cjs/parser/unary-operation-parser.js +17 -0
- package/dist/cjs/parser/update-parser.d.ts +9 -0
- package/dist/cjs/parser/update-parser.js +2 -0
- package/dist/cjs/parser/update-set-parser.d.ts +16 -0
- package/dist/cjs/parser/update-set-parser.js +26 -0
- package/dist/cjs/parser/value-parser.d.ts +13 -0
- package/dist/cjs/parser/value-parser.js +38 -0
- package/dist/cjs/parser/with-parser.d.ts +45 -0
- package/dist/cjs/parser/with-parser.js +33 -0
- package/dist/cjs/performance/query-analyzer.d.ts +89 -0
- package/dist/cjs/performance/query-analyzer.js +263 -0
- package/dist/cjs/plugin/camel-case/camel-case-plugin.d.ts +170 -0
- package/dist/cjs/plugin/camel-case/camel-case-plugin.js +122 -0
- package/dist/cjs/plugin/camel-case/camel-case-transformer.d.ts +9 -0
- package/dist/cjs/plugin/camel-case/camel-case-transformer.js +19 -0
- package/dist/cjs/plugin/camel-case/camel-case.d.ts +15 -0
- package/dist/cjs/plugin/camel-case/camel-case.js +111 -0
- package/dist/cjs/plugin/deduplicate-joins/deduplicate-joins-plugin.d.ts +70 -0
- package/dist/cjs/plugin/deduplicate-joins/deduplicate-joins-plugin.js +19 -0
- package/dist/cjs/plugin/deduplicate-joins/deduplicate-joins-transformer.d.ts +11 -0
- package/dist/cjs/plugin/deduplicate-joins/deduplicate-joins-transformer.js +42 -0
- package/dist/cjs/plugin/handle-empty-in-lists/handle-empty-in-lists-plugin.d.ts +211 -0
- package/dist/cjs/plugin/handle-empty-in-lists/handle-empty-in-lists-plugin.js +162 -0
- package/dist/cjs/plugin/handle-empty-in-lists/handle-empty-in-lists-transformer.d.ts +8 -0
- package/dist/cjs/plugin/handle-empty-in-lists/handle-empty-in-lists-transformer.js +29 -0
- package/dist/cjs/plugin/handle-empty-in-lists/handle-empty-in-lists.d.ts +44 -0
- package/dist/cjs/plugin/handle-empty-in-lists/handle-empty-in-lists.js +66 -0
- package/dist/cjs/plugin/immediate-value/immediate-value-plugin.d.ts +73 -0
- package/dist/cjs/plugin/immediate-value/immediate-value-plugin.js +22 -0
- package/dist/cjs/plugin/immediate-value/immediate-value-transformer.d.ts +15 -0
- package/dist/cjs/plugin/immediate-value/immediate-value-transformer.js +23 -0
- package/dist/cjs/plugin/kysely-plugin.d.ts +72 -0
- package/dist/cjs/plugin/kysely-plugin.js +2 -0
- package/dist/cjs/plugin/noop-plugin.d.ts +64 -0
- package/dist/cjs/plugin/noop-plugin.js +12 -0
- package/dist/cjs/plugin/parse-json-results/parse-json-results-plugin.d.ts +126 -0
- package/dist/cjs/plugin/parse-json-results/parse-json-results-plugin.js +107 -0
- package/dist/cjs/plugin/with-schema/with-schema-plugin.d.ts +66 -0
- package/dist/cjs/plugin/with-schema/with-schema-plugin.js +17 -0
- package/dist/cjs/plugin/with-schema/with-schema-transformer.d.ts +16 -0
- package/dist/cjs/plugin/with-schema/with-schema-transformer.js +181 -0
- package/dist/cjs/query-builder/aggregate-function-builder.d.ts +379 -0
- package/dist/cjs/query-builder/aggregate-function-builder.js +242 -0
- package/dist/cjs/query-builder/case-builder.d.ts +112 -0
- package/dist/cjs/query-builder/case-builder.js +79 -0
- package/dist/cjs/query-builder/cte-builder.d.ts +20 -0
- package/dist/cjs/query-builder/cte-builder.js +37 -0
- package/dist/cjs/query-builder/delete-query-builder.d.ts +1348 -0
- package/dist/cjs/query-builder/delete-query-builder.js +504 -0
- package/dist/cjs/query-builder/delete-result.d.ts +4 -0
- package/dist/cjs/query-builder/delete-result.js +10 -0
- package/dist/cjs/query-builder/function-module.d.ts +592 -0
- package/dist/cjs/query-builder/function-module.js +62 -0
- package/dist/cjs/query-builder/having-interface.d.ts +15 -0
- package/dist/cjs/query-builder/having-interface.js +2 -0
- package/dist/cjs/query-builder/insert-query-builder.d.ts +1235 -0
- package/dist/cjs/query-builder/insert-query-builder.js +1160 -0
- package/dist/cjs/query-builder/insert-result.d.ts +46 -0
- package/dist/cjs/query-builder/insert-result.js +53 -0
- package/dist/cjs/query-builder/join-builder.d.ts +38 -0
- package/dist/cjs/query-builder/join-builder.js +51 -0
- package/dist/cjs/query-builder/json-path-builder.d.ts +294 -0
- package/dist/cjs/query-builder/json-path-builder.js +200 -0
- package/dist/cjs/query-builder/merge-query-builder.d.ts +1001 -0
- package/dist/cjs/query-builder/merge-query-builder.js +630 -0
- package/dist/cjs/query-builder/merge-result.d.ts +4 -0
- package/dist/cjs/query-builder/merge-result.js +10 -0
- package/dist/cjs/query-builder/no-result-error.d.ts +10 -0
- package/dist/cjs/query-builder/no-result-error.js +18 -0
- package/dist/cjs/query-builder/on-conflict-builder.d.ts +872 -0
- package/dist/cjs/query-builder/on-conflict-builder.js +259 -0
- package/dist/cjs/query-builder/order-by-interface.d.ts +158 -0
- package/dist/cjs/query-builder/order-by-interface.js +2 -0
- package/dist/cjs/query-builder/order-by-item-builder.d.ts +43 -0
- package/dist/cjs/query-builder/order-by-item-builder.js +75 -0
- package/dist/cjs/query-builder/output-interface.d.ts +138 -0
- package/dist/cjs/query-builder/output-interface.js +2 -0
- package/dist/cjs/query-builder/over-builder.d.ts +101 -0
- package/dist/cjs/query-builder/over-builder.js +40 -0
- package/dist/cjs/query-builder/returning-interface.d.ts +91 -0
- package/dist/cjs/query-builder/returning-interface.js +2 -0
- package/dist/cjs/query-builder/select-query-builder-expression.d.ts +28 -0
- package/dist/cjs/query-builder/select-query-builder-expression.js +2 -0
- package/dist/cjs/query-builder/select-query-builder.d.ts +2391 -0
- package/dist/cjs/query-builder/select-query-builder.js +376 -0
- package/dist/cjs/query-builder/update-query-builder.d.ts +1392 -0
- package/dist/cjs/query-builder/update-query-builder.js +513 -0
- package/dist/cjs/query-builder/update-result.d.ts +14 -0
- package/dist/cjs/query-builder/update-result.js +21 -0
- package/dist/cjs/query-builder/where-interface.d.ts +382 -0
- package/dist/cjs/query-builder/where-interface.js +2 -0
- package/dist/cjs/query-compiler/compiled-query.d.ts +11 -0
- package/dist/cjs/query-compiler/compiled-query.js +16 -0
- package/dist/cjs/query-compiler/default-query-compiler.d.ts +235 -0
- package/dist/cjs/query-compiler/default-query-compiler.js +1390 -0
- package/dist/cjs/query-compiler/query-compiler.d.ts +24 -0
- package/dist/cjs/query-compiler/query-compiler.js +2 -0
- package/dist/cjs/query-creator.d.ts +592 -0
- package/dist/cjs/query-creator.js +622 -0
- package/dist/cjs/query-executor/default-query-executor.d.ts +50 -0
- package/dist/cjs/query-executor/default-query-executor.js +40 -0
- package/dist/cjs/query-executor/noop-query-executor.d.ts +50 -0
- package/dist/cjs/query-executor/noop-query-executor.js +37 -0
- package/dist/cjs/query-executor/query-executor-base.d.ts +68 -0
- package/dist/cjs/query-executor/query-executor-base.js +62 -0
- package/dist/cjs/query-executor/query-executor-provider.d.ts +8 -0
- package/dist/cjs/query-executor/query-executor-provider.js +2 -0
- package/dist/cjs/query-executor/query-executor.d.ts +74 -0
- package/dist/cjs/query-executor/query-executor.js +2 -0
- package/dist/cjs/raw-builder/raw-builder.d.ts +218 -0
- package/dist/cjs/raw-builder/raw-builder.js +86 -0
- package/dist/cjs/raw-builder/sql.d.ts +366 -0
- package/dist/cjs/raw-builder/sql.js +84 -0
- package/dist/cjs/relationships/relationship-engine.d.ts +59 -0
- package/dist/cjs/relationships/relationship-engine.js +206 -0
- package/dist/cjs/repository/repository-factory.d.ts +54 -0
- package/dist/cjs/repository/repository-factory.js +449 -0
- package/dist/cjs/schema/builders/alter-column-builder.d.ts +53 -0
- package/dist/cjs/schema/builders/alter-column-builder.js +74 -0
- package/dist/cjs/schema/builders/alter-table-add-foreign-key-constraint-builder.d.ts +32 -0
- package/dist/cjs/schema/builders/alter-table-add-foreign-key-constraint-builder.js +67 -0
- package/dist/cjs/schema/builders/alter-table-add-index-builder.d.ts +138 -0
- package/dist/cjs/schema/builders/alter-table-add-index-builder.js +165 -0
- package/dist/cjs/schema/builders/alter-table-builder.d.ts +148 -0
- package/dist/cjs/schema/builders/alter-table-builder.js +267 -0
- package/dist/cjs/schema/builders/alter-table-drop-constraint-builder.d.ts +26 -0
- package/dist/cjs/schema/builders/alter-table-drop-constraint-builder.js +59 -0
- package/dist/cjs/schema/builders/alter-table-executor.d.ts +18 -0
- package/dist/cjs/schema/builders/alter-table-executor.js +20 -0
- package/dist/cjs/schema/builders/check-constraint-builder.d.ts +13 -0
- package/dist/cjs/schema/builders/check-constraint-builder.js +20 -0
- package/dist/cjs/schema/builders/column-definition-builder.d.ts +514 -0
- package/dist/cjs/schema/builders/column-definition-builder.js +600 -0
- package/dist/cjs/schema/builders/create-index-builder.d.ts +173 -0
- package/dist/cjs/schema/builders/create-index-builder.js +202 -0
- package/dist/cjs/schema/builders/create-schema-builder.d.ts +24 -0
- package/dist/cjs/schema/builders/create-schema-builder.js +34 -0
- package/dist/cjs/schema/builders/create-table-builder.d.ts +331 -0
- package/dist/cjs/schema/builders/create-table-builder.js +411 -0
- package/dist/cjs/schema/builders/create-type-builder.d.ts +33 -0
- package/dist/cjs/schema/builders/create-type-builder.js +43 -0
- package/dist/cjs/schema/builders/create-view-builder.d.ts +48 -0
- package/dist/cjs/schema/builders/create-view-builder.js +98 -0
- package/dist/cjs/schema/builders/drop-index-builder.d.ts +30 -0
- package/dist/cjs/schema/builders/drop-index-builder.js +57 -0
- package/dist/cjs/schema/builders/drop-schema-builder.d.ts +25 -0
- package/dist/cjs/schema/builders/drop-schema-builder.js +44 -0
- package/dist/cjs/schema/builders/drop-table-builder.d.ts +25 -0
- package/dist/cjs/schema/builders/drop-table-builder.js +44 -0
- package/dist/cjs/schema/builders/drop-type-builder.d.ts +24 -0
- package/dist/cjs/schema/builders/drop-type-builder.js +36 -0
- package/dist/cjs/schema/builders/drop-view-builder.d.ts +26 -0
- package/dist/cjs/schema/builders/drop-view-builder.js +52 -0
- package/dist/cjs/schema/builders/foreign-key-constraint-builder.d.ts +28 -0
- package/dist/cjs/schema/builders/foreign-key-constraint-builder.js +48 -0
- package/dist/cjs/schema/builders/index.d.ts +22 -0
- package/dist/cjs/schema/builders/index.js +39 -0
- package/dist/cjs/schema/builders/primary-key-constraint-builder.d.ts +17 -0
- package/dist/cjs/schema/builders/primary-key-constraint-builder.js +37 -0
- package/dist/cjs/schema/builders/refresh-materialized-view-builder.d.ts +47 -0
- package/dist/cjs/schema/builders/refresh-materialized-view-builder.js +75 -0
- package/dist/cjs/schema/builders/unique-constraint-builder.d.ts +23 -0
- package/dist/cjs/schema/builders/unique-constraint-builder.js +45 -0
- package/dist/cjs/schema/core/coordinators/schema-discovery.coordinator.d.ts +35 -0
- package/dist/cjs/schema/core/coordinators/schema-discovery.coordinator.js +63 -0
- package/dist/cjs/schema/core/discovery/relationship-discovery.d.ts +36 -0
- package/dist/cjs/schema/core/discovery/relationship-discovery.js +162 -0
- package/dist/cjs/schema/core/discovery/table-metadata-discovery.d.ts +29 -0
- package/dist/cjs/schema/core/discovery/table-metadata-discovery.js +126 -0
- package/dist/cjs/schema/core/discovery/view-discovery.d.ts +36 -0
- package/dist/cjs/schema/core/discovery/view-discovery.js +137 -0
- package/dist/cjs/schema/core/factories/discovery-factory.d.ts +66 -0
- package/dist/cjs/schema/core/factories/discovery-factory.js +122 -0
- package/dist/cjs/schema/core/types/schema-discovery-types.d.ts +43 -0
- package/dist/cjs/schema/core/types/schema-discovery-types.js +3 -0
- package/dist/cjs/schema/core/utils/name-generator.d.ts +21 -0
- package/dist/cjs/schema/core/utils/name-generator.js +55 -0
- package/dist/cjs/schema/core/utils/type-mapper.d.ts +25 -0
- package/dist/cjs/schema/core/utils/type-mapper.js +61 -0
- package/dist/cjs/schema/dialects/sqlite/discovery/sqlite-constraint-discovery.d.ts +97 -0
- package/dist/cjs/schema/dialects/sqlite/discovery/sqlite-constraint-discovery.js +533 -0
- package/dist/cjs/schema/dialects/sqlite/discovery/sqlite-index-discovery.d.ts +32 -0
- package/dist/cjs/schema/dialects/sqlite/discovery/sqlite-index-discovery.js +133 -0
- package/dist/cjs/schema/dialects/sqlite/introspection/sqlite-schema-introspector.d.ts +31 -0
- package/dist/cjs/schema/dialects/sqlite/introspection/sqlite-schema-introspector.js +192 -0
- package/dist/cjs/schema/dialects/sqlite/sqlite-discovery.coordinator.d.ts +51 -0
- package/dist/cjs/schema/dialects/sqlite/sqlite-discovery.coordinator.js +180 -0
- package/dist/cjs/schema/index.d.ts +14 -0
- package/dist/cjs/schema/index.js +49 -0
- package/dist/cjs/schema/schema-discovery.d.ts +23 -0
- package/dist/cjs/schema/schema-discovery.js +33 -0
- package/dist/cjs/schema/schema.d.ts +230 -0
- package/dist/cjs/schema/schema.js +328 -0
- package/dist/cjs/schema/test/basic-schema-test.d.ts +8 -0
- package/dist/cjs/schema/test/basic-schema-test.js +184 -0
- package/dist/cjs/schema/test/dialect-capabilities.test.d.ts +1 -0
- package/dist/cjs/schema/test/dialect-capabilities.test.js +153 -0
- package/dist/cjs/schema/test/discovery-factory.test.d.ts +1 -0
- package/dist/cjs/schema/test/discovery-factory.test.js +151 -0
- package/dist/cjs/schema/test/error-handling.test.d.ts +1 -0
- package/dist/cjs/schema/test/error-handling.test.js +149 -0
- package/dist/cjs/schema/test/integration.test.d.ts +1 -0
- package/dist/cjs/schema/test/integration.test.js +135 -0
- package/dist/cjs/schema/test/schema-discovery-coordinator.test.d.ts +1 -0
- package/dist/cjs/schema/test/schema-discovery-coordinator.test.js +139 -0
- package/dist/cjs/schema/test/simple-schema-test.d.ts +5 -0
- package/dist/cjs/schema/test/simple-schema-test.js +77 -0
- package/dist/cjs/schema/test/sqlite-discovery-coordinator.test.d.ts +1 -0
- package/dist/cjs/schema/test/sqlite-discovery-coordinator.test.js +377 -0
- package/dist/cjs/schema/test/test-runner.d.ts +66 -0
- package/dist/cjs/schema/test/test-runner.js +90 -0
- package/dist/cjs/sqlite-migration/index.d.ts +6 -0
- package/dist/cjs/sqlite-migration/index.js +20 -0
- package/dist/cjs/sqlite-migration/sqlite-migration-manager.d.ts +104 -0
- package/dist/cjs/sqlite-migration/sqlite-migration-manager.js +335 -0
- package/dist/cjs/sqlite-migration/sqlite-migration-provider.d.ts +77 -0
- package/dist/cjs/sqlite-migration/sqlite-migration-provider.js +342 -0
- package/dist/cjs/testing/test-utils.d.ts +110 -0
- package/dist/cjs/testing/test-utils.js +328 -0
- package/dist/cjs/types/index.d.ts +155 -0
- package/dist/cjs/types/index.js +5 -0
- package/dist/cjs/types/type-generator.d.ts +52 -0
- package/dist/cjs/types/type-generator.js +261 -0
- package/dist/cjs/util/assert.d.ts +2 -0
- package/dist/cjs/util/assert.js +14 -0
- package/dist/cjs/util/column-type.d.ts +175 -0
- package/dist/cjs/util/column-type.js +2 -0
- package/dist/cjs/util/compilable.d.ts +5 -0
- package/dist/cjs/util/compilable.js +7 -0
- package/dist/cjs/util/deferred.d.ts +7 -0
- package/dist/cjs/util/deferred.js +28 -0
- package/dist/cjs/util/explainable.d.ts +40 -0
- package/dist/cjs/util/explainable.js +2 -0
- package/dist/cjs/util/infer-result.d.ts +48 -0
- package/dist/cjs/util/infer-result.js +2 -0
- package/dist/cjs/util/json-object-args.d.ts +3 -0
- package/dist/cjs/util/json-object-args.js +34 -0
- package/dist/cjs/util/log-once.d.ts +5 -0
- package/dist/cjs/util/log-once.js +15 -0
- package/dist/cjs/util/log.d.ts +26 -0
- package/dist/cjs/util/log.js +58 -0
- package/dist/cjs/util/object-utils.d.ts +23 -0
- package/dist/cjs/util/object-utils.js +162 -0
- package/dist/cjs/util/performance-now.d.ts +1 -0
- package/dist/cjs/util/performance-now.js +12 -0
- package/dist/cjs/util/provide-controlled-connection.d.ts +7 -0
- package/dist/cjs/util/provide-controlled-connection.js +24 -0
- package/dist/cjs/util/query-id.d.ts +4 -0
- package/dist/cjs/util/query-id.js +16 -0
- package/dist/cjs/util/random-string.d.ts +1 -0
- package/dist/cjs/util/random-string.js +77 -0
- package/dist/cjs/util/require-all-props.d.ts +45 -0
- package/dist/cjs/util/require-all-props.js +41 -0
- package/dist/cjs/util/stack-trace-utils.d.ts +1 -0
- package/dist/cjs/util/stack-trace-utils.js +16 -0
- package/dist/cjs/util/streamable.d.ts +29 -0
- package/dist/cjs/util/streamable.js +2 -0
- package/dist/cjs/util/type-error.d.ts +3 -0
- package/dist/cjs/util/type-error.js +2 -0
- package/dist/cjs/util/type-utils.d.ts +189 -0
- package/dist/cjs/util/type-utils.js +2 -0
- package/dist/cjs/utils/errorHelpers.d.ts +26 -0
- package/dist/cjs/utils/errorHelpers.js +186 -0
- package/dist/cjs/watch/schema-watcher.d.ts +68 -0
- package/dist/cjs/watch/schema-watcher.js +186 -0
- package/dist/esm/cache/cache-manager.d.ts +76 -0
- package/dist/esm/cache/cache-manager.js +166 -0
- package/dist/esm/cli/commands/analyze.d.ts +7 -0
- package/dist/esm/cli/commands/analyze.js +130 -0
- package/dist/esm/cli/commands/generate.d.ts +7 -0
- package/dist/esm/cli/commands/generate.js +512 -0
- package/dist/esm/cli/commands/init.d.ts +7 -0
- package/dist/esm/cli/commands/init.js +468 -0
- package/dist/esm/cli/commands/inspect.d.ts +7 -0
- package/dist/esm/cli/commands/inspect.js +363 -0
- package/dist/esm/cli/commands/migrate.d.ts +8 -0
- package/dist/esm/cli/commands/migrate.js +216 -0
- package/dist/esm/cli/commands/optimize.d.ts +8 -0
- package/dist/esm/cli/commands/optimize.js +154 -0
- package/dist/esm/cli/commands/status.d.ts +6 -0
- package/dist/esm/cli/commands/status.js +265 -0
- package/dist/esm/cli/commands/watch.d.ts +7 -0
- package/dist/esm/cli/commands/watch.js +214 -0
- package/dist/esm/cli/index.d.ts +2 -0
- package/dist/esm/cli/index.js +156 -0
- package/dist/esm/dialect/database-introspector.d.ts +61 -0
- package/dist/esm/dialect/database-introspector.js +82 -0
- package/dist/esm/dialect/dialect-adapter-base.d.ts +94 -0
- package/dist/esm/dialect/dialect-adapter-base.js +21 -0
- package/dist/esm/dialect/dialect-adapter.d.ts +115 -0
- package/dist/esm/dialect/dialect-adapter.js +2 -0
- package/dist/esm/dialect/dialect.d.ts +34 -0
- package/dist/esm/dialect/dialect.js +2 -0
- package/dist/esm/dialect/sqlite/sqlite-adapter.d.ts +80 -0
- package/dist/esm/dialect/sqlite/sqlite-adapter.js +20 -0
- package/dist/esm/dialect/sqlite/sqlite-auto-indexer.d.ts +181 -0
- package/dist/esm/dialect/sqlite/sqlite-auto-indexer.js +538 -0
- package/dist/esm/dialect/sqlite/sqlite-auto-optimizer.d.ts +102 -0
- package/dist/esm/dialect/sqlite/sqlite-auto-optimizer.js +370 -0
- package/dist/esm/dialect/sqlite/sqlite-dialect-config.d.ts +41 -0
- package/dist/esm/dialect/sqlite/sqlite-dialect-config.js +2 -0
- package/dist/esm/dialect/sqlite/sqlite-dialect.d.ts +55 -0
- package/dist/esm/dialect/sqlite/sqlite-dialect.js +48 -0
- package/dist/esm/dialect/sqlite/sqlite-driver.d.ts +42 -0
- package/dist/esm/dialect/sqlite/sqlite-driver.js +149 -0
- package/dist/esm/dialect/sqlite/sqlite-introspector.d.ts +36 -0
- package/dist/esm/dialect/sqlite/sqlite-introspector.js +233 -0
- package/dist/esm/dialect/sqlite/sqlite-query-compiler.d.ts +16 -0
- package/dist/esm/dialect/sqlite/sqlite-query-compiler.js +40 -0
- package/dist/esm/driver/connection-provider.d.ts +8 -0
- package/dist/esm/driver/connection-provider.js +2 -0
- package/dist/esm/driver/database-connection.d.ts +35 -0
- package/dist/esm/driver/database-connection.js +2 -0
- package/dist/esm/driver/default-connection-provider.d.ts +12 -0
- package/dist/esm/driver/default-connection-provider.js +16 -0
- package/dist/esm/driver/driver.d.ts +61 -0
- package/dist/esm/driver/driver.js +19 -0
- package/dist/esm/driver/dummy-driver.d.ts +75 -0
- package/dist/esm/driver/dummy-driver.js +80 -0
- package/dist/esm/driver/runtime-driver.d.ts +47 -0
- package/dist/esm/driver/runtime-driver.js +162 -0
- package/dist/esm/driver/single-connection-provider.d.ts +11 -0
- package/dist/esm/driver/single-connection-provider.js +26 -0
- package/dist/esm/dynamic/dynamic-reference-builder.d.ts +18 -0
- package/dist/esm/dynamic/dynamic-reference-builder.js +32 -0
- package/dist/esm/dynamic/dynamic-table-builder.d.ts +16 -0
- package/dist/esm/dynamic/dynamic-table-builder.js +41 -0
- package/dist/esm/dynamic/dynamic.d.ts +124 -0
- package/dist/esm/dynamic/dynamic.js +129 -0
- package/dist/esm/errors/NoormError.d.ts +56 -0
- package/dist/esm/errors/NoormError.js +150 -0
- package/dist/esm/expression/expression-builder.d.ts +920 -0
- package/dist/esm/expression/expression-builder.js +125 -0
- package/dist/esm/expression/expression-wrapper.d.ts +631 -0
- package/dist/esm/expression/expression-wrapper.js +128 -0
- package/dist/esm/expression/expression.d.ts +198 -0
- package/dist/esm/expression/expression.js +12 -0
- package/dist/esm/helpers/sqlite.d.ts +189 -0
- package/dist/esm/helpers/sqlite.js +200 -0
- package/dist/esm/index.d.ts +211 -0
- package/dist/esm/index.js +203 -0
- package/dist/esm/kysely.d.ts +848 -0
- package/dist/esm/kysely.js +914 -0
- package/dist/esm/logging/logger.d.ts +96 -0
- package/dist/esm/logging/logger.js +176 -0
- package/dist/esm/noormme.d.ts +137 -0
- package/dist/esm/noormme.js +518 -0
- package/dist/esm/operation-node/add-column-node.d.ts +13 -0
- package/dist/esm/operation-node/add-column-node.js +16 -0
- package/dist/esm/operation-node/add-constraint-node.d.ts +13 -0
- package/dist/esm/operation-node/add-constraint-node.js +16 -0
- package/dist/esm/operation-node/add-index-node.d.ts +21 -0
- package/dist/esm/operation-node/add-index-node.js +29 -0
- package/dist/esm/operation-node/aggregate-function-node.d.ts +27 -0
- package/dist/esm/operation-node/aggregate-function-node.js +56 -0
- package/dist/esm/operation-node/alias-node.d.ts +13 -0
- package/dist/esm/operation-node/alias-node.js +17 -0
- package/dist/esm/operation-node/alter-column-node.d.ts +21 -0
- package/dist/esm/operation-node/alter-column-node.js +18 -0
- package/dist/esm/operation-node/alter-table-node.d.ts +36 -0
- package/dist/esm/operation-node/alter-table-node.js +30 -0
- package/dist/esm/operation-node/and-node.d.ts +13 -0
- package/dist/esm/operation-node/and-node.js +17 -0
- package/dist/esm/operation-node/binary-operation-node.d.ts +14 -0
- package/dist/esm/operation-node/binary-operation-node.js +18 -0
- package/dist/esm/operation-node/case-node.d.ts +19 -0
- package/dist/esm/operation-node/case-node.js +40 -0
- package/dist/esm/operation-node/cast-node.d.ts +13 -0
- package/dist/esm/operation-node/cast-node.js +17 -0
- package/dist/esm/operation-node/check-constraint-node.d.ts +14 -0
- package/dist/esm/operation-node/check-constraint-node.js +18 -0
- package/dist/esm/operation-node/collate-node.d.ts +13 -0
- package/dist/esm/operation-node/collate-node.js +17 -0
- package/dist/esm/operation-node/column-definition-node.d.ts +36 -0
- package/dist/esm/operation-node/column-definition-node.js +40 -0
- package/dist/esm/operation-node/column-node.d.ts +13 -0
- package/dist/esm/operation-node/column-node.js +17 -0
- package/dist/esm/operation-node/column-update-node.d.ts +13 -0
- package/dist/esm/operation-node/column-update-node.js +17 -0
- package/dist/esm/operation-node/common-table-expression-name-node.d.ts +15 -0
- package/dist/esm/operation-node/common-table-expression-name-node.js +21 -0
- package/dist/esm/operation-node/common-table-expression-node.d.ts +18 -0
- package/dist/esm/operation-node/common-table-expression-node.js +23 -0
- package/dist/esm/operation-node/constraint-node.d.ts +5 -0
- package/dist/esm/operation-node/constraint-node.js +2 -0
- package/dist/esm/operation-node/create-index-node.d.ts +27 -0
- package/dist/esm/operation-node/create-index-node.js +29 -0
- package/dist/esm/operation-node/create-schema-node.d.ts +16 -0
- package/dist/esm/operation-node/create-schema-node.js +24 -0
- package/dist/esm/operation-node/create-table-node.d.ts +32 -0
- package/dist/esm/operation-node/create-table-node.js +54 -0
- package/dist/esm/operation-node/create-type-node.d.ts +17 -0
- package/dist/esm/operation-node/create-type-node.js +24 -0
- package/dist/esm/operation-node/create-view-node.d.ts +24 -0
- package/dist/esm/operation-node/create-view-node.js +23 -0
- package/dist/esm/operation-node/data-type-node.d.ts +18 -0
- package/dist/esm/operation-node/data-type-node.js +83 -0
- package/dist/esm/operation-node/default-insert-value-node.d.ts +11 -0
- package/dist/esm/operation-node/default-insert-value-node.js +15 -0
- package/dist/esm/operation-node/default-value-node.d.ts +12 -0
- package/dist/esm/operation-node/default-value-node.js +16 -0
- package/dist/esm/operation-node/delete-query-node.d.ts +46 -0
- package/dist/esm/operation-node/delete-query-node.js +50 -0
- package/dist/esm/operation-node/drop-column-node.d.ts +13 -0
- package/dist/esm/operation-node/drop-column-node.js +17 -0
- package/dist/esm/operation-node/drop-constraint-node.d.ts +17 -0
- package/dist/esm/operation-node/drop-constraint-node.js +23 -0
- package/dist/esm/operation-node/drop-index-node.d.ts +19 -0
- package/dist/esm/operation-node/drop-index-node.js +24 -0
- package/dist/esm/operation-node/drop-schema-node.d.ts +17 -0
- package/dist/esm/operation-node/drop-schema-node.js +24 -0
- package/dist/esm/operation-node/drop-table-node.d.ts +17 -0
- package/dist/esm/operation-node/drop-table-node.js +23 -0
- package/dist/esm/operation-node/drop-type-node.d.ts +16 -0
- package/dist/esm/operation-node/drop-type-node.js +22 -0
- package/dist/esm/operation-node/drop-view-node.d.ts +18 -0
- package/dist/esm/operation-node/drop-view-node.js +23 -0
- package/dist/esm/operation-node/explain-node.d.ts +14 -0
- package/dist/esm/operation-node/explain-node.js +17 -0
- package/dist/esm/operation-node/fetch-node.d.ts +15 -0
- package/dist/esm/operation-node/fetch-node.js +17 -0
- package/dist/esm/operation-node/foreign-key-constraint-node.d.ts +33 -0
- package/dist/esm/operation-node/foreign-key-constraint-node.js +26 -0
- package/dist/esm/operation-node/from-node.d.ts +13 -0
- package/dist/esm/operation-node/from-node.js +22 -0
- package/dist/esm/operation-node/function-node.d.ts +13 -0
- package/dist/esm/operation-node/function-node.js +17 -0
- package/dist/esm/operation-node/generated-node.d.ts +19 -0
- package/dist/esm/operation-node/generated-node.js +29 -0
- package/dist/esm/operation-node/group-by-item-node.d.ts +12 -0
- package/dist/esm/operation-node/group-by-item-node.js +16 -0
- package/dist/esm/operation-node/group-by-node.d.ts +14 -0
- package/dist/esm/operation-node/group-by-node.js +22 -0
- package/dist/esm/operation-node/having-node.d.ts +13 -0
- package/dist/esm/operation-node/having-node.js +26 -0
- package/dist/esm/operation-node/identifier-node.d.ts +12 -0
- package/dist/esm/operation-node/identifier-node.js +16 -0
- package/dist/esm/operation-node/insert-query-node.d.ts +40 -0
- package/dist/esm/operation-node/insert-query-node.js +29 -0
- package/dist/esm/operation-node/join-node.d.ts +18 -0
- package/dist/esm/operation-node/join-node.js +35 -0
- package/dist/esm/operation-node/json-operator-chain-node.d.ts +16 -0
- package/dist/esm/operation-node/json-operator-chain-node.js +23 -0
- package/dist/esm/operation-node/json-path-leg-node.d.ts +14 -0
- package/dist/esm/operation-node/json-path-leg-node.js +17 -0
- package/dist/esm/operation-node/json-path-node.d.ts +16 -0
- package/dist/esm/operation-node/json-path-node.js +23 -0
- package/dist/esm/operation-node/json-reference-node.d.ts +17 -0
- package/dist/esm/operation-node/json-reference-node.js +23 -0
- package/dist/esm/operation-node/limit-node.d.ts +12 -0
- package/dist/esm/operation-node/limit-node.js +16 -0
- package/dist/esm/operation-node/list-node.d.ts +12 -0
- package/dist/esm/operation-node/list-node.js +16 -0
- package/dist/esm/operation-node/matched-node.d.ts +13 -0
- package/dist/esm/operation-node/matched-node.js +17 -0
- package/dist/esm/operation-node/merge-query-node.d.ts +30 -0
- package/dist/esm/operation-node/merge-query-node.js +43 -0
- package/dist/esm/operation-node/modify-column-node.d.ts +13 -0
- package/dist/esm/operation-node/modify-column-node.js +16 -0
- package/dist/esm/operation-node/offset-node.d.ts +12 -0
- package/dist/esm/operation-node/offset-node.js +16 -0
- package/dist/esm/operation-node/on-conflict-node.d.ts +30 -0
- package/dist/esm/operation-node/on-conflict-node.js +66 -0
- package/dist/esm/operation-node/on-duplicate-key-node.d.ts +14 -0
- package/dist/esm/operation-node/on-duplicate-key-node.js +16 -0
- package/dist/esm/operation-node/on-node.d.ts +13 -0
- package/dist/esm/operation-node/on-node.js +26 -0
- package/dist/esm/operation-node/operation-node-source.d.ts +5 -0
- package/dist/esm/operation-node/operation-node-source.js +5 -0
- package/dist/esm/operation-node/operation-node-transformer.d.ts +238 -0
- package/dist/esm/operation-node/operation-node-transformer.js +926 -0
- package/dist/esm/operation-node/operation-node-visitor.d.ts +201 -0
- package/dist/esm/operation-node/operation-node-visitor.js +112 -0
- package/dist/esm/operation-node/operation-node.d.ts +4 -0
- package/dist/esm/operation-node/operation-node.js +2 -0
- package/dist/esm/operation-node/operator-node.d.ts +32 -0
- package/dist/esm/operation-node/operator-node.js +100 -0
- package/dist/esm/operation-node/or-action-node.d.ts +12 -0
- package/dist/esm/operation-node/or-action-node.js +16 -0
- package/dist/esm/operation-node/or-node.d.ts +13 -0
- package/dist/esm/operation-node/or-node.js +17 -0
- package/dist/esm/operation-node/order-by-item-node.d.ts +18 -0
- package/dist/esm/operation-node/order-by-item-node.js +23 -0
- package/dist/esm/operation-node/order-by-node.d.ts +14 -0
- package/dist/esm/operation-node/order-by-node.js +22 -0
- package/dist/esm/operation-node/output-node.d.ts +13 -0
- package/dist/esm/operation-node/output-node.js +24 -0
- package/dist/esm/operation-node/over-node.d.ts +19 -0
- package/dist/esm/operation-node/over-node.js +33 -0
- package/dist/esm/operation-node/parens-node.d.ts +12 -0
- package/dist/esm/operation-node/parens-node.js +16 -0
- package/dist/esm/operation-node/partition-by-item-node.d.ts +13 -0
- package/dist/esm/operation-node/partition-by-item-node.js +16 -0
- package/dist/esm/operation-node/partition-by-node.d.ts +14 -0
- package/dist/esm/operation-node/partition-by-node.js +22 -0
- package/dist/esm/operation-node/primary-key-constraint-node.d.ts +29 -0
- package/dist/esm/operation-node/primary-key-constraint-node.js +28 -0
- package/dist/esm/operation-node/primitive-value-list-node.d.ts +17 -0
- package/dist/esm/operation-node/primitive-value-list-node.js +16 -0
- package/dist/esm/operation-node/query-node.d.ts +60 -0
- package/dist/esm/operation-node/query-node.js +100 -0
- package/dist/esm/operation-node/raw-node.d.ts +16 -0
- package/dist/esm/operation-node/raw-node.js +26 -0
- package/dist/esm/operation-node/reference-node.d.ts +17 -0
- package/dist/esm/operation-node/reference-node.js +25 -0
- package/dist/esm/operation-node/references-node.d.ts +22 -0
- package/dist/esm/operation-node/references-node.js +36 -0
- package/dist/esm/operation-node/refresh-materialized-view-node.d.ts +17 -0
- package/dist/esm/operation-node/refresh-materialized-view-node.js +23 -0
- package/dist/esm/operation-node/rename-column-node.d.ts +14 -0
- package/dist/esm/operation-node/rename-column-node.js +18 -0
- package/dist/esm/operation-node/rename-constraint-node.d.ts +14 -0
- package/dist/esm/operation-node/rename-constraint-node.js +18 -0
- package/dist/esm/operation-node/returning-node.d.ts +14 -0
- package/dist/esm/operation-node/returning-node.js +24 -0
- package/dist/esm/operation-node/schemable-identifier-node.d.ts +15 -0
- package/dist/esm/operation-node/schemable-identifier-node.js +24 -0
- package/dist/esm/operation-node/select-all-node.d.ts +11 -0
- package/dist/esm/operation-node/select-all-node.js +15 -0
- package/dist/esm/operation-node/select-modifier-node.d.ts +16 -0
- package/dist/esm/operation-node/select-modifier-node.js +23 -0
- package/dist/esm/operation-node/select-query-node.d.ts +67 -0
- package/dist/esm/operation-node/select-query-node.js +127 -0
- package/dist/esm/operation-node/selection-node.d.ts +20 -0
- package/dist/esm/operation-node/selection-node.js +30 -0
- package/dist/esm/operation-node/set-operation-node.d.ts +15 -0
- package/dist/esm/operation-node/set-operation-node.js +18 -0
- package/dist/esm/operation-node/simple-reference-expression-node.d.ts +3 -0
- package/dist/esm/operation-node/simple-reference-expression-node.js +2 -0
- package/dist/esm/operation-node/table-node.d.ts +14 -0
- package/dist/esm/operation-node/table-node.js +23 -0
- package/dist/esm/operation-node/top-node.d.ts +14 -0
- package/dist/esm/operation-node/top-node.js +17 -0
- package/dist/esm/operation-node/tuple-node.d.ts +12 -0
- package/dist/esm/operation-node/tuple-node.js +16 -0
- package/dist/esm/operation-node/unary-operation-node.d.ts +13 -0
- package/dist/esm/operation-node/unary-operation-node.js +17 -0
- package/dist/esm/operation-node/unique-constraint-node.d.ts +20 -0
- package/dist/esm/operation-node/unique-constraint-node.js +26 -0
- package/dist/esm/operation-node/update-query-node.d.ts +39 -0
- package/dist/esm/operation-node/update-query-node.js +48 -0
- package/dist/esm/operation-node/using-node.d.ts +13 -0
- package/dist/esm/operation-node/using-node.js +22 -0
- package/dist/esm/operation-node/value-list-node.d.ts +12 -0
- package/dist/esm/operation-node/value-list-node.js +16 -0
- package/dist/esm/operation-node/value-node.d.ts +14 -0
- package/dist/esm/operation-node/value-node.js +23 -0
- package/dist/esm/operation-node/values-node.d.ts +15 -0
- package/dist/esm/operation-node/values-node.js +16 -0
- package/dist/esm/operation-node/when-node.d.ts +14 -0
- package/dist/esm/operation-node/when-node.js +22 -0
- package/dist/esm/operation-node/where-node.d.ts +13 -0
- package/dist/esm/operation-node/where-node.js +26 -0
- package/dist/esm/operation-node/with-node.d.ts +16 -0
- package/dist/esm/operation-node/with-node.js +23 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/parser/binary-operation-parser.d.ts +21 -0
- package/dist/esm/parser/binary-operation-parser.js +68 -0
- package/dist/esm/parser/coalesce-parser.d.ts +12 -0
- package/dist/esm/parser/coalesce-parser.js +2 -0
- package/dist/esm/parser/collate-parser.d.ts +1 -0
- package/dist/esm/parser/collate-parser.js +2 -0
- package/dist/esm/parser/data-type-parser.d.ts +5 -0
- package/dist/esm/parser/data-type-parser.js +12 -0
- package/dist/esm/parser/default-value-parser.d.ts +4 -0
- package/dist/esm/parser/default-value-parser.js +8 -0
- package/dist/esm/parser/delete-from-parser.d.ts +9 -0
- package/dist/esm/parser/delete-from-parser.js +2 -0
- package/dist/esm/parser/expression-parser.d.ts +20 -0
- package/dist/esm/parser/expression-parser.js +26 -0
- package/dist/esm/parser/fetch-parser.d.ts +2 -0
- package/dist/esm/parser/fetch-parser.js +15 -0
- package/dist/esm/parser/group-by-parser.d.ts +6 -0
- package/dist/esm/parser/group-by-parser.js +9 -0
- package/dist/esm/parser/identifier-parser.d.ts +2 -0
- package/dist/esm/parser/identifier-parser.js +20 -0
- package/dist/esm/parser/insert-values-parser.d.ts +14 -0
- package/dist/esm/parser/insert-values-parser.js +62 -0
- package/dist/esm/parser/join-parser.d.ts +10 -0
- package/dist/esm/parser/join-parser.js +28 -0
- package/dist/esm/parser/merge-into-parser.d.ts +7 -0
- package/dist/esm/parser/merge-into-parser.js +2 -0
- package/dist/esm/parser/merge-parser.d.ts +9 -0
- package/dist/esm/parser/merge-parser.js +28 -0
- package/dist/esm/parser/on-commit-action-parse.d.ts +2 -0
- package/dist/esm/parser/on-commit-action-parse.js +8 -0
- package/dist/esm/parser/on-modify-action-parser.d.ts +2 -0
- package/dist/esm/parser/on-modify-action-parser.js +8 -0
- package/dist/esm/parser/order-by-parser.d.ts +25 -0
- package/dist/esm/parser/order-by-parser.js +67 -0
- package/dist/esm/parser/parse-utils.d.ts +10 -0
- package/dist/esm/parser/parse-utils.js +33 -0
- package/dist/esm/parser/partition-by-parser.d.ts +6 -0
- package/dist/esm/parser/partition-by-parser.js +6 -0
- package/dist/esm/parser/reference-parser.d.ts +31 -0
- package/dist/esm/parser/reference-parser.js +95 -0
- package/dist/esm/parser/returning-parser.d.ts +8 -0
- package/dist/esm/parser/returning-parser.js +2 -0
- package/dist/esm/parser/savepoint-parser.d.ts +4 -0
- package/dist/esm/parser/savepoint-parser.js +9 -0
- package/dist/esm/parser/select-from-parser.d.ts +6 -0
- package/dist/esm/parser/select-from-parser.js +2 -0
- package/dist/esm/parser/select-parser.d.ts +36 -0
- package/dist/esm/parser/select-parser.js +47 -0
- package/dist/esm/parser/set-operation-parser.d.ts +5 -0
- package/dist/esm/parser/set-operation-parser.js +14 -0
- package/dist/esm/parser/table-parser.d.ts +24 -0
- package/dist/esm/parser/table-parser.js +49 -0
- package/dist/esm/parser/top-parser.d.ts +2 -0
- package/dist/esm/parser/top-parser.js +17 -0
- package/dist/esm/parser/tuple-parser.d.ts +47 -0
- package/dist/esm/parser/tuple-parser.js +2 -0
- package/dist/esm/parser/unary-operation-parser.d.ts +8 -0
- package/dist/esm/parser/unary-operation-parser.js +13 -0
- package/dist/esm/parser/update-parser.d.ts +9 -0
- package/dist/esm/parser/update-parser.js +2 -0
- package/dist/esm/parser/update-set-parser.d.ts +16 -0
- package/dist/esm/parser/update-set-parser.js +23 -0
- package/dist/esm/parser/value-parser.d.ts +13 -0
- package/dist/esm/parser/value-parser.js +33 -0
- package/dist/esm/parser/with-parser.d.ts +45 -0
- package/dist/esm/parser/with-parser.js +31 -0
- package/dist/esm/performance/query-analyzer.d.ts +89 -0
- package/dist/esm/performance/query-analyzer.js +260 -0
- package/dist/esm/plugin/camel-case/camel-case-plugin.d.ts +170 -0
- package/dist/esm/plugin/camel-case/camel-case-plugin.js +119 -0
- package/dist/esm/plugin/camel-case/camel-case-transformer.d.ts +9 -0
- package/dist/esm/plugin/camel-case/camel-case-transformer.js +16 -0
- package/dist/esm/plugin/camel-case/camel-case.d.ts +15 -0
- package/dist/esm/plugin/camel-case/camel-case.js +108 -0
- package/dist/esm/plugin/deduplicate-joins/deduplicate-joins-plugin.d.ts +70 -0
- package/dist/esm/plugin/deduplicate-joins/deduplicate-joins-plugin.js +16 -0
- package/dist/esm/plugin/deduplicate-joins/deduplicate-joins-transformer.d.ts +11 -0
- package/dist/esm/plugin/deduplicate-joins/deduplicate-joins-transformer.js +39 -0
- package/dist/esm/plugin/handle-empty-in-lists/handle-empty-in-lists-plugin.d.ts +211 -0
- package/dist/esm/plugin/handle-empty-in-lists/handle-empty-in-lists-plugin.js +159 -0
- package/dist/esm/plugin/handle-empty-in-lists/handle-empty-in-lists-transformer.d.ts +8 -0
- package/dist/esm/plugin/handle-empty-in-lists/handle-empty-in-lists-transformer.js +26 -0
- package/dist/esm/plugin/handle-empty-in-lists/handle-empty-in-lists.d.ts +44 -0
- package/dist/esm/plugin/handle-empty-in-lists/handle-empty-in-lists.js +63 -0
- package/dist/esm/plugin/immediate-value/immediate-value-plugin.d.ts +73 -0
- package/dist/esm/plugin/immediate-value/immediate-value-plugin.js +19 -0
- package/dist/esm/plugin/immediate-value/immediate-value-transformer.d.ts +15 -0
- package/dist/esm/plugin/immediate-value/immediate-value-transformer.js +20 -0
- package/dist/esm/plugin/kysely-plugin.d.ts +72 -0
- package/dist/esm/plugin/kysely-plugin.js +2 -0
- package/dist/esm/plugin/noop-plugin.d.ts +64 -0
- package/dist/esm/plugin/noop-plugin.js +9 -0
- package/dist/esm/plugin/parse-json-results/parse-json-results-plugin.d.ts +126 -0
- package/dist/esm/plugin/parse-json-results/parse-json-results-plugin.js +104 -0
- package/dist/esm/plugin/with-schema/with-schema-plugin.d.ts +66 -0
- package/dist/esm/plugin/with-schema/with-schema-plugin.js +14 -0
- package/dist/esm/plugin/with-schema/with-schema-transformer.d.ts +16 -0
- package/dist/esm/plugin/with-schema/with-schema-transformer.js +178 -0
- package/dist/esm/query-builder/aggregate-function-builder.d.ts +379 -0
- package/dist/esm/query-builder/aggregate-function-builder.js +238 -0
- package/dist/esm/query-builder/case-builder.d.ts +112 -0
- package/dist/esm/query-builder/case-builder.js +73 -0
- package/dist/esm/query-builder/cte-builder.d.ts +20 -0
- package/dist/esm/query-builder/cte-builder.js +34 -0
- package/dist/esm/query-builder/delete-query-builder.d.ts +1348 -0
- package/dist/esm/query-builder/delete-query-builder.js +501 -0
- package/dist/esm/query-builder/delete-result.d.ts +4 -0
- package/dist/esm/query-builder/delete-result.js +7 -0
- package/dist/esm/query-builder/function-module.d.ts +592 -0
- package/dist/esm/query-builder/function-module.js +60 -0
- package/dist/esm/query-builder/having-interface.d.ts +15 -0
- package/dist/esm/query-builder/having-interface.js +2 -0
- package/dist/esm/query-builder/insert-query-builder.d.ts +1235 -0
- package/dist/esm/query-builder/insert-query-builder.js +1157 -0
- package/dist/esm/query-builder/insert-result.d.ts +46 -0
- package/dist/esm/query-builder/insert-result.js +50 -0
- package/dist/esm/query-builder/join-builder.d.ts +38 -0
- package/dist/esm/query-builder/join-builder.js +48 -0
- package/dist/esm/query-builder/json-path-builder.d.ts +294 -0
- package/dist/esm/query-builder/json-path-builder.js +195 -0
- package/dist/esm/query-builder/merge-query-builder.d.ts +1001 -0
- package/dist/esm/query-builder/merge-query-builder.js +624 -0
- package/dist/esm/query-builder/merge-result.d.ts +4 -0
- package/dist/esm/query-builder/merge-result.js +7 -0
- package/dist/esm/query-builder/no-result-error.d.ts +10 -0
- package/dist/esm/query-builder/no-result-error.js +14 -0
- package/dist/esm/query-builder/on-conflict-builder.d.ts +872 -0
- package/dist/esm/query-builder/on-conflict-builder.js +254 -0
- package/dist/esm/query-builder/order-by-interface.d.ts +158 -0
- package/dist/esm/query-builder/order-by-interface.js +2 -0
- package/dist/esm/query-builder/order-by-item-builder.d.ts +43 -0
- package/dist/esm/query-builder/order-by-item-builder.js +72 -0
- package/dist/esm/query-builder/output-interface.d.ts +138 -0
- package/dist/esm/query-builder/output-interface.js +2 -0
- package/dist/esm/query-builder/over-builder.d.ts +101 -0
- package/dist/esm/query-builder/over-builder.js +37 -0
- package/dist/esm/query-builder/returning-interface.d.ts +91 -0
- package/dist/esm/query-builder/returning-interface.js +2 -0
- package/dist/esm/query-builder/select-query-builder-expression.d.ts +28 -0
- package/dist/esm/query-builder/select-query-builder-expression.js +2 -0
- package/dist/esm/query-builder/select-query-builder.d.ts +2391 -0
- package/dist/esm/query-builder/select-query-builder.js +374 -0
- package/dist/esm/query-builder/update-query-builder.d.ts +1392 -0
- package/dist/esm/query-builder/update-query-builder.js +510 -0
- package/dist/esm/query-builder/update-result.d.ts +14 -0
- package/dist/esm/query-builder/update-result.js +18 -0
- package/dist/esm/query-builder/where-interface.d.ts +382 -0
- package/dist/esm/query-builder/where-interface.js +2 -0
- package/dist/esm/query-compiler/compiled-query.d.ts +11 -0
- package/dist/esm/query-compiler/compiled-query.js +14 -0
- package/dist/esm/query-compiler/default-query-compiler.d.ts +235 -0
- package/dist/esm/query-compiler/default-query-compiler.js +1387 -0
- package/dist/esm/query-compiler/query-compiler.d.ts +24 -0
- package/dist/esm/query-compiler/query-compiler.js +2 -0
- package/dist/esm/query-creator.d.ts +592 -0
- package/dist/esm/query-creator.js +619 -0
- package/dist/esm/query-executor/default-query-executor.d.ts +50 -0
- package/dist/esm/query-executor/default-query-executor.js +37 -0
- package/dist/esm/query-executor/noop-query-executor.d.ts +50 -0
- package/dist/esm/query-executor/noop-query-executor.js +34 -0
- package/dist/esm/query-executor/query-executor-base.d.ts +68 -0
- package/dist/esm/query-executor/query-executor-base.js +59 -0
- package/dist/esm/query-executor/query-executor-provider.d.ts +8 -0
- package/dist/esm/query-executor/query-executor-provider.js +2 -0
- package/dist/esm/query-executor/query-executor.d.ts +74 -0
- package/dist/esm/query-executor/query-executor.js +2 -0
- package/dist/esm/raw-builder/raw-builder.d.ts +218 -0
- package/dist/esm/raw-builder/raw-builder.js +84 -0
- package/dist/esm/raw-builder/sql.d.ts +366 -0
- package/dist/esm/raw-builder/sql.js +82 -0
- package/dist/esm/relationships/relationship-engine.d.ts +59 -0
- package/dist/esm/relationships/relationship-engine.js +203 -0
- package/dist/esm/repository/repository-factory.d.ts +54 -0
- package/dist/esm/repository/repository-factory.js +446 -0
- package/dist/esm/schema/builders/alter-column-builder.d.ts +53 -0
- package/dist/esm/schema/builders/alter-column-builder.js +70 -0
- package/dist/esm/schema/builders/alter-table-add-foreign-key-constraint-builder.d.ts +32 -0
- package/dist/esm/schema/builders/alter-table-add-foreign-key-constraint-builder.js +64 -0
- package/dist/esm/schema/builders/alter-table-add-index-builder.d.ts +138 -0
- package/dist/esm/schema/builders/alter-table-add-index-builder.js +162 -0
- package/dist/esm/schema/builders/alter-table-builder.d.ts +148 -0
- package/dist/esm/schema/builders/alter-table-builder.js +263 -0
- package/dist/esm/schema/builders/alter-table-drop-constraint-builder.d.ts +26 -0
- package/dist/esm/schema/builders/alter-table-drop-constraint-builder.js +56 -0
- package/dist/esm/schema/builders/alter-table-executor.d.ts +18 -0
- package/dist/esm/schema/builders/alter-table-executor.js +17 -0
- package/dist/esm/schema/builders/check-constraint-builder.d.ts +13 -0
- package/dist/esm/schema/builders/check-constraint-builder.js +17 -0
- package/dist/esm/schema/builders/column-definition-builder.d.ts +514 -0
- package/dist/esm/schema/builders/column-definition-builder.js +597 -0
- package/dist/esm/schema/builders/create-index-builder.d.ts +173 -0
- package/dist/esm/schema/builders/create-index-builder.js +199 -0
- package/dist/esm/schema/builders/create-schema-builder.d.ts +24 -0
- package/dist/esm/schema/builders/create-schema-builder.js +31 -0
- package/dist/esm/schema/builders/create-table-builder.d.ts +331 -0
- package/dist/esm/schema/builders/create-table-builder.js +408 -0
- package/dist/esm/schema/builders/create-type-builder.d.ts +33 -0
- package/dist/esm/schema/builders/create-type-builder.js +40 -0
- package/dist/esm/schema/builders/create-view-builder.d.ts +48 -0
- package/dist/esm/schema/builders/create-view-builder.js +95 -0
- package/dist/esm/schema/builders/drop-index-builder.d.ts +30 -0
- package/dist/esm/schema/builders/drop-index-builder.js +54 -0
- package/dist/esm/schema/builders/drop-schema-builder.d.ts +25 -0
- package/dist/esm/schema/builders/drop-schema-builder.js +41 -0
- package/dist/esm/schema/builders/drop-table-builder.d.ts +25 -0
- package/dist/esm/schema/builders/drop-table-builder.js +41 -0
- package/dist/esm/schema/builders/drop-type-builder.d.ts +24 -0
- package/dist/esm/schema/builders/drop-type-builder.js +33 -0
- package/dist/esm/schema/builders/drop-view-builder.d.ts +26 -0
- package/dist/esm/schema/builders/drop-view-builder.js +49 -0
- package/dist/esm/schema/builders/foreign-key-constraint-builder.d.ts +28 -0
- package/dist/esm/schema/builders/foreign-key-constraint-builder.js +45 -0
- package/dist/esm/schema/builders/index.d.ts +22 -0
- package/dist/esm/schema/builders/index.js +24 -0
- package/dist/esm/schema/builders/primary-key-constraint-builder.d.ts +17 -0
- package/dist/esm/schema/builders/primary-key-constraint-builder.js +34 -0
- package/dist/esm/schema/builders/refresh-materialized-view-builder.d.ts +47 -0
- package/dist/esm/schema/builders/refresh-materialized-view-builder.js +72 -0
- package/dist/esm/schema/builders/unique-constraint-builder.d.ts +23 -0
- package/dist/esm/schema/builders/unique-constraint-builder.js +42 -0
- package/dist/esm/schema/core/coordinators/schema-discovery.coordinator.d.ts +35 -0
- package/dist/esm/schema/core/coordinators/schema-discovery.coordinator.js +60 -0
- package/dist/esm/schema/core/discovery/relationship-discovery.d.ts +36 -0
- package/dist/esm/schema/core/discovery/relationship-discovery.js +159 -0
- package/dist/esm/schema/core/discovery/table-metadata-discovery.d.ts +29 -0
- package/dist/esm/schema/core/discovery/table-metadata-discovery.js +123 -0
- package/dist/esm/schema/core/discovery/view-discovery.d.ts +36 -0
- package/dist/esm/schema/core/discovery/view-discovery.js +134 -0
- package/dist/esm/schema/core/factories/discovery-factory.d.ts +66 -0
- package/dist/esm/schema/core/factories/discovery-factory.js +119 -0
- package/dist/esm/schema/core/types/schema-discovery-types.d.ts +43 -0
- package/dist/esm/schema/core/types/schema-discovery-types.js +3 -0
- package/dist/esm/schema/core/utils/name-generator.d.ts +21 -0
- package/dist/esm/schema/core/utils/name-generator.js +52 -0
- package/dist/esm/schema/core/utils/type-mapper.d.ts +25 -0
- package/dist/esm/schema/core/utils/type-mapper.js +58 -0
- package/dist/esm/schema/dialects/sqlite/discovery/sqlite-constraint-discovery.d.ts +97 -0
- package/dist/esm/schema/dialects/sqlite/discovery/sqlite-constraint-discovery.js +530 -0
- package/dist/esm/schema/dialects/sqlite/discovery/sqlite-index-discovery.d.ts +32 -0
- package/dist/esm/schema/dialects/sqlite/discovery/sqlite-index-discovery.js +130 -0
- package/dist/esm/schema/dialects/sqlite/introspection/sqlite-schema-introspector.d.ts +31 -0
- package/dist/esm/schema/dialects/sqlite/introspection/sqlite-schema-introspector.js +189 -0
- package/dist/esm/schema/dialects/sqlite/sqlite-discovery.coordinator.d.ts +51 -0
- package/dist/esm/schema/dialects/sqlite/sqlite-discovery.coordinator.js +177 -0
- package/dist/esm/schema/index.d.ts +14 -0
- package/dist/esm/schema/index.js +21 -0
- package/dist/esm/schema/schema-discovery.d.ts +23 -0
- package/dist/esm/schema/schema-discovery.js +30 -0
- package/dist/esm/schema/schema.d.ts +230 -0
- package/dist/esm/schema/schema.js +325 -0
- package/dist/esm/schema/test/basic-schema-test.d.ts +8 -0
- package/dist/esm/schema/test/basic-schema-test.js +183 -0
- package/dist/esm/schema/test/dialect-capabilities.test.d.ts +1 -0
- package/dist/esm/schema/test/dialect-capabilities.test.js +152 -0
- package/dist/esm/schema/test/discovery-factory.test.d.ts +1 -0
- package/dist/esm/schema/test/discovery-factory.test.js +150 -0
- package/dist/esm/schema/test/error-handling.test.d.ts +1 -0
- package/dist/esm/schema/test/error-handling.test.js +148 -0
- package/dist/esm/schema/test/integration.test.d.ts +1 -0
- package/dist/esm/schema/test/integration.test.js +134 -0
- package/dist/esm/schema/test/schema-discovery-coordinator.test.d.ts +1 -0
- package/dist/esm/schema/test/schema-discovery-coordinator.test.js +138 -0
- package/dist/esm/schema/test/simple-schema-test.d.ts +5 -0
- package/dist/esm/schema/test/simple-schema-test.js +78 -0
- package/dist/esm/schema/test/sqlite-discovery-coordinator.test.d.ts +1 -0
- package/dist/esm/schema/test/sqlite-discovery-coordinator.test.js +376 -0
- package/dist/esm/schema/test/test-runner.d.ts +66 -0
- package/dist/esm/schema/test/test-runner.js +89 -0
- package/dist/esm/sqlite-migration/index.d.ts +6 -0
- package/dist/esm/sqlite-migration/index.js +14 -0
- package/dist/esm/sqlite-migration/sqlite-migration-manager.d.ts +104 -0
- package/dist/esm/sqlite-migration/sqlite-migration-manager.js +332 -0
- package/dist/esm/sqlite-migration/sqlite-migration-provider.d.ts +77 -0
- package/dist/esm/sqlite-migration/sqlite-migration-provider.js +339 -0
- package/dist/esm/testing/test-utils.d.ts +110 -0
- package/dist/esm/testing/test-utils.js +320 -0
- package/dist/esm/types/index.d.ts +155 -0
- package/dist/esm/types/index.js +5 -0
- package/dist/esm/types/type-generator.d.ts +52 -0
- package/dist/esm/types/type-generator.js +258 -0
- package/dist/esm/util/assert.d.ts +2 -0
- package/dist/esm/util/assert.js +11 -0
- package/dist/esm/util/column-type.d.ts +175 -0
- package/dist/esm/util/column-type.js +2 -0
- package/dist/esm/util/compilable.d.ts +5 -0
- package/dist/esm/util/compilable.js +5 -0
- package/dist/esm/util/deferred.d.ts +7 -0
- package/dist/esm/util/deferred.js +25 -0
- package/dist/esm/util/explainable.d.ts +40 -0
- package/dist/esm/util/explainable.js +2 -0
- package/dist/esm/util/infer-result.d.ts +48 -0
- package/dist/esm/util/infer-result.js +2 -0
- package/dist/esm/util/json-object-args.d.ts +3 -0
- package/dist/esm/util/json-object-args.js +32 -0
- package/dist/esm/util/log-once.d.ts +5 -0
- package/dist/esm/util/log-once.js +13 -0
- package/dist/esm/util/log.d.ts +26 -0
- package/dist/esm/util/log.js +55 -0
- package/dist/esm/util/object-utils.d.ts +23 -0
- package/dist/esm/util/object-utils.js +141 -0
- package/dist/esm/util/performance-now.d.ts +1 -0
- package/dist/esm/util/performance-now.js +10 -0
- package/dist/esm/util/provide-controlled-connection.d.ts +7 -0
- package/dist/esm/util/provide-controlled-connection.js +22 -0
- package/dist/esm/util/query-id.d.ts +4 -0
- package/dist/esm/util/query-id.js +14 -0
- package/dist/esm/util/random-string.d.ts +1 -0
- package/dist/esm/util/random-string.js +75 -0
- package/dist/esm/util/require-all-props.d.ts +45 -0
- package/dist/esm/util/require-all-props.js +39 -0
- package/dist/esm/util/stack-trace-utils.d.ts +1 -0
- package/dist/esm/util/stack-trace-utils.js +14 -0
- package/dist/esm/util/streamable.d.ts +29 -0
- package/dist/esm/util/streamable.js +2 -0
- package/dist/esm/util/type-error.d.ts +3 -0
- package/dist/esm/util/type-error.js +2 -0
- package/dist/esm/util/type-utils.d.ts +189 -0
- package/dist/esm/util/type-utils.js +2 -0
- package/dist/esm/utils/errorHelpers.d.ts +26 -0
- package/dist/esm/utils/errorHelpers.js +180 -0
- package/dist/esm/watch/schema-watcher.d.ts +68 -0
- package/dist/esm/watch/schema-watcher.js +183 -0
- package/outdated-typescript.d.ts +5 -0
- package/package.json +152 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const chalk_1 = require("chalk");
|
|
6
|
+
const init_js_1 = require("./commands/init.js");
|
|
7
|
+
const inspect_js_1 = require("./commands/inspect.js");
|
|
8
|
+
const generate_js_1 = require("./commands/generate.js");
|
|
9
|
+
const optimize_js_1 = require("./commands/optimize.js");
|
|
10
|
+
const analyze_js_1 = require("./commands/analyze.js");
|
|
11
|
+
const migrate_js_1 = require("./commands/migrate.js");
|
|
12
|
+
const watch_js_1 = require("./commands/watch.js");
|
|
13
|
+
const status_js_1 = require("./commands/status.js");
|
|
14
|
+
const program = new commander_1.Command();
|
|
15
|
+
program
|
|
16
|
+
.name('noormme')
|
|
17
|
+
.description(chalk_1.default.blue.bold('NOORMME CLI - Automating SQLite with Intelligence'))
|
|
18
|
+
.version('1.0.0');
|
|
19
|
+
// Init command - Zero-configuration setup
|
|
20
|
+
program
|
|
21
|
+
.command('init')
|
|
22
|
+
.description('Initialize NOORMME with zero-configuration SQLite automation')
|
|
23
|
+
.option('-d, --database <path>', 'SQLite database file path', './database.sqlite')
|
|
24
|
+
.option('-o, --output <dir>', 'Output directory for generated files', 'lib')
|
|
25
|
+
.option('-f, --force', 'Overwrite existing files')
|
|
26
|
+
.option('--no-auto-optimize', 'Disable automatic SQLite optimization')
|
|
27
|
+
.option('--no-auto-index', 'Disable automatic index recommendations')
|
|
28
|
+
.action(init_js_1.init);
|
|
29
|
+
// Inspect command - Enhanced schema discovery
|
|
30
|
+
program
|
|
31
|
+
.command('inspect [table]')
|
|
32
|
+
.description('Inspect database schema with automation insights')
|
|
33
|
+
.option('-d, --database <path>', 'SQLite database file path')
|
|
34
|
+
.option('-r, --relationships', 'Show relationships and foreign keys')
|
|
35
|
+
.option('-o, --optimizations', 'Show optimization recommendations')
|
|
36
|
+
.option('-i, --indexes', 'Show index analysis')
|
|
37
|
+
.option('-p, --performance', 'Show performance metrics')
|
|
38
|
+
.action(inspect_js_1.inspect);
|
|
39
|
+
// Generate command - Enhanced type and repository generation
|
|
40
|
+
program
|
|
41
|
+
.command('generate')
|
|
42
|
+
.description('Generate TypeScript types, repositories, and automation files')
|
|
43
|
+
.option('-d, --database <path>', 'SQLite database file path')
|
|
44
|
+
.option('-o, --output <dir>', 'Output directory', './generated')
|
|
45
|
+
.option('-t, --types-only', 'Generate only TypeScript types')
|
|
46
|
+
.option('-r, --repos-only', 'Generate only repository classes')
|
|
47
|
+
.option('-f, --format <format>', 'TypeScript output format (dts, ts)', 'dts')
|
|
48
|
+
.action(generate_js_1.generate);
|
|
49
|
+
// Optimize command - SQLite performance optimization
|
|
50
|
+
program
|
|
51
|
+
.command('optimize')
|
|
52
|
+
.description('Optimize SQLite database performance automatically')
|
|
53
|
+
.option('-d, --database <path>', 'SQLite database file path')
|
|
54
|
+
.option('-p, --pragma', 'Apply PRAGMA optimizations')
|
|
55
|
+
.option('-i, --indexes', 'Apply intelligent index recommendations')
|
|
56
|
+
.option('-a, --analyze', 'Run ANALYZE for query optimization')
|
|
57
|
+
.option('-w, --wal', 'Enable WAL mode for better concurrency')
|
|
58
|
+
.option('--dry-run', 'Show what would be optimized without applying changes')
|
|
59
|
+
.action(optimize_js_1.optimize);
|
|
60
|
+
// Analyze command - Query pattern analysis
|
|
61
|
+
program
|
|
62
|
+
.command('analyze')
|
|
63
|
+
.description('Analyze query patterns and provide intelligent recommendations')
|
|
64
|
+
.option('-d, --database <path>', 'SQLite database file path')
|
|
65
|
+
.option('-s, --slow-queries', 'Focus on slow query analysis')
|
|
66
|
+
.option('-i, --indexes', 'Generate index recommendations')
|
|
67
|
+
.option('-p, --patterns', 'Show query usage patterns')
|
|
68
|
+
.option('-r, --report', 'Generate detailed performance report')
|
|
69
|
+
.action(analyze_js_1.analyze);
|
|
70
|
+
// Migrate command - Automated migration management
|
|
71
|
+
program
|
|
72
|
+
.command('migrate')
|
|
73
|
+
.description('Manage database migrations with automation')
|
|
74
|
+
.option('-d, --database <path>', 'SQLite database file path')
|
|
75
|
+
.option('--to <version>', 'Migrate to specific version')
|
|
76
|
+
.option('--latest', 'Migrate to latest version')
|
|
77
|
+
.option('--rollback', 'Rollback last migration')
|
|
78
|
+
.option('--status', 'Show migration status')
|
|
79
|
+
.option('--generate <name>', 'Generate new migration')
|
|
80
|
+
.action(migrate_js_1.migrate);
|
|
81
|
+
// Watch command - Schema monitoring and auto-optimization
|
|
82
|
+
program
|
|
83
|
+
.command('watch')
|
|
84
|
+
.description('Monitor database schema changes and auto-optimize')
|
|
85
|
+
.option('-d, --database <path>', 'SQLite database file path')
|
|
86
|
+
.option('-i, --interval <ms>', 'Check interval in milliseconds', '5000')
|
|
87
|
+
.option('--auto-optimize', 'Automatically apply optimizations')
|
|
88
|
+
.option('--auto-index', 'Automatically apply index recommendations')
|
|
89
|
+
.option('--notify', 'Show desktop notifications for changes')
|
|
90
|
+
.action(watch_js_1.watch);
|
|
91
|
+
// Status command - Automation status and metrics
|
|
92
|
+
program
|
|
93
|
+
.command('status')
|
|
94
|
+
.description('Show NOORMME automation status and database metrics')
|
|
95
|
+
.option('-d, --database <path>', 'SQLite database file path')
|
|
96
|
+
.option('-m, --metrics', 'Show detailed performance metrics')
|
|
97
|
+
.option('-o, --optimizations', 'Show applied optimizations')
|
|
98
|
+
.option('-c, --cache', 'Show cache statistics')
|
|
99
|
+
.action(status_js_1.status);
|
|
100
|
+
// Help command
|
|
101
|
+
program.addHelpText('after', `
|
|
102
|
+
${chalk_1.default.blue.bold('🚀 NOORMME - Complete SQLite Automation')}
|
|
103
|
+
|
|
104
|
+
${chalk_1.default.green.bold('Quick Start:')}
|
|
105
|
+
$ noormme init # Zero-config setup with your existing SQLite database
|
|
106
|
+
$ noormme inspect # Discover your database schema automatically
|
|
107
|
+
$ noormme optimize # Automatically optimize SQLite performance
|
|
108
|
+
|
|
109
|
+
${chalk_1.default.green.bold('Automation Features:')}
|
|
110
|
+
$ noormme analyze # Analyze query patterns and get recommendations
|
|
111
|
+
$ noormme migrate --latest # Automated migration management
|
|
112
|
+
$ noormme watch --auto-optimize # Monitor and auto-optimize continuously
|
|
113
|
+
$ noormme status # View automation status and metrics
|
|
114
|
+
|
|
115
|
+
${chalk_1.default.green.bold('Development:')}
|
|
116
|
+
$ noormme generate # Generate TypeScript types and repositories
|
|
117
|
+
$ noormme inspect users --optimizations # Inspect table with optimization insights
|
|
118
|
+
$ noormme analyze --slow-queries # Focus on performance bottlenecks
|
|
119
|
+
|
|
120
|
+
${chalk_1.default.green.bold('Zero Configuration:')}
|
|
121
|
+
NOORMME automatically:
|
|
122
|
+
✅ Discovers all tables, columns, and relationships
|
|
123
|
+
✅ Generates TypeScript interfaces with full type safety
|
|
124
|
+
✅ Creates repository classes with intelligent CRUD methods
|
|
125
|
+
✅ Optimizes SQLite performance with PRAGMA settings
|
|
126
|
+
✅ Recommends indexes based on your query patterns
|
|
127
|
+
✅ Validates and fixes foreign key constraints
|
|
128
|
+
|
|
129
|
+
${chalk_1.default.yellow('Environment Variables:')}
|
|
130
|
+
DATABASE_PATH SQLite database file path (default: ./database.sqlite)
|
|
131
|
+
|
|
132
|
+
${chalk_1.default.yellow('Pro Tips:')}
|
|
133
|
+
• Point NOORMME at your existing SQLite database - no setup required!
|
|
134
|
+
• Use --dry-run with optimize to see what would be improved
|
|
135
|
+
• Enable watch mode for continuous optimization during development
|
|
136
|
+
• Check status regularly to monitor automation effectiveness
|
|
137
|
+
|
|
138
|
+
${chalk_1.default.blue('📚 Learn more: https://github.com/noormme/noormme')}
|
|
139
|
+
`);
|
|
140
|
+
// Error handling
|
|
141
|
+
program.configureOutput({
|
|
142
|
+
writeErr: (str) => process.stderr.write(chalk_1.default.red(str))
|
|
143
|
+
});
|
|
144
|
+
// Handle unknown commands
|
|
145
|
+
program.on('command:*', function (operands) {
|
|
146
|
+
console.error(chalk_1.default.red(`❌ Unknown command: ${operands[0]}`));
|
|
147
|
+
console.error(chalk_1.default.gray('See --help for a list of available commands.'));
|
|
148
|
+
process.exit(1);
|
|
149
|
+
});
|
|
150
|
+
// Parse command line arguments
|
|
151
|
+
program.parse();
|
|
152
|
+
// Show help if no command provided
|
|
153
|
+
if (!process.argv.slice(2).length) {
|
|
154
|
+
console.log(chalk_1.default.blue.bold('\n🎯 NOORMME - Automating SQLite with Intelligence\n'));
|
|
155
|
+
console.log(chalk_1.default.gray('The only SQLite ORM that automates everything. Built on Kysely\'s type-safe foundation.\n'));
|
|
156
|
+
program.outputHelp();
|
|
157
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Kysely } from '../kysely.js';
|
|
2
|
+
export interface SchemaMetadata {
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export interface TableMetadata {
|
|
6
|
+
name: string;
|
|
7
|
+
schema?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ColumnMetadata {
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
nullable: boolean;
|
|
13
|
+
defaultValue?: any;
|
|
14
|
+
isPrimaryKey: boolean;
|
|
15
|
+
isAutoIncrement: boolean;
|
|
16
|
+
maxLength?: number;
|
|
17
|
+
precision?: number;
|
|
18
|
+
scale?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface IndexMetadata {
|
|
21
|
+
name: string;
|
|
22
|
+
columns: string[];
|
|
23
|
+
unique: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface ForeignKeyMetadata {
|
|
26
|
+
name: string;
|
|
27
|
+
column: string;
|
|
28
|
+
referencedTable: string;
|
|
29
|
+
referencedColumn: string;
|
|
30
|
+
onDelete?: 'CASCADE' | 'SET NULL' | 'RESTRICT' | 'NO ACTION';
|
|
31
|
+
onUpdate?: 'CASCADE' | 'SET NULL' | 'RESTRICT' | 'NO ACTION';
|
|
32
|
+
}
|
|
33
|
+
export interface DatabaseMetadataOptions {
|
|
34
|
+
withInternalKyselyTables?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface DatabaseMetadata {
|
|
37
|
+
tables: TableMetadata[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Database introspector that queries database metadata
|
|
41
|
+
*/
|
|
42
|
+
export declare class DatabaseIntrospector {
|
|
43
|
+
protected db: Kysely<any>;
|
|
44
|
+
constructor(db: Kysely<any>);
|
|
45
|
+
/**
|
|
46
|
+
* Get all tables in the database
|
|
47
|
+
*/
|
|
48
|
+
getTables(): Promise<TableMetadata[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Get columns for a specific table
|
|
51
|
+
*/
|
|
52
|
+
getColumns(tableName: string): Promise<ColumnMetadata[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Get indexes for a specific table
|
|
55
|
+
*/
|
|
56
|
+
getIndexes(tableName: string): Promise<IndexMetadata[]>;
|
|
57
|
+
/**
|
|
58
|
+
* Get foreign keys for a specific table
|
|
59
|
+
*/
|
|
60
|
+
getForeignKeys(tableName: string): Promise<ForeignKeyMetadata[]>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatabaseIntrospector = void 0;
|
|
4
|
+
const sql_js_1 = require("../raw-builder/sql.js");
|
|
5
|
+
/**
|
|
6
|
+
* Database introspector that queries database metadata
|
|
7
|
+
*/
|
|
8
|
+
class DatabaseIntrospector {
|
|
9
|
+
db;
|
|
10
|
+
constructor(db) {
|
|
11
|
+
this.db = db;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Get all tables in the database
|
|
15
|
+
*/
|
|
16
|
+
async getTables() {
|
|
17
|
+
try {
|
|
18
|
+
// SQLite
|
|
19
|
+
const sqliteTables = await this.db
|
|
20
|
+
.selectFrom('sqlite_master')
|
|
21
|
+
.select('name')
|
|
22
|
+
.where('type', '=', 'table')
|
|
23
|
+
.where('name', 'not like', 'sqlite_%')
|
|
24
|
+
.execute();
|
|
25
|
+
return sqliteTables.map(t => ({
|
|
26
|
+
name: t.name
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.warn('SQLite table discovery failed:', error);
|
|
31
|
+
throw new Error('Unable to introspect database tables. SQLite database required.');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get columns for a specific table
|
|
36
|
+
*/
|
|
37
|
+
async getColumns(tableName) {
|
|
38
|
+
try {
|
|
39
|
+
// SQLite - use raw SQL for pragma_table_info
|
|
40
|
+
const result = await (0, sql_js_1.sql) `pragma_table_info(${sql_js_1.sql.lit(tableName)})`.execute(this.db);
|
|
41
|
+
const sqliteColumns = result.rows;
|
|
42
|
+
return sqliteColumns.map((col) => ({
|
|
43
|
+
name: col.name,
|
|
44
|
+
type: col.type,
|
|
45
|
+
nullable: !col.notnull,
|
|
46
|
+
defaultValue: col.dflt_value,
|
|
47
|
+
isPrimaryKey: !!col.pk,
|
|
48
|
+
isAutoIncrement: col.type.toLowerCase().includes('integer') && col.pk
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
console.warn('SQLite column discovery failed:', error);
|
|
53
|
+
throw new Error(`Unable to introspect columns for table '${tableName}'. SQLite database required.`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get indexes for a specific table
|
|
58
|
+
*/
|
|
59
|
+
async getIndexes(tableName) {
|
|
60
|
+
// TODO: Implement index discovery for different databases
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get foreign keys for a specific table
|
|
65
|
+
*/
|
|
66
|
+
async getForeignKeys(tableName) {
|
|
67
|
+
try {
|
|
68
|
+
// SQLite - use raw SQL for pragma_foreign_key_list
|
|
69
|
+
const result = await (0, sql_js_1.sql) `pragma_foreign_key_list(${sql_js_1.sql.lit(tableName)})`.execute(this.db);
|
|
70
|
+
const sqliteFks = result.rows;
|
|
71
|
+
return sqliteFks.map((fk) => ({
|
|
72
|
+
name: `fk_${tableName}_${fk.from}`,
|
|
73
|
+
column: fk.from,
|
|
74
|
+
referencedTable: fk.table,
|
|
75
|
+
referencedColumn: fk.to
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
console.warn('SQLite foreign key discovery failed:', error);
|
|
80
|
+
// Return empty array if foreign key discovery fails
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.DatabaseIntrospector = DatabaseIntrospector;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Kysely } from '../kysely.js';
|
|
2
|
+
import { DialectAdapter, MigrationLockOptions } from './dialect-adapter.js';
|
|
3
|
+
/**
|
|
4
|
+
* A basic implementation of `DialectAdapter` with sensible default values.
|
|
5
|
+
* Third-party dialects can extend this instead of implementing the `DialectAdapter`
|
|
6
|
+
* interface from scratch. That way all new settings will get default values when
|
|
7
|
+
* they are added and there will be less breaking changes.
|
|
8
|
+
*/
|
|
9
|
+
export declare abstract class DialectAdapterBase implements DialectAdapter {
|
|
10
|
+
/**
|
|
11
|
+
* Whether or not this dialect supports `if not exists` in creation of tables/schemas/views/etc.
|
|
12
|
+
*
|
|
13
|
+
* If this is false, Kysely's internal migrations tables and schemas are created
|
|
14
|
+
* without `if not exists` in migrations. This is not a problem if the dialect
|
|
15
|
+
* supports transactional DDL.
|
|
16
|
+
*/
|
|
17
|
+
get supportsCreateIfNotExists(): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Whether or not this dialect supports transactional DDL.
|
|
20
|
+
*
|
|
21
|
+
* If this is true, migrations are executed inside a transaction.
|
|
22
|
+
*/
|
|
23
|
+
get supportsTransactionalDdl(): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether or not this dialect supports the `returning` in inserts
|
|
26
|
+
* updates and deletes.
|
|
27
|
+
*/
|
|
28
|
+
get supportsReturning(): boolean;
|
|
29
|
+
get supportsOutput(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* This method is used to acquire a lock for the migrations so that
|
|
32
|
+
* it's not possible for two migration operations to run in parallel.
|
|
33
|
+
*
|
|
34
|
+
* Most dialects have explicit locks that can be used, like advisory locks
|
|
35
|
+
* in PostgreSQL and the get_lock function in MySQL.
|
|
36
|
+
*
|
|
37
|
+
* If the dialect doesn't have explicit locks the {@link MigrationLockOptions.lockTable}
|
|
38
|
+
* created by Kysely can be used instead. You can access it through the `options` object.
|
|
39
|
+
* The lock table has two columns `id` and `is_locked` and there's only one row in the table
|
|
40
|
+
* whose id is {@link MigrationLockOptions.lockRowId}. `is_locked` is an integer. Kysely
|
|
41
|
+
* takes care of creating the lock table and inserting the one single row to it before this
|
|
42
|
+
* method is executed. If the dialect supports schemas and the user has specified a custom
|
|
43
|
+
* schema in their migration settings, the options object also contains the schema name in
|
|
44
|
+
* {@link MigrationLockOptions.lockTableSchema}.
|
|
45
|
+
*
|
|
46
|
+
* Here's an example of how you might implement this method for a dialect that doesn't
|
|
47
|
+
* have explicit locks but supports `FOR UPDATE` row locks and transactional DDL:
|
|
48
|
+
*
|
|
49
|
+
* ```ts
|
|
50
|
+
* import { DialectAdapterBase, type MigrationLockOptions, Kysely } from 'kysely'
|
|
51
|
+
*
|
|
52
|
+
* export class MyAdapter extends DialectAdapterBase {
|
|
53
|
+
* override async acquireMigrationLock(
|
|
54
|
+
* db: Kysely<any>,
|
|
55
|
+
* options: MigrationLockOptions
|
|
56
|
+
* ): Promise<void> {
|
|
57
|
+
* const queryDb = options.lockTableSchema
|
|
58
|
+
* ? db.withSchema(options.lockTableSchema)
|
|
59
|
+
* : db
|
|
60
|
+
*
|
|
61
|
+
* // Since our imaginary dialect supports transactional DDL and has
|
|
62
|
+
* // row locks, we can simply take a row lock here and it will guarantee
|
|
63
|
+
* // all subsequent calls to this method from other transactions will
|
|
64
|
+
* // wait until this transaction finishes.
|
|
65
|
+
* await queryDb
|
|
66
|
+
* .selectFrom(options.lockTable)
|
|
67
|
+
* .selectAll()
|
|
68
|
+
* .where('id', '=', options.lockRowId)
|
|
69
|
+
* .forUpdate()
|
|
70
|
+
* .execute()
|
|
71
|
+
* }
|
|
72
|
+
*
|
|
73
|
+
* override async releaseMigrationLock() {
|
|
74
|
+
* // noop
|
|
75
|
+
* }
|
|
76
|
+
* }
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* If `supportsTransactionalDdl` is `true` then the `db` passed to this method
|
|
80
|
+
* is a transaction inside which the migrations will be executed. Otherwise
|
|
81
|
+
* `db` is a single connection (session) that will be used to execute the
|
|
82
|
+
* migrations.
|
|
83
|
+
*/
|
|
84
|
+
abstract acquireMigrationLock(db: Kysely<any>, options: MigrationLockOptions): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Releases the migration lock. See {@link acquireMigrationLock}.
|
|
87
|
+
*
|
|
88
|
+
* If `supportsTransactionalDdl` is `true` then the `db` passed to this method
|
|
89
|
+
* is a transaction inside which the migrations were executed. Otherwise `db`
|
|
90
|
+
* is a single connection (session) that was used to execute the migrations
|
|
91
|
+
* and the `acquireMigrationLock` call.
|
|
92
|
+
*/
|
|
93
|
+
abstract releaseMigrationLock(db: Kysely<any>, options: MigrationLockOptions): Promise<void>;
|
|
94
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DialectAdapterBase = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A basic implementation of `DialectAdapter` with sensible default values.
|
|
6
|
+
* Third-party dialects can extend this instead of implementing the `DialectAdapter`
|
|
7
|
+
* interface from scratch. That way all new settings will get default values when
|
|
8
|
+
* they are added and there will be less breaking changes.
|
|
9
|
+
*/
|
|
10
|
+
class DialectAdapterBase {
|
|
11
|
+
get supportsCreateIfNotExists() {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
get supportsTransactionalDdl() {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
get supportsReturning() {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
get supportsOutput() {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.DialectAdapterBase = DialectAdapterBase;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Kysely } from '../kysely.js';
|
|
2
|
+
/**
|
|
3
|
+
* A `DialectAdapter` encapsulates all differences between dialects outside
|
|
4
|
+
* of `Driver` and `QueryCompiler`.
|
|
5
|
+
*
|
|
6
|
+
* For example, some databases support transactional DDL and therefore we want
|
|
7
|
+
* to run migrations inside a transaction, while other databases don't support
|
|
8
|
+
* it. For that there's a `supportsTransactionalDdl` boolean in this interface.
|
|
9
|
+
*/
|
|
10
|
+
export interface DialectAdapter {
|
|
11
|
+
/**
|
|
12
|
+
* Whether or not this dialect supports `if not exists` in creation of tables/schemas/views/etc.
|
|
13
|
+
*
|
|
14
|
+
* If this is false, Kysely's internal migrations tables and schemas are created
|
|
15
|
+
* without `if not exists` in migrations. This is not a problem if the dialect
|
|
16
|
+
* supports transactional DDL.
|
|
17
|
+
*/
|
|
18
|
+
readonly supportsCreateIfNotExists: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether or not this dialect supports transactional DDL.
|
|
21
|
+
*
|
|
22
|
+
* If this is true, migrations are executed inside a transaction.
|
|
23
|
+
*/
|
|
24
|
+
readonly supportsTransactionalDdl: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether or not this dialect supports the `returning` in inserts
|
|
27
|
+
* updates and deletes.
|
|
28
|
+
*/
|
|
29
|
+
readonly supportsReturning: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether or not this dialect supports the `output` clause in inserts
|
|
32
|
+
* updates and deletes.
|
|
33
|
+
*/
|
|
34
|
+
readonly supportsOutput?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* This method is used to acquire a lock for the migrations so that
|
|
37
|
+
* it's not possible for two migration operations to run in parallel.
|
|
38
|
+
*
|
|
39
|
+
* Most dialects have explicit locks that can be used, like advisory locks
|
|
40
|
+
* in PostgreSQL and the get_lock function in MySQL.
|
|
41
|
+
*
|
|
42
|
+
* If the dialect doesn't have explicit locks the {@link MigrationLockOptions.lockTable}
|
|
43
|
+
* created by Kysely can be used instead. You can access it through the `options` object.
|
|
44
|
+
* The lock table has two columns `id` and `is_locked` and there's only one row in the table
|
|
45
|
+
* whose id is {@link MigrationLockOptions.lockRowId}. `is_locked` is an integer. Kysely
|
|
46
|
+
* takes care of creating the lock table and inserting the one single row to it before this
|
|
47
|
+
* method is executed. If the dialect supports schemas and the user has specified a custom
|
|
48
|
+
* schema in their migration settings, the options object also contains the schema name in
|
|
49
|
+
* {@link MigrationLockOptions.lockTableSchema}.
|
|
50
|
+
*
|
|
51
|
+
* Here's an example of how you might implement this method for a dialect that doesn't
|
|
52
|
+
* have explicit locks but supports `FOR UPDATE` row locks and transactional DDL:
|
|
53
|
+
*
|
|
54
|
+
* ```ts
|
|
55
|
+
* import { DialectAdapterBase, type MigrationLockOptions, Kysely } from 'kysely'
|
|
56
|
+
*
|
|
57
|
+
* export class MyAdapter extends DialectAdapterBase {
|
|
58
|
+
* override async acquireMigrationLock(
|
|
59
|
+
* db: Kysely<any>,
|
|
60
|
+
* options: MigrationLockOptions
|
|
61
|
+
* ): Promise<void> {
|
|
62
|
+
* const queryDb = options.lockTableSchema
|
|
63
|
+
* ? db.withSchema(options.lockTableSchema)
|
|
64
|
+
* : db
|
|
65
|
+
*
|
|
66
|
+
* // Since our imaginary dialect supports transactional DDL and has
|
|
67
|
+
* // row locks, we can simply take a row lock here and it will guarantee
|
|
68
|
+
* // all subsequent calls to this method from other transactions will
|
|
69
|
+
* // wait until this transaction finishes.
|
|
70
|
+
* await queryDb
|
|
71
|
+
* .selectFrom(options.lockTable)
|
|
72
|
+
* .selectAll()
|
|
73
|
+
* .where('id', '=', options.lockRowId)
|
|
74
|
+
* .forUpdate()
|
|
75
|
+
* .execute()
|
|
76
|
+
* }
|
|
77
|
+
*
|
|
78
|
+
* override async releaseMigrationLock() {
|
|
79
|
+
* // noop
|
|
80
|
+
* }
|
|
81
|
+
* }
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* If `supportsTransactionalDdl` is `true` then the `db` passed to this method
|
|
85
|
+
* is a transaction inside which the migrations will be executed. Otherwise
|
|
86
|
+
* `db` is a single connection (session) that will be used to execute the
|
|
87
|
+
* migrations.
|
|
88
|
+
*/
|
|
89
|
+
acquireMigrationLock(db: Kysely<any>, options: MigrationLockOptions): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Releases the migration lock. See {@link acquireMigrationLock}.
|
|
92
|
+
*
|
|
93
|
+
* If `supportsTransactionalDdl` is `true` then the `db` passed to this method
|
|
94
|
+
* is a transaction inside which the migrations were executed. Otherwise `db`
|
|
95
|
+
* is a single connection (session) that was used to execute the migrations
|
|
96
|
+
* and the `acquireMigrationLock` call.
|
|
97
|
+
*/
|
|
98
|
+
releaseMigrationLock(db: Kysely<any>, options: MigrationLockOptions): Promise<void>;
|
|
99
|
+
}
|
|
100
|
+
export interface MigrationLockOptions {
|
|
101
|
+
/**
|
|
102
|
+
* The name of the migration lock table.
|
|
103
|
+
*/
|
|
104
|
+
readonly lockTable: string;
|
|
105
|
+
/**
|
|
106
|
+
* The id of the only row in the migration lock table.
|
|
107
|
+
*/
|
|
108
|
+
readonly lockRowId: string;
|
|
109
|
+
/**
|
|
110
|
+
* The schema in which the migration lock table lives. This is only
|
|
111
|
+
* defined if the user has specified a custom schema in the migration
|
|
112
|
+
* settings.
|
|
113
|
+
*/
|
|
114
|
+
readonly lockTableSchema?: string;
|
|
115
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Driver } from '../driver/driver.js';
|
|
2
|
+
import { Kysely } from '../kysely.js';
|
|
3
|
+
import { QueryCompiler } from '../query-compiler/query-compiler.js';
|
|
4
|
+
import { DatabaseIntrospector } from './database-introspector.js';
|
|
5
|
+
import { DialectAdapter } from './dialect-adapter.js';
|
|
6
|
+
/**
|
|
7
|
+
* A Dialect is the glue between Kysely and the underlying database engine.
|
|
8
|
+
*
|
|
9
|
+
* See the built-in {@link PostgresDialect} as an example of a dialect.
|
|
10
|
+
* Users can implement their own dialects and use them by passing it
|
|
11
|
+
* in the {@link KyselyConfig.dialect} property.
|
|
12
|
+
*/
|
|
13
|
+
export interface Dialect {
|
|
14
|
+
/**
|
|
15
|
+
* Creates a driver for the dialect.
|
|
16
|
+
*/
|
|
17
|
+
createDriver(): Driver;
|
|
18
|
+
/**
|
|
19
|
+
* Creates a query compiler for the dialect.
|
|
20
|
+
*/
|
|
21
|
+
createQueryCompiler(): QueryCompiler;
|
|
22
|
+
/**
|
|
23
|
+
* Creates an adapter for the dialect.
|
|
24
|
+
*/
|
|
25
|
+
createAdapter(): DialectAdapter;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a database introspector that can be used to get database metadata
|
|
28
|
+
* such as the table names and column names of those tables.
|
|
29
|
+
*
|
|
30
|
+
* `db` never has any plugins installed. It's created using
|
|
31
|
+
* {@link Kysely.withoutPlugins}.
|
|
32
|
+
*/
|
|
33
|
+
createIntrospector(db: Kysely<any>): DatabaseIntrospector;
|
|
34
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Kysely } from '../../kysely.js';
|
|
2
|
+
import { DialectAdapterBase } from '../dialect-adapter-base.js';
|
|
3
|
+
import { MigrationLockOptions } from '../dialect-adapter.js';
|
|
4
|
+
export declare class SqliteAdapter extends DialectAdapterBase {
|
|
5
|
+
/**
|
|
6
|
+
* Whether or not this dialect supports transactional DDL.
|
|
7
|
+
*
|
|
8
|
+
* If this is true, migrations are executed inside a transaction.
|
|
9
|
+
*/
|
|
10
|
+
get supportsTransactionalDdl(): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether or not this dialect supports the `returning` in inserts
|
|
13
|
+
* updates and deletes.
|
|
14
|
+
*/
|
|
15
|
+
get supportsReturning(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* This method is used to acquire a lock for the migrations so that
|
|
18
|
+
* it's not possible for two migration operations to run in parallel.
|
|
19
|
+
*
|
|
20
|
+
* Most dialects have explicit locks that can be used, like advisory locks
|
|
21
|
+
* in PostgreSQL and the get_lock function in MySQL.
|
|
22
|
+
*
|
|
23
|
+
* If the dialect doesn't have explicit locks the {@link MigrationLockOptions.lockTable}
|
|
24
|
+
* created by Kysely can be used instead. You can access it through the `options` object.
|
|
25
|
+
* The lock table has two columns `id` and `is_locked` and there's only one row in the table
|
|
26
|
+
* whose id is {@link MigrationLockOptions.lockRowId}. `is_locked` is an integer. Kysely
|
|
27
|
+
* takes care of creating the lock table and inserting the one single row to it before this
|
|
28
|
+
* method is executed. If the dialect supports schemas and the user has specified a custom
|
|
29
|
+
* schema in their migration settings, the options object also contains the schema name in
|
|
30
|
+
* {@link MigrationLockOptions.lockTableSchema}.
|
|
31
|
+
*
|
|
32
|
+
* Here's an example of how you might implement this method for a dialect that doesn't
|
|
33
|
+
* have explicit locks but supports `FOR UPDATE` row locks and transactional DDL:
|
|
34
|
+
*
|
|
35
|
+
* ```ts
|
|
36
|
+
* import { DialectAdapterBase, type MigrationLockOptions, Kysely } from 'kysely'
|
|
37
|
+
*
|
|
38
|
+
* export class MyAdapter extends DialectAdapterBase {
|
|
39
|
+
* override async acquireMigrationLock(
|
|
40
|
+
* db: Kysely<any>,
|
|
41
|
+
* options: MigrationLockOptions
|
|
42
|
+
* ): Promise<void> {
|
|
43
|
+
* const queryDb = options.lockTableSchema
|
|
44
|
+
* ? db.withSchema(options.lockTableSchema)
|
|
45
|
+
* : db
|
|
46
|
+
*
|
|
47
|
+
* // Since our imaginary dialect supports transactional DDL and has
|
|
48
|
+
* // row locks, we can simply take a row lock here and it will guarantee
|
|
49
|
+
* // all subsequent calls to this method from other transactions will
|
|
50
|
+
* // wait until this transaction finishes.
|
|
51
|
+
* await queryDb
|
|
52
|
+
* .selectFrom(options.lockTable)
|
|
53
|
+
* .selectAll()
|
|
54
|
+
* .where('id', '=', options.lockRowId)
|
|
55
|
+
* .forUpdate()
|
|
56
|
+
* .execute()
|
|
57
|
+
* }
|
|
58
|
+
*
|
|
59
|
+
* override async releaseMigrationLock() {
|
|
60
|
+
* // noop
|
|
61
|
+
* }
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* If `supportsTransactionalDdl` is `true` then the `db` passed to this method
|
|
66
|
+
* is a transaction inside which the migrations will be executed. Otherwise
|
|
67
|
+
* `db` is a single connection (session) that will be used to execute the
|
|
68
|
+
* migrations.
|
|
69
|
+
*/
|
|
70
|
+
acquireMigrationLock(_db: Kysely<any>, _opt: MigrationLockOptions): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Releases the migration lock. See {@link acquireMigrationLock}.
|
|
73
|
+
*
|
|
74
|
+
* If `supportsTransactionalDdl` is `true` then the `db` passed to this method
|
|
75
|
+
* is a transaction inside which the migrations were executed. Otherwise `db`
|
|
76
|
+
* is a single connection (session) that was used to execute the migrations
|
|
77
|
+
* and the `acquireMigrationLock` call.
|
|
78
|
+
*/
|
|
79
|
+
releaseMigrationLock(_db: Kysely<any>, _opt: MigrationLockOptions): Promise<void>;
|
|
80
|
+
}
|