sqlew 5.0.8 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/README.md +19 -10
- package/dist/adapters/auth/auth-factory.d.ts +2 -81
- package/dist/adapters/auth/auth-factory.d.ts.map +1 -1
- package/dist/adapters/auth/auth-factory.js +2 -82
- package/dist/adapters/auth/auth-factory.js.map +1 -1
- package/dist/adapters/auth/base-auth-provider.d.ts +18 -303
- package/dist/adapters/auth/base-auth-provider.d.ts.map +1 -1
- package/dist/adapters/auth/base-auth-provider.js +2 -104
- package/dist/adapters/auth/base-auth-provider.js.map +1 -1
- package/dist/adapters/auth/direct-auth-provider.d.ts +4 -348
- package/dist/adapters/auth/direct-auth-provider.d.ts.map +1 -1
- package/dist/adapters/auth/direct-auth-provider.js +6 -356
- package/dist/adapters/auth/direct-auth-provider.js.map +1 -1
- package/dist/adapters/base-adapter.d.ts +31 -598
- package/dist/adapters/base-adapter.d.ts.map +1 -1
- package/dist/adapters/base-adapter.js +10 -458
- package/dist/adapters/base-adapter.js.map +1 -1
- package/dist/adapters/index.d.ts +1 -11
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +1 -11
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/mysql-adapter.d.ts +15 -541
- package/dist/adapters/mysql-adapter.d.ts.map +1 -1
- package/dist/adapters/mysql-adapter.js +24 -561
- package/dist/adapters/mysql-adapter.js.map +1 -1
- package/dist/adapters/postgresql-adapter.d.ts +15 -203
- package/dist/adapters/postgresql-adapter.d.ts.map +1 -1
- package/dist/adapters/postgresql-adapter.js +24 -223
- package/dist/adapters/postgresql-adapter.js.map +1 -1
- package/dist/adapters/sqlite-adapter.d.ts +4 -28
- package/dist/adapters/sqlite-adapter.d.ts.map +1 -1
- package/dist/adapters/sqlite-adapter.js +4 -32
- package/dist/adapters/sqlite-adapter.js.map +1 -1
- package/dist/adapters/types.d.ts +1 -4
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/backend/backend-factory.d.ts +3 -3
- package/dist/backend/backend-factory.js +3 -3
- package/dist/backend/local-backend.d.ts.map +1 -1
- package/dist/backend/local-backend.js +0 -5
- package/dist/backend/local-backend.js.map +1 -1
- package/dist/cli/db-export.d.ts.map +1 -1
- package/dist/cli/db-export.js +54 -32
- package/dist/cli/db-export.js.map +1 -1
- package/dist/cli/db-import.d.ts.map +1 -1
- package/dist/cli/db-import.js +32 -31
- package/dist/cli/db-import.js.map +1 -1
- package/dist/cli/hooks/on-exit-plan.d.ts.map +1 -1
- package/dist/cli/hooks/on-exit-plan.js +42 -1
- package/dist/cli/hooks/on-exit-plan.js.map +1 -1
- package/dist/cli/hooks/on-prompt.d.ts.map +1 -1
- package/dist/cli/hooks/on-prompt.js +5 -0
- package/dist/cli/hooks/on-prompt.js.map +1 -1
- package/dist/cli/hooks/plan-processor.d.ts.map +1 -1
- package/dist/cli/hooks/plan-processor.js +16 -2
- package/dist/cli/hooks/plan-processor.js.map +1 -1
- package/dist/cli/hooks/stdin-parser.d.ts +41 -0
- package/dist/cli/hooks/stdin-parser.d.ts.map +1 -1
- package/dist/cli/hooks/stdin-parser.js +140 -4
- package/dist/cli/hooks/stdin-parser.js.map +1 -1
- package/dist/cli/hooks/track-plan.d.ts +13 -0
- package/dist/cli/hooks/track-plan.d.ts.map +1 -1
- package/dist/cli/hooks/track-plan.js +58 -3
- package/dist/cli/hooks/track-plan.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -12
- package/dist/cli.js.map +1 -1
- package/dist/config/cloud-config-loader.d.ts +8 -8
- package/dist/config/cloud-config-loader.d.ts.map +1 -1
- package/dist/config/cloud-config-loader.js +12 -12
- package/dist/config/cloud-config-loader.js.map +1 -1
- package/dist/config/global-config.d.ts +24 -46
- package/dist/config/global-config.d.ts.map +1 -1
- package/dist/config/global-config.js +174 -56
- package/dist/config/global-config.js.map +1 -1
- package/dist/config/loader.d.ts +1 -18
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +1 -89
- package/dist/config/loader.js.map +1 -1
- package/dist/config/types.d.ts +2 -64
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +0 -18
- package/dist/config/types.js.map +1 -1
- package/dist/database/index.d.ts +1 -2
- package/dist/database/index.d.ts.map +1 -1
- package/dist/database/index.js +1 -3
- package/dist/database/index.js.map +1 -1
- package/dist/database/migrations/v4/20251126000001_v4_migrate_data.d.ts.map +1 -1
- package/dist/database/migrations/v4/20251126000001_v4_migrate_data.js +2 -1
- package/dist/database/migrations/v4/20251126000001_v4_migrate_data.js.map +1 -1
- package/dist/database/operations/queries.d.ts +0 -4
- package/dist/database/operations/queries.d.ts.map +1 -1
- package/dist/database/operations/queries.js +0 -8
- package/dist/database/operations/queries.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/init-rules.d.ts.map +1 -1
- package/dist/init-rules.js +0 -1
- package/dist/init-rules.js.map +1 -1
- package/dist/knexfile.d.ts.map +1 -1
- package/dist/knexfile.js +2 -1
- package/dist/knexfile.js.map +1 -1
- package/dist/migration/local-to-global.d.ts +19 -0
- package/dist/migration/local-to-global.d.ts.map +1 -0
- package/dist/migration/local-to-global.js +133 -0
- package/dist/migration/local-to-global.js.map +1 -0
- package/dist/saas-connector/client/types.d.ts +1 -1
- package/dist/saas-connector/client/types.d.ts.map +1 -1
- package/dist/schema.js +1 -1
- package/dist/server/setup.d.ts.map +1 -1
- package/dist/server/setup.js +15 -7
- package/dist/server/setup.js.map +1 -1
- package/dist/tests/backend/backend-factory.test.js +2 -2
- package/dist/tests/backend/backend-factory.test.js.map +1 -1
- package/dist/tests/docker/native/constraint-operations.test.d.ts +2 -17
- package/dist/tests/docker/native/constraint-operations.test.d.ts.map +1 -1
- package/dist/tests/docker/native/constraint-operations.test.js +3 -82
- package/dist/tests/docker/native/constraint-operations.test.js.map +1 -1
- package/dist/tests/docker/native/db-init.d.ts +3 -34
- package/dist/tests/docker/native/db-init.d.ts.map +1 -1
- package/dist/tests/docker/native/db-init.js +15 -77
- package/dist/tests/docker/native/db-init.js.map +1 -1
- package/dist/tests/docker/native/decision-operations.test.d.ts +2 -10
- package/dist/tests/docker/native/decision-operations.test.d.ts.map +1 -1
- package/dist/tests/docker/native/decision-operations.test.js +2 -84
- package/dist/tests/docker/native/decision-operations.test.js.map +1 -1
- package/dist/tests/docker/native/help-system.test.d.ts +2 -5
- package/dist/tests/docker/native/help-system.test.d.ts.map +1 -1
- package/dist/tests/docker/native/help-system.test.js +2 -47
- package/dist/tests/docker/native/help-system.test.js.map +1 -1
- package/dist/tests/docker/native/suggest-tool.test.d.ts +3 -11
- package/dist/tests/docker/native/suggest-tool.test.d.ts.map +1 -1
- package/dist/tests/docker/native/suggest-tool.test.js +3 -60
- package/dist/tests/docker/native/suggest-tool.test.js.map +1 -1
- package/dist/tests/docker/native/test-harness.d.ts +2 -23
- package/dist/tests/docker/native/test-harness.d.ts.map +1 -1
- package/dist/tests/docker/native/test-harness.js +5 -59
- package/dist/tests/docker/native/test-harness.js.map +1 -1
- package/dist/tests/feature/decision/analytics.test.js +2 -1
- package/dist/tests/feature/decision/analytics.test.js.map +1 -1
- package/dist/tests/feature/decision/batch-validation-comprehensive.test.js +2 -7
- package/dist/tests/feature/decision/batch-validation-comprehensive.test.js.map +1 -1
- package/dist/tests/feature/decision/batch-validation.test.js +2 -1
- package/dist/tests/feature/decision/batch-validation.test.js.map +1 -1
- package/dist/tests/integration/auto-trigger-suggestions.test.js +4 -37
- package/dist/tests/integration/auto-trigger-suggestions.test.js.map +1 -1
- package/dist/tests/integration/hybrid-similarity-detection.test.js +2 -1
- package/dist/tests/integration/hybrid-similarity-detection.test.js.map +1 -1
- package/dist/tests/integration/json-export-import.test.d.ts.map +1 -0
- package/dist/tests/integration/json-export-import.test.js.map +1 -0
- package/dist/tests/unit/case-insensitive-validator.test.d.ts +0 -7
- package/dist/tests/unit/case-insensitive-validator.test.d.ts.map +1 -1
- package/dist/tests/unit/case-insensitive-validator.test.js +0 -22
- package/dist/tests/unit/case-insensitive-validator.test.js.map +1 -1
- package/dist/tests/unit/config/cloud-config-loader.test.js +4 -2
- package/dist/tests/unit/config/cloud-config-loader.test.js.map +1 -1
- package/dist/tests/unit/config/global-db-migration.test.d.ts +12 -0
- package/dist/tests/unit/config/global-db-migration.test.d.ts.map +1 -0
- package/dist/tests/unit/config/global-db-migration.test.js +117 -0
- package/dist/tests/unit/config/global-db-migration.test.js.map +1 -0
- package/dist/tests/unit/constraint-scorer.test.d.ts +2 -7
- package/dist/tests/unit/constraint-scorer.test.d.ts.map +1 -1
- package/dist/tests/unit/constraint-scorer.test.js +2 -28
- package/dist/tests/unit/constraint-scorer.test.js.map +1 -1
- package/dist/tests/unit/hooks/grok-hook-normalization.test.d.ts +9 -0
- package/dist/tests/unit/hooks/grok-hook-normalization.test.d.ts.map +1 -0
- package/dist/tests/unit/hooks/grok-hook-normalization.test.js +98 -0
- package/dist/tests/unit/hooks/grok-hook-normalization.test.js.map +1 -0
- package/dist/tests/unit/hooks/grok-plan-template-injection.test.d.ts +7 -0
- package/dist/tests/unit/hooks/grok-plan-template-injection.test.d.ts.map +1 -0
- package/dist/tests/unit/hooks/grok-plan-template-injection.test.js +55 -0
- package/dist/tests/unit/hooks/grok-plan-template-injection.test.js.map +1 -0
- package/dist/tests/unit/universal-knex.test.js +9 -0
- package/dist/tests/unit/universal-knex.test.js.map +1 -1
- package/dist/tests/unit/validation/parameter-validation.test.js +0 -24
- package/dist/tests/unit/validation/parameter-validation.test.js.map +1 -1
- package/dist/tests/utils/db-config.d.ts.map +1 -1
- package/dist/tests/utils/db-config.js +0 -9
- package/dist/tests/utils/db-config.js.map +1 -1
- package/dist/tests/utils/db-import.d.ts.map +1 -1
- package/dist/tests/utils/db-import.js +0 -3
- package/dist/tests/utils/db-import.js.map +1 -1
- package/dist/tests/utils/db-schema.d.ts.map +1 -1
- package/dist/tests/utils/db-schema.js +48 -51
- package/dist/tests/utils/db-schema.js.map +1 -1
- package/dist/tests/utils/db-seeding.d.ts.map +1 -1
- package/dist/tests/utils/db-seeding.js +0 -3
- package/dist/tests/utils/db-seeding.js.map +1 -1
- package/dist/tests/utils/index.d.ts +0 -1
- package/dist/tests/utils/index.d.ts.map +1 -1
- package/dist/tests/utils/index.js +0 -2
- package/dist/tests/utils/index.js.map +1 -1
- package/dist/tests/utils/test-helpers.d.ts +6 -76
- package/dist/tests/utils/test-helpers.d.ts.map +1 -1
- package/dist/tests/utils/test-helpers.js +56 -162
- package/dist/tests/utils/test-helpers.js.map +1 -1
- package/dist/tests/utils/test-lifecycle.d.ts +2 -28
- package/dist/tests/utils/test-lifecycle.d.ts.map +1 -1
- package/dist/tests/utils/test-lifecycle.js +2 -31
- package/dist/tests/utils/test-lifecycle.js.map +1 -1
- package/dist/tools/context/index.d.ts +0 -1
- package/dist/tools/context/index.d.ts.map +1 -1
- package/dist/tools/context/index.js +0 -2
- package/dist/tools/context/index.js.map +1 -1
- package/dist/tools/context/types.d.ts +1 -1
- package/dist/tools/context/types.d.ts.map +1 -1
- package/dist/types/actions.d.ts +6 -29
- package/dist/types/actions.d.ts.map +1 -1
- package/dist/types/actions.js +1 -2
- package/dist/types/actions.js.map +1 -1
- package/dist/types/constraint/params.d.ts +24 -1
- package/dist/types/constraint/params.d.ts.map +1 -1
- package/dist/types/constraint/params.js +3 -0
- package/dist/types/constraint/params.js.map +1 -1
- package/dist/types/constraint/responses.d.ts +18 -1
- package/dist/types/constraint/responses.d.ts.map +1 -1
- package/dist/types/constraint/responses.js +3 -0
- package/dist/types/constraint/responses.js.map +1 -1
- package/dist/types/decision/batch.d.ts +2 -5
- package/dist/types/decision/batch.d.ts.map +1 -1
- package/dist/types/decision/batch.js +3 -3
- package/dist/types/decision/batch.js.map +1 -1
- package/dist/types/decision/params.d.ts +7 -4
- package/dist/types/decision/params.d.ts.map +1 -1
- package/dist/types/decision/responses.d.ts +49 -35
- package/dist/types/decision/responses.d.ts.map +1 -1
- package/dist/types/decision/templates.d.ts +2 -18
- package/dist/types/decision/templates.d.ts.map +1 -1
- package/dist/types/decision/templates.js +3 -3
- package/dist/types/decision/templates.js.map +1 -1
- package/dist/types/enums.d.ts +11 -13
- package/dist/types/enums.d.ts.map +1 -1
- package/dist/types/enums.js +5 -13
- package/dist/types/enums.js.map +1 -1
- package/dist/types/import-export.d.ts +7 -30
- package/dist/types/import-export.d.ts.map +1 -1
- package/dist/types/import-export.js +1 -2
- package/dist/types/import-export.js.map +1 -1
- package/dist/types/index.d.ts +18 -22
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +4 -32
- package/dist/types/index.js.map +1 -1
- package/dist/types/master-entities.d.ts +1 -10
- package/dist/types/master-entities.d.ts.map +1 -1
- package/dist/types/master-entities.js +1 -2
- package/dist/types/master-entities.js.map +1 -1
- package/dist/types/transaction-entities.d.ts +2 -21
- package/dist/types/transaction-entities.d.ts.map +1 -1
- package/dist/types/transaction-entities.js +1 -1
- package/dist/types/validation.d.ts +1 -16
- package/dist/types/validation.d.ts.map +1 -1
- package/dist/types/validation.js +1 -2
- package/dist/types/validation.js.map +1 -1
- package/dist/types/view-entities.d.ts +3 -12
- package/dist/types/view-entities.d.ts.map +1 -1
- package/dist/types/view-entities.js +1 -1
- package/dist/types.d.ts +4 -718
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +5 -39
- package/dist/types.js.map +1 -1
- package/dist/utils/parameter-validator.d.ts +2 -2
- package/dist/utils/parameter-validator.d.ts.map +1 -1
- package/dist/utils/parameter-validator.js.map +1 -1
- package/dist/utils/path-normalize.d.ts +23 -0
- package/dist/utils/path-normalize.d.ts.map +1 -0
- package/dist/utils/path-normalize.js +38 -0
- package/dist/utils/path-normalize.js.map +1 -0
- package/dist/utils/project-root.d.ts +6 -3
- package/dist/utils/project-root.d.ts.map +1 -1
- package/dist/utils/project-root.js +11 -3
- package/dist/utils/project-root.js.map +1 -1
- package/dist/watcher/base-watcher.d.ts +0 -4
- package/dist/watcher/base-watcher.d.ts.map +1 -1
- package/dist/watcher/base-watcher.js +11 -22
- package/dist/watcher/base-watcher.js.map +1 -1
- package/docs/CLI_USAGE.md +27 -107
- package/docs/CONFIGURATION.md +10 -5
- package/docs/DATABASE_AUTH.md +3 -3
- package/docs/HOOKS_GUIDE.md +40 -6
- package/docs/MIGRATION_TO_SAAS.md +2 -2
- package/docs/SHARED_DATABASE.md +108 -0
- package/package.json +4 -3
- package/dist/adapters/auth/auth-types.d.ts +0 -30
- package/dist/adapters/auth/auth-types.d.ts.map +0 -1
- package/dist/adapters/auth/auth-types.js +0 -30
- package/dist/adapters/auth/auth-types.js.map +0 -1
- package/dist/cli/db-dump.d.ts +0 -36
- package/dist/cli/db-dump.d.ts.map +0 -1
- package/dist/cli/db-dump.js +0 -384
- package/dist/cli/db-dump.js.map +0 -1
- package/dist/database/config/config-ops.d.ts +0 -42
- package/dist/database/config/config-ops.d.ts.map +0 -1
- package/dist/database/config/config-ops.js +0 -102
- package/dist/database/config/config-ops.js.map +0 -1
- package/dist/formatters/adr-formatter.d.ts +0 -22
- package/dist/formatters/adr-formatter.d.ts.map +0 -1
- package/dist/formatters/adr-formatter.js +0 -127
- package/dist/formatters/adr-formatter.js.map +0 -1
- package/dist/formatters/confluence-formatter.d.ts +0 -26
- package/dist/formatters/confluence-formatter.d.ts.map +0 -1
- package/dist/formatters/confluence-formatter.js +0 -129
- package/dist/formatters/confluence-formatter.js.map +0 -1
- package/dist/formatters/index.d.ts +0 -34
- package/dist/formatters/index.d.ts.map +0 -1
- package/dist/formatters/index.js +0 -57
- package/dist/formatters/index.js.map +0 -1
- package/dist/formatters/markdown-formatter.d.ts +0 -16
- package/dist/formatters/markdown-formatter.d.ts.map +0 -1
- package/dist/formatters/markdown-formatter.js +0 -110
- package/dist/formatters/markdown-formatter.js.map +0 -1
- package/dist/formatters/notion-formatter.d.ts +0 -29
- package/dist/formatters/notion-formatter.d.ts.map +0 -1
- package/dist/formatters/notion-formatter.js +0 -177
- package/dist/formatters/notion-formatter.js.map +0 -1
- package/dist/formatters/types.d.ts +0 -31
- package/dist/formatters/types.d.ts.map +0 -1
- package/dist/formatters/types.js +0 -6
- package/dist/formatters/types.js.map +0 -1
- package/dist/tests/database/sql-dump/converters.test.d.ts +0 -7
- package/dist/tests/database/sql-dump/converters.test.d.ts.map +0 -1
- package/dist/tests/database/sql-dump/converters.test.js +0 -314
- package/dist/tests/database/sql-dump/converters.test.js.map +0 -1
- package/dist/tests/database/sql-dump/default-conversions.test.d.ts +0 -8
- package/dist/tests/database/sql-dump/default-conversions.test.d.ts.map +0 -1
- package/dist/tests/database/sql-dump/default-conversions.test.js +0 -141
- package/dist/tests/database/sql-dump/default-conversions.test.js.map +0 -1
- package/dist/tests/database/sql-dump/table-ordering.test.d.ts +0 -27
- package/dist/tests/database/sql-dump/table-ordering.test.d.ts.map +0 -1
- package/dist/tests/database/sql-dump/table-ordering.test.js +0 -284
- package/dist/tests/database/sql-dump/table-ordering.test.js.map +0 -1
- package/dist/tests/database/sql-dump/type-conversion.test.d.ts +0 -8
- package/dist/tests/database/sql-dump/type-conversion.test.d.ts.map +0 -1
- package/dist/tests/database/sql-dump/type-conversion.test.js +0 -361
- package/dist/tests/database/sql-dump/type-conversion.test.js.map +0 -1
- package/dist/tests/docker/cross-database.test.d.ts +0 -21
- package/dist/tests/docker/cross-database.test.d.ts.map +0 -1
- package/dist/tests/docker/cross-database.test.js +0 -308
- package/dist/tests/docker/cross-database.test.js.map +0 -1
- package/dist/tests/docker/dump-import.test.d.ts +0 -15
- package/dist/tests/docker/dump-import.test.d.ts.map +0 -1
- package/dist/tests/docker/dump-import.test.js +0 -424
- package/dist/tests/docker/dump-import.test.js.map +0 -1
- package/dist/tests/docker/fk-constraints.test.d.ts +0 -13
- package/dist/tests/docker/fk-constraints.test.d.ts.map +0 -1
- package/dist/tests/docker/fk-constraints.test.js +0 -381
- package/dist/tests/docker/fk-constraints.test.js.map +0 -1
- package/dist/tests/docker/indexes.test.d.ts +0 -12
- package/dist/tests/docker/indexes.test.d.ts.map +0 -1
- package/dist/tests/docker/indexes.test.js +0 -250
- package/dist/tests/docker/indexes.test.js.map +0 -1
- package/dist/tests/docker/integration.test.d.ts +0 -16
- package/dist/tests/docker/integration.test.d.ts.map +0 -1
- package/dist/tests/docker/integration.test.js +0 -323
- package/dist/tests/docker/integration.test.js.map +0 -1
- package/dist/tests/docker/multi-project-migration.test.d.ts +0 -17
- package/dist/tests/docker/multi-project-migration.test.d.ts.map +0 -1
- package/dist/tests/docker/multi-project-migration.test.js +0 -394
- package/dist/tests/docker/multi-project-migration.test.js.map +0 -1
- package/dist/tests/docker/schema-migration.test.d.ts +0 -8
- package/dist/tests/docker/schema-migration.test.d.ts.map +0 -1
- package/dist/tests/docker/schema-migration.test.js +0 -98
- package/dist/tests/docker/schema-migration.test.js.map +0 -1
- package/dist/tests/integration/e2e-workflow1-debug.test.d.ts +0 -5
- package/dist/tests/integration/e2e-workflow1-debug.test.d.ts.map +0 -1
- package/dist/tests/integration/e2e-workflow1-debug.test.js +0 -85
- package/dist/tests/integration/e2e-workflow1-debug.test.js.map +0 -1
- package/dist/tests/integration/suggest-simple.test.d.ts +0 -5
- package/dist/tests/integration/suggest-simple.test.d.ts.map +0 -1
- package/dist/tests/integration/suggest-simple.test.js +0 -90
- package/dist/tests/integration/suggest-simple.test.js.map +0 -1
- package/dist/tests/migrations/test-all-versions-real.d.ts +0 -8
- package/dist/tests/migrations/test-all-versions-real.d.ts.map +0 -1
- package/dist/tests/migrations/test-all-versions-real.js +0 -236
- package/dist/tests/migrations/test-all-versions-real.js.map +0 -1
- package/dist/tests/migrations/test-all-versions.d.ts +0 -14
- package/dist/tests/migrations/test-all-versions.d.ts.map +0 -1
- package/dist/tests/migrations/test-all-versions.js +0 -519
- package/dist/tests/migrations/test-all-versions.js.map +0 -1
- package/dist/tests/migrations/v4/v4-fresh-install.test.d.ts +0 -7
- package/dist/tests/migrations/v4/v4-fresh-install.test.d.ts.map +0 -1
- package/dist/tests/migrations/v4/v4-fresh-install.test.js +0 -168
- package/dist/tests/migrations/v4/v4-fresh-install.test.js.map +0 -1
- package/dist/tests/migrations/v4/v4-migrate-data.test.d.ts +0 -13
- package/dist/tests/migrations/v4/v4-migrate-data.test.d.ts.map +0 -1
- package/dist/tests/migrations/v4/v4-migrate-data.test.js +0 -264
- package/dist/tests/migrations/v4/v4-migrate-data.test.js.map +0 -1
- package/dist/tests/unit/utils/case-insensitive-validator.test.d.ts +0 -2
- package/dist/tests/unit/utils/case-insensitive-validator.test.d.ts.map +0 -1
- package/dist/tests/unit/utils/case-insensitive-validator.test.js +0 -97
- package/dist/tests/unit/utils/case-insensitive-validator.test.js.map +0 -1
- package/dist/tests/utils/json-export-import.test.d.ts.map +0 -1
- package/dist/tests/utils/json-export-import.test.js.map +0 -1
- package/dist/tests/utils/task-helpers.d.ts +0 -67
- package/dist/tests/utils/task-helpers.d.ts.map +0 -1
- package/dist/tests/utils/task-helpers.js +0 -134
- package/dist/tests/utils/task-helpers.js.map +0 -1
- package/dist/tools/context/actions/export.d.ts +0 -35
- package/dist/tools/context/actions/export.d.ts.map +0 -1
- package/dist/tools/context/actions/export.js +0 -93
- package/dist/tools/context/actions/export.js.map +0 -1
- package/dist/types/file/params.d.ts +0 -40
- package/dist/types/file/params.d.ts.map +0 -1
- package/dist/types/file/params.js +0 -6
- package/dist/types/file/params.js.map +0 -1
- package/dist/types/file/responses.d.ts +0 -2
- package/dist/types/file/responses.d.ts.map +0 -1
- package/dist/types/file/responses.js +0 -2
- package/dist/types/file/responses.js.map +0 -1
- package/dist/types/task/params.d.ts +0 -173
- package/dist/types/task/params.d.ts.map +0 -1
- package/dist/types/task/params.js +0 -8
- package/dist/types/task/params.js.map +0 -1
- package/dist/types/task/responses.d.ts +0 -334
- package/dist/types/task/responses.d.ts.map +0 -1
- package/dist/types/task/responses.js +0 -8
- package/dist/types/task/responses.js.map +0 -1
- package/dist/utils/sql-dump/core/dependency-sort.d.ts +0 -16
- package/dist/utils/sql-dump/core/dependency-sort.d.ts.map +0 -1
- package/dist/utils/sql-dump/core/dependency-sort.js +0 -105
- package/dist/utils/sql-dump/core/dependency-sort.js.map +0 -1
- package/dist/utils/sql-dump/core/generate-dump.d.ts +0 -13
- package/dist/utils/sql-dump/core/generate-dump.d.ts.map +0 -1
- package/dist/utils/sql-dump/core/generate-dump.js +0 -201
- package/dist/utils/sql-dump/core/generate-dump.js.map +0 -1
- package/dist/utils/sql-dump/core/index-export.d.ts +0 -10
- package/dist/utils/sql-dump/core/index-export.d.ts.map +0 -1
- package/dist/utils/sql-dump/core/index-export.js +0 -173
- package/dist/utils/sql-dump/core/index-export.js.map +0 -1
- package/dist/utils/sql-dump/core/sequence-reset.d.ts +0 -6
- package/dist/utils/sql-dump/core/sequence-reset.d.ts.map +0 -1
- package/dist/utils/sql-dump/core/sequence-reset.js +0 -28
- package/dist/utils/sql-dump/core/sequence-reset.js.map +0 -1
- package/dist/utils/sql-dump/core/table-export.d.ts +0 -2
- package/dist/utils/sql-dump/core/table-export.d.ts.map +0 -1
- package/dist/utils/sql-dump/core/table-export.js +0 -4
- package/dist/utils/sql-dump/core/table-export.js.map +0 -1
- package/dist/utils/sql-dump/core/view-export.d.ts +0 -2
- package/dist/utils/sql-dump/core/view-export.d.ts.map +0 -1
- package/dist/utils/sql-dump/core/view-export.js +0 -4
- package/dist/utils/sql-dump/core/view-export.js.map +0 -1
- package/dist/utils/sql-dump/formatters/bulk-insert.d.ts +0 -14
- package/dist/utils/sql-dump/formatters/bulk-insert.d.ts.map +0 -1
- package/dist/utils/sql-dump/formatters/bulk-insert.js +0 -177
- package/dist/utils/sql-dump/formatters/bulk-insert.js.map +0 -1
- package/dist/utils/sql-dump/formatters/identifiers.d.ts +0 -6
- package/dist/utils/sql-dump/formatters/identifiers.d.ts.map +0 -1
- package/dist/utils/sql-dump/formatters/identifiers.js +0 -16
- package/dist/utils/sql-dump/formatters/identifiers.js.map +0 -1
- package/dist/utils/sql-dump/formatters/value-formatter.d.ts +0 -14
- package/dist/utils/sql-dump/formatters/value-formatter.d.ts.map +0 -1
- package/dist/utils/sql-dump/formatters/value-formatter.js +0 -281
- package/dist/utils/sql-dump/formatters/value-formatter.js.map +0 -1
- package/dist/utils/sql-dump/generators/controls.d.ts +0 -10
- package/dist/utils/sql-dump/generators/controls.d.ts.map +0 -1
- package/dist/utils/sql-dump/generators/controls.js +0 -36
- package/dist/utils/sql-dump/generators/controls.js.map +0 -1
- package/dist/utils/sql-dump/generators/headers.d.ts +0 -6
- package/dist/utils/sql-dump/generators/headers.d.ts.map +0 -1
- package/dist/utils/sql-dump/generators/headers.js +0 -19
- package/dist/utils/sql-dump/generators/headers.js.map +0 -1
- package/dist/utils/sql-dump/index.d.ts +0 -14
- package/dist/utils/sql-dump/index.d.ts.map +0 -1
- package/dist/utils/sql-dump/index.js +0 -16
- package/dist/utils/sql-dump/index.js.map +0 -1
- package/dist/utils/sql-dump/schema/indexes.d.ts +0 -20
- package/dist/utils/sql-dump/schema/indexes.d.ts.map +0 -1
- package/dist/utils/sql-dump/schema/indexes.js +0 -108
- package/dist/utils/sql-dump/schema/indexes.js.map +0 -1
- package/dist/utils/sql-dump/schema/primary-keys.d.ts +0 -6
- package/dist/utils/sql-dump/schema/primary-keys.d.ts.map +0 -1
- package/dist/utils/sql-dump/schema/primary-keys.js +0 -41
- package/dist/utils/sql-dump/schema/primary-keys.js.map +0 -1
- package/dist/utils/sql-dump/schema/tables.d.ts +0 -15
- package/dist/utils/sql-dump/schema/tables.d.ts.map +0 -1
- package/dist/utils/sql-dump/schema/tables.js +0 -518
- package/dist/utils/sql-dump/schema/tables.js.map +0 -1
- package/dist/utils/sql-dump/schema/views.d.ts +0 -11
- package/dist/utils/sql-dump/schema/views.d.ts.map +0 -1
- package/dist/utils/sql-dump/schema/views.js +0 -116
- package/dist/utils/sql-dump/schema/views.js.map +0 -1
- package/dist/utils/sql-dump/types.d.ts +0 -10
- package/dist/utils/sql-dump/types.d.ts.map +0 -1
- package/dist/utils/sql-dump/types.js +0 -3
- package/dist/utils/sql-dump/types.js.map +0 -1
- package/dist/utils/sql-dump-converters.d.ts +0 -188
- package/dist/utils/sql-dump-converters.d.ts.map +0 -1
- package/dist/utils/sql-dump-converters.js +0 -315
- package/dist/utils/sql-dump-converters.js.map +0 -1
- package/dist/watcher/gitignore-parser.d.ts +0 -70
- package/dist/watcher/gitignore-parser.d.ts.map +0 -1
- package/dist/watcher/gitignore-parser.js +0 -195
- package/dist/watcher/gitignore-parser.js.map +0 -1
- package/dist/watcher/index.d.ts +0 -9
- package/dist/watcher/index.d.ts.map +0 -1
- package/dist/watcher/index.js +0 -8
- package/dist/watcher/index.js.map +0 -1
- /package/dist/tests/{utils → integration}/json-export-import.test.d.ts +0 -0
- /package/dist/tests/{utils → integration}/json-export-import.test.js +0 -0
|
@@ -1,252 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Base adapter for database connections with authentication integration.
|
|
3
|
-
*
|
|
4
|
-
* This module provides the foundation for all database adapters in the multi-RDBMS system.
|
|
5
|
-
* It integrates authentication providers (SSH tunneling, direct connections, cloud IAM) with
|
|
6
|
-
* Knex.js-based database connections, managing the complete connection lifecycle.
|
|
7
|
-
*
|
|
8
|
-
* **Key Responsibilities:**
|
|
9
|
-
* - Authentication provider integration via factory
|
|
10
|
-
* - Connection lifecycle management (connect → authenticate → establish → cleanup)
|
|
11
|
-
* - Knex.js instance management and access control
|
|
12
|
-
* - Transaction support delegation
|
|
13
|
-
* - Abstract methods for adapter-specific initialization
|
|
14
|
-
*
|
|
15
|
-
* **Connection Flow:**
|
|
16
|
-
* 1. Constructor: Initialize with DatabaseConfig
|
|
17
|
-
* 2. connect(): Authenticate via provider, establish Knex connection
|
|
18
|
-
* 3. initialize(): Adapter-specific setup (pragmas, schemas, etc.)
|
|
19
|
-
* 4. getKnex(): Access Knex instance for queries
|
|
20
|
-
* 5. disconnect(): Close Knex connection
|
|
21
|
-
* 6. cleanup(): Release authentication resources (tunnels, tokens)
|
|
22
|
-
*
|
|
23
|
-
* **Architecture:**
|
|
24
|
-
* ```
|
|
25
|
-
* BaseAdapter (abstract)
|
|
26
|
-
* ├── Authentication Layer: BaseAuthProvider integration
|
|
27
|
-
* ├── Connection Layer: Knex.js management
|
|
28
|
-
* └── Adapter-Specific: Abstract methods for subclasses
|
|
29
|
-
*
|
|
30
|
-
* Concrete Adapters:
|
|
31
|
-
* ├── SQLiteAdapter (no auth required)
|
|
32
|
-
* ├── PostgreSQLAdapter (with auth integration)
|
|
33
|
-
* └── MySQLAdapter (with auth integration)
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* @module adapters/base-adapter
|
|
37
|
-
* @since v3.7.0
|
|
38
|
-
*/
|
|
39
1
|
import knexLib from 'knex';
|
|
40
2
|
import { createAuthProvider } from './auth/auth-factory.js';
|
|
41
3
|
const { knex } = knexLib;
|
|
42
|
-
/**
|
|
43
|
-
* Abstract base class for database adapters with authentication integration.
|
|
44
|
-
*
|
|
45
|
-
* This class provides common functionality for all database adapters, integrating
|
|
46
|
-
* authentication providers with Knex.js connections. Subclasses implement
|
|
47
|
-
* database-specific features (SQLite pragmas, PostgreSQL settings, MySQL config).
|
|
48
|
-
*
|
|
49
|
-
* **Design Principles:**
|
|
50
|
-
* - Separation of concerns: Auth provider handles authentication, adapter handles DB operations
|
|
51
|
-
* - Lazy initialization: Knex instance created only after successful authentication
|
|
52
|
-
* - Resource safety: Explicit cleanup for both auth providers and DB connections
|
|
53
|
-
* - Fail-fast validation: Auth provider validates config before connection attempt
|
|
54
|
-
* - Backward compatibility: Maintains DatabaseAdapter interface contract
|
|
55
|
-
*
|
|
56
|
-
* **Authentication Integration:**
|
|
57
|
-
* - SQLite: No authentication provider (null), direct file connection
|
|
58
|
-
* - PostgreSQL/MySQL: Auth provider handles tunneling/IAM/direct auth
|
|
59
|
-
* - SSH tunneling: Provider establishes tunnel, returns localhost connection params
|
|
60
|
-
* - Cloud IAM: Provider generates temporary tokens, returns params with SSL config
|
|
61
|
-
*
|
|
62
|
-
* **Error Handling:**
|
|
63
|
-
* - Constructor: Config validation (throws if invalid)
|
|
64
|
-
* - connect(): Authentication failures, connection failures
|
|
65
|
-
* - getKnex(): Throws if called before connect()
|
|
66
|
-
* - cleanup(): Swallows errors to prevent cascading failures
|
|
67
|
-
*
|
|
68
|
-
* @abstract
|
|
69
|
-
* @implements {DatabaseAdapter}
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* // Implementing a PostgreSQL adapter
|
|
73
|
-
* class PostgreSQLAdapter extends BaseAdapter {
|
|
74
|
-
* readonly supportsReturning = true;
|
|
75
|
-
* readonly supportsJSON = true;
|
|
76
|
-
* readonly databaseName = 'postgresql' as const;
|
|
77
|
-
*
|
|
78
|
-
* async initialize(): Promise<void> {
|
|
79
|
-
* const knex = this.getKnex();
|
|
80
|
-
* // PostgreSQL-specific initialization
|
|
81
|
-
* await knex.raw('SET statement_timeout = 30000');
|
|
82
|
-
* await knex.raw('SET timezone = "UTC"');
|
|
83
|
-
* }
|
|
84
|
-
*
|
|
85
|
-
* getDialect(): string {
|
|
86
|
-
* return 'pg';
|
|
87
|
-
* }
|
|
88
|
-
*
|
|
89
|
-
* // Implement other DatabaseAdapter methods...
|
|
90
|
-
* }
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* // Using the adapter with authentication
|
|
94
|
-
* const config: DatabaseConfig = {
|
|
95
|
-
* type: 'postgres',
|
|
96
|
-
* connection: {
|
|
97
|
-
* host: 'db.internal',
|
|
98
|
-
* port: 5432,
|
|
99
|
-
* database: 'production'
|
|
100
|
-
* },
|
|
101
|
-
* auth: {
|
|
102
|
-
* type: 'ssh',
|
|
103
|
-
* user: 'postgres',
|
|
104
|
-
* password: 'secret',
|
|
105
|
-
* ssh: {
|
|
106
|
-
* host: 'bastion.example.com',
|
|
107
|
-
* username: 'deploy',
|
|
108
|
-
* privateKeyPath: '/path/to/key.pem'
|
|
109
|
-
* }
|
|
110
|
-
* }
|
|
111
|
-
* };
|
|
112
|
-
*
|
|
113
|
-
* const adapter = new PostgreSQLAdapter(config);
|
|
114
|
-
* try {
|
|
115
|
-
* await adapter.connect();
|
|
116
|
-
* const knex = adapter.getKnex();
|
|
117
|
-
* const users = await knex('users').select('*');
|
|
118
|
-
* console.log(users);
|
|
119
|
-
* } finally {
|
|
120
|
-
* await adapter.disconnect();
|
|
121
|
-
* await adapter.cleanup();
|
|
122
|
-
* }
|
|
123
|
-
*
|
|
124
|
-
* @example
|
|
125
|
-
* // Transaction support
|
|
126
|
-
* const adapter = new PostgreSQLAdapter(config);
|
|
127
|
-
* await adapter.connect();
|
|
128
|
-
*
|
|
129
|
-
* try {
|
|
130
|
-
* await adapter.transaction(async (trx) => {
|
|
131
|
-
* await trx('accounts').where({ id: 1 }).update({ balance: 100 });
|
|
132
|
-
* await trx('accounts').where({ id: 2 }).update({ balance: 200 });
|
|
133
|
-
* });
|
|
134
|
-
* } finally {
|
|
135
|
-
* await adapter.disconnect();
|
|
136
|
-
* await adapter.cleanup();
|
|
137
|
-
* }
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* // SQLite adapter (no authentication)
|
|
141
|
-
* class SQLiteAdapter extends BaseAdapter {
|
|
142
|
-
* async connect(): Promise<Knex> {
|
|
143
|
-
* // SQLite doesn't need authentication provider
|
|
144
|
-
* // Override connect to bypass auth flow
|
|
145
|
-
* const config: Knex.Config = {
|
|
146
|
-
* client: 'better-sqlite3',
|
|
147
|
-
* connection: {
|
|
148
|
-
* filename: this.config.connection.database
|
|
149
|
-
* },
|
|
150
|
-
* useNullAsDefault: true
|
|
151
|
-
* };
|
|
152
|
-
*
|
|
153
|
-
* this.knex = knex(config);
|
|
154
|
-
* await this.initialize();
|
|
155
|
-
* return this.knex;
|
|
156
|
-
* }
|
|
157
|
-
*
|
|
158
|
-
* getDialect(): string {
|
|
159
|
-
* return 'sqlite3';
|
|
160
|
-
* }
|
|
161
|
-
* }
|
|
162
|
-
*/
|
|
4
|
+
/** Abstract base class for database adapters with authentication integration. */
|
|
163
5
|
export class BaseAdapter {
|
|
164
|
-
/**
|
|
165
|
-
* Database configuration containing connection and authentication settings.
|
|
166
|
-
* @protected
|
|
167
|
-
* @readonly
|
|
168
|
-
*/
|
|
6
|
+
/** @protected */
|
|
169
7
|
config;
|
|
170
|
-
/**
|
|
171
|
-
* Authentication provider instance for handling credentials, tunnels, and tokens.
|
|
172
|
-
* Null for databases that don't require authentication (e.g., SQLite).
|
|
173
|
-
* @protected
|
|
174
|
-
*/
|
|
8
|
+
/** @protected */
|
|
175
9
|
authProvider = null;
|
|
176
|
-
/**
|
|
177
|
-
* Knex.js instance for database operations.
|
|
178
|
-
* Null until connect() is called successfully.
|
|
179
|
-
* @protected
|
|
180
|
-
*/
|
|
10
|
+
/** @protected */
|
|
181
11
|
knexInstance = null;
|
|
182
|
-
/**
|
|
183
|
-
* Creates a new database adapter instance.
|
|
184
|
-
*
|
|
185
|
-
* @param {DatabaseConfig} config - Database configuration object
|
|
186
|
-
*
|
|
187
|
-
* @throws {Error} If database type is unsupported
|
|
188
|
-
*
|
|
189
|
-
* @example
|
|
190
|
-
* const adapter = new PostgreSQLAdapter({
|
|
191
|
-
* type: 'postgres',
|
|
192
|
-
* connection: { host: 'localhost', port: 5432, database: 'mydb' },
|
|
193
|
-
* auth: { type: 'direct', user: 'postgres', password: 'postgres' }
|
|
194
|
-
* });
|
|
195
|
-
*/
|
|
196
12
|
constructor(config) {
|
|
197
13
|
this.config = config;
|
|
198
14
|
}
|
|
199
|
-
|
|
200
|
-
// Connection Management
|
|
201
|
-
// ============================================================================
|
|
202
|
-
/**
|
|
203
|
-
* Establishes database connection with authentication.
|
|
204
|
-
*
|
|
205
|
-
* This method orchestrates the complete connection flow:
|
|
206
|
-
* 1. Create authentication provider (if required)
|
|
207
|
-
* 2. Validate authentication configuration
|
|
208
|
-
* 3. Authenticate and obtain connection parameters
|
|
209
|
-
* 4. Create Knex instance with authenticated params
|
|
210
|
-
* 5. Call initialize() for adapter-specific setup
|
|
211
|
-
*
|
|
212
|
-
* **Authentication Flow:**
|
|
213
|
-
* - Direct: Use credentials as-is
|
|
214
|
-
* - SSH: Establish tunnel, connect to localhost
|
|
215
|
-
* - AWS/GCP IAM: Generate token, connect with SSL
|
|
216
|
-
*
|
|
217
|
-
* **Important Notes:**
|
|
218
|
-
* - This method is idempotent: calling twice reuses existing connection
|
|
219
|
-
* - Auth provider resources remain allocated until cleanup() is called
|
|
220
|
-
* - Knex instance is accessible via getKnex() after successful connection
|
|
221
|
-
* - Subclasses can override for special handling (e.g., SQLite)
|
|
222
|
-
*
|
|
223
|
-
* @returns {Promise<Knex>} Knex instance for database operations
|
|
224
|
-
*
|
|
225
|
-
* @throws {Error} 'Database already connected' - if connection exists
|
|
226
|
-
* @throws {Error} Auth provider validation errors
|
|
227
|
-
* @throws {Error} Authentication failures (invalid credentials, network issues)
|
|
228
|
-
* @throws {Error} Knex connection failures (database unreachable, invalid database name)
|
|
229
|
-
* @throws {Error} Initialization failures (adapter-specific setup errors)
|
|
230
|
-
*
|
|
231
|
-
* @example
|
|
232
|
-
* // Standard usage
|
|
233
|
-
* const adapter = new PostgreSQLAdapter(config);
|
|
234
|
-
* try {
|
|
235
|
-
* const knex = await adapter.connect();
|
|
236
|
-
* console.log('Connected successfully');
|
|
237
|
-
* } catch (error) {
|
|
238
|
-
* console.error('Connection failed:', error.message);
|
|
239
|
-
* await adapter.cleanup();
|
|
240
|
-
* throw error;
|
|
241
|
-
* }
|
|
242
|
-
*
|
|
243
|
-
* @example
|
|
244
|
-
* // Idempotent connection
|
|
245
|
-
* const adapter = new PostgreSQLAdapter(config);
|
|
246
|
-
* const knex1 = await adapter.connect(); // Establishes connection
|
|
247
|
-
* const knex2 = await adapter.connect(); // Returns same instance
|
|
248
|
-
* console.log(knex1 === knex2); // true
|
|
249
|
-
*/
|
|
15
|
+
/** Establishes database connection with authentication. */
|
|
250
16
|
async connect() {
|
|
251
17
|
// Idempotent: return existing connection if already established
|
|
252
18
|
if (this.knexInstance) {
|
|
@@ -270,88 +36,14 @@ export class BaseAdapter {
|
|
|
270
36
|
await this.initialize();
|
|
271
37
|
return this.knexInstance;
|
|
272
38
|
}
|
|
273
|
-
/**
|
|
274
|
-
* Closes the database connection.
|
|
275
|
-
*
|
|
276
|
-
* This method closes the Knex connection pool, releasing all database connections.
|
|
277
|
-
* It does NOT release authentication provider resources (SSH tunnels, tokens) -
|
|
278
|
-
* call cleanup() to release those.
|
|
279
|
-
*
|
|
280
|
-
* **Resource Lifecycle:**
|
|
281
|
-
* - disconnect() → Closes Knex connection pool
|
|
282
|
-
* - cleanup() → Releases auth provider resources (tunnels, tokens)
|
|
283
|
-
* - Both must be called for complete cleanup
|
|
284
|
-
*
|
|
285
|
-
* **Important Notes:**
|
|
286
|
-
* - This method is idempotent: safe to call multiple times
|
|
287
|
-
* - Pending queries are allowed to complete before closing
|
|
288
|
-
* - After disconnect(), getKnex() will throw an error
|
|
289
|
-
* - Auth provider resources remain allocated until cleanup()
|
|
290
|
-
*
|
|
291
|
-
* @returns {Promise<void>}
|
|
292
|
-
*
|
|
293
|
-
* @example
|
|
294
|
-
* // Complete cleanup flow
|
|
295
|
-
* const adapter = new PostgreSQLAdapter(config);
|
|
296
|
-
* try {
|
|
297
|
-
* await adapter.connect();
|
|
298
|
-
* // ... use database ...
|
|
299
|
-
* } finally {
|
|
300
|
-
* await adapter.disconnect(); // Close DB connection
|
|
301
|
-
* await adapter.cleanup(); // Release auth resources
|
|
302
|
-
* }
|
|
303
|
-
*
|
|
304
|
-
* @example
|
|
305
|
-
* // Idempotent disconnect
|
|
306
|
-
* await adapter.disconnect(); // Closes connection
|
|
307
|
-
* await adapter.disconnect(); // Safe - no-op
|
|
308
|
-
*/
|
|
39
|
+
/** Closes the database connection. */
|
|
309
40
|
async disconnect() {
|
|
310
41
|
if (this.knexInstance) {
|
|
311
42
|
await this.knexInstance.destroy();
|
|
312
43
|
this.knexInstance = null;
|
|
313
44
|
}
|
|
314
45
|
}
|
|
315
|
-
/**
|
|
316
|
-
* Releases authentication provider resources.
|
|
317
|
-
*
|
|
318
|
-
* This method releases resources allocated during authentication:
|
|
319
|
-
* - SSH tunnels: Closes SSH connection and releases local port
|
|
320
|
-
* - Cloud IAM: Invalidates cached tokens
|
|
321
|
-
* - Direct connections: No-op (no resources to release)
|
|
322
|
-
*
|
|
323
|
-
* **Important Notes:**
|
|
324
|
-
* - This method MUST be called after disconnect() to prevent resource leaks
|
|
325
|
-
* - Errors during cleanup are caught and logged, not thrown
|
|
326
|
-
* - This method is idempotent: safe to call multiple times
|
|
327
|
-
* - Auth provider is set to null after cleanup
|
|
328
|
-
*
|
|
329
|
-
* **Resource Leak Prevention:**
|
|
330
|
-
* Always call cleanup() in a finally block to ensure resources are released
|
|
331
|
-
* even if database operations fail.
|
|
332
|
-
*
|
|
333
|
-
* @returns {Promise<void>}
|
|
334
|
-
*
|
|
335
|
-
* @example
|
|
336
|
-
* // Proper cleanup flow
|
|
337
|
-
* const adapter = new PostgreSQLAdapter(config);
|
|
338
|
-
* try {
|
|
339
|
-
* await adapter.connect();
|
|
340
|
-
* // ... database operations ...
|
|
341
|
-
* } finally {
|
|
342
|
-
* await adapter.disconnect();
|
|
343
|
-
* await adapter.cleanup();
|
|
344
|
-
* }
|
|
345
|
-
*
|
|
346
|
-
* @example
|
|
347
|
-
* // Error handling during cleanup
|
|
348
|
-
* try {
|
|
349
|
-
* await adapter.cleanup();
|
|
350
|
-
* } catch (error) {
|
|
351
|
-
* // Cleanup errors are logged but not thrown to prevent cascading failures
|
|
352
|
-
* console.error('Cleanup failed:', error);
|
|
353
|
-
* }
|
|
354
|
-
*/
|
|
46
|
+
/** Releases authentication provider resources. */
|
|
355
47
|
async cleanup() {
|
|
356
48
|
if (this.authProvider) {
|
|
357
49
|
try {
|
|
@@ -364,159 +56,19 @@ export class BaseAdapter {
|
|
|
364
56
|
this.authProvider = null;
|
|
365
57
|
}
|
|
366
58
|
}
|
|
367
|
-
/**
|
|
368
|
-
* Returns the Knex.js instance for database operations.
|
|
369
|
-
*
|
|
370
|
-
* This method provides access to the underlying Knex instance for executing
|
|
371
|
-
* queries, building query chains, and accessing raw connections.
|
|
372
|
-
*
|
|
373
|
-
* **Important Notes:**
|
|
374
|
-
* - Must call connect() before calling this method
|
|
375
|
-
* - Throws error if connection not established
|
|
376
|
-
* - Returns same instance across multiple calls
|
|
377
|
-
*
|
|
378
|
-
* @returns {Knex} Knex instance for database operations
|
|
379
|
-
*
|
|
380
|
-
* @throws {Error} 'Database not connected. Call connect() first.' - if not connected
|
|
381
|
-
*
|
|
382
|
-
* @example
|
|
383
|
-
* // Standard usage
|
|
384
|
-
* const adapter = new PostgreSQLAdapter(config);
|
|
385
|
-
* await adapter.connect();
|
|
386
|
-
* const knex = adapter.getKnex();
|
|
387
|
-
* const users = await knex('users').select('*');
|
|
388
|
-
*
|
|
389
|
-
* @example
|
|
390
|
-
* // Query builder
|
|
391
|
-
* const knex = adapter.getKnex();
|
|
392
|
-
* const query = knex('orders')
|
|
393
|
-
* .where('status', 'pending')
|
|
394
|
-
* .andWhere('created_at', '>', '2024-01-01')
|
|
395
|
-
* .orderBy('created_at', 'desc');
|
|
396
|
-
*
|
|
397
|
-
* @example
|
|
398
|
-
* // Raw queries
|
|
399
|
-
* const knex = adapter.getKnex();
|
|
400
|
-
* const result = await knex.raw('SELECT * FROM users WHERE id = ?', [userId]);
|
|
401
|
-
*/
|
|
59
|
+
/** Returns the Knex.js instance for database operations. */
|
|
402
60
|
getKnex() {
|
|
403
61
|
if (!this.knexInstance) {
|
|
404
62
|
throw new Error('Database not connected. Call connect() first.');
|
|
405
63
|
}
|
|
406
64
|
return this.knexInstance;
|
|
407
65
|
}
|
|
408
|
-
|
|
409
|
-
// Transaction Support
|
|
410
|
-
// ============================================================================
|
|
411
|
-
/**
|
|
412
|
-
* Executes a callback within a database transaction.
|
|
413
|
-
*
|
|
414
|
-
* This method delegates to Knex's transaction management, providing:
|
|
415
|
-
* - Automatic commit on success
|
|
416
|
-
* - Automatic rollback on error
|
|
417
|
-
* - Optional isolation level configuration
|
|
418
|
-
*
|
|
419
|
-
* **Transaction Isolation Levels:**
|
|
420
|
-
* - 'serializable': Strongest isolation, prevents all anomalies
|
|
421
|
-
* - 'repeatable read': Prevents non-repeatable reads and phantom reads
|
|
422
|
-
* - 'read committed': Prevents dirty reads (default for most databases)
|
|
423
|
-
*
|
|
424
|
-
* **Important Notes:**
|
|
425
|
-
* - All database operations within callback must use the trx parameter
|
|
426
|
-
* - Do not mix transaction queries with non-transaction queries
|
|
427
|
-
* - Nested transactions use savepoints (if supported by database)
|
|
428
|
-
*
|
|
429
|
-
* @param {Function} callback - Async function receiving transaction object
|
|
430
|
-
* @param {Object} [options] - Transaction options
|
|
431
|
-
* @param {string} [options.isolationLevel] - Transaction isolation level
|
|
432
|
-
* @returns {Promise<T>} Result from callback function
|
|
433
|
-
*
|
|
434
|
-
* @throws {Error} If callback throws (transaction is rolled back)
|
|
435
|
-
*
|
|
436
|
-
* @example
|
|
437
|
-
* // Bank transfer transaction
|
|
438
|
-
* await adapter.transaction(async (trx) => {
|
|
439
|
-
* await trx('accounts')
|
|
440
|
-
* .where({ id: fromAccount })
|
|
441
|
-
* .decrement('balance', amount);
|
|
442
|
-
*
|
|
443
|
-
* await trx('accounts')
|
|
444
|
-
* .where({ id: toAccount })
|
|
445
|
-
* .increment('balance', amount);
|
|
446
|
-
*
|
|
447
|
-
* await trx('transfers').insert({
|
|
448
|
-
* from_account: fromAccount,
|
|
449
|
-
* to_account: toAccount,
|
|
450
|
-
* amount
|
|
451
|
-
* });
|
|
452
|
-
* });
|
|
453
|
-
*
|
|
454
|
-
* @example
|
|
455
|
-
* // Transaction with isolation level
|
|
456
|
-
* await adapter.transaction(async (trx) => {
|
|
457
|
-
* const balance = await trx('accounts')
|
|
458
|
-
* .where({ id: accountId })
|
|
459
|
-
* .first('balance');
|
|
460
|
-
*
|
|
461
|
-
* if (balance.balance >= amount) {
|
|
462
|
-
* await trx('accounts')
|
|
463
|
-
* .where({ id: accountId })
|
|
464
|
-
* .decrement('balance', amount);
|
|
465
|
-
* }
|
|
466
|
-
* }, { isolationLevel: 'serializable' });
|
|
467
|
-
*
|
|
468
|
-
* @example
|
|
469
|
-
* // Error handling (automatic rollback)
|
|
470
|
-
* try {
|
|
471
|
-
* await adapter.transaction(async (trx) => {
|
|
472
|
-
* await trx('users').insert({ name: 'Alice' });
|
|
473
|
-
* throw new Error('Something went wrong');
|
|
474
|
-
* await trx('logs').insert({ message: 'Never executed' });
|
|
475
|
-
* });
|
|
476
|
-
* } catch (error) {
|
|
477
|
-
* console.log('Transaction rolled back:', error.message);
|
|
478
|
-
* }
|
|
479
|
-
*/
|
|
66
|
+
/** Executes a callback within a database transaction. */
|
|
480
67
|
async transaction(callback, options) {
|
|
481
68
|
const knex = this.getKnex();
|
|
482
69
|
return await knex.transaction(callback, options);
|
|
483
70
|
}
|
|
484
|
-
|
|
485
|
-
// Protected Helper Methods
|
|
486
|
-
// ============================================================================
|
|
487
|
-
/**
|
|
488
|
-
* Builds Knex configuration from connection parameters.
|
|
489
|
-
*
|
|
490
|
-
* This method converts ConnectionParams (returned by auth provider) into
|
|
491
|
-
* Knex.Config format. Subclasses can override to customize configuration.
|
|
492
|
-
*
|
|
493
|
-
* **Default Behavior:**
|
|
494
|
-
* - Uses dialect from getDialect()
|
|
495
|
-
* - Passes connection params to Knex
|
|
496
|
-
* - Configures SSL if present
|
|
497
|
-
* - Merges additional params
|
|
498
|
-
*
|
|
499
|
-
* @protected
|
|
500
|
-
* @param {ConnectionParams | null} connParams - Connection parameters from auth provider
|
|
501
|
-
* @returns {Knex.Config} Knex configuration object
|
|
502
|
-
*
|
|
503
|
-
* @example
|
|
504
|
-
* // Custom configuration in subclass
|
|
505
|
-
* protected buildKnexConfig(connParams: ConnectionParams | null): Knex.Config {
|
|
506
|
-
* const baseConfig = super.buildKnexConfig(connParams);
|
|
507
|
-
* return {
|
|
508
|
-
* ...baseConfig,
|
|
509
|
-
* pool: {
|
|
510
|
-
* min: 2,
|
|
511
|
-
* max: 10,
|
|
512
|
-
* afterCreate: (conn, done) => {
|
|
513
|
-
* // Custom connection setup
|
|
514
|
-
* done(null, conn);
|
|
515
|
-
* }
|
|
516
|
-
* }
|
|
517
|
-
* };
|
|
518
|
-
* }
|
|
519
|
-
*/
|
|
71
|
+
/** Builds Knex configuration from connection parameters. @protected */
|
|
520
72
|
buildKnexConfig(connParams) {
|
|
521
73
|
if (!connParams) {
|
|
522
74
|
// SQLite or other file-based databases
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-adapter.js","sourceRoot":"","sources":["../../src/adapters/base-adapter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"base-adapter.js","sourceRoot":"","sources":["../../src/adapters/base-adapter.ts"],"names":[],"mappings":"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"}
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -7,16 +7,6 @@ import { MySQLAdapter } from './mysql-adapter.js';
|
|
|
7
7
|
import type { DatabaseAdapter } from './types.js';
|
|
8
8
|
import type { DatabaseConfig } from '../config/types.js';
|
|
9
9
|
export { SQLiteAdapter, PostgreSQLAdapter, MySQLAdapter };
|
|
10
|
-
/**
|
|
11
|
-
* Factory function to create database adapter.
|
|
12
|
-
*
|
|
13
|
-
* NOTE: This factory maintains backward compatibility with the old signature
|
|
14
|
-
* that only accepts database type. For new code with authentication, create
|
|
15
|
-
* adapters directly with DatabaseConfig.
|
|
16
|
-
*
|
|
17
|
-
* @param databaseType - Database type identifier
|
|
18
|
-
* @param config - Optional database configuration (for new auth-aware code)
|
|
19
|
-
* @returns Database adapter instance
|
|
20
|
-
*/
|
|
10
|
+
/** Factory function to create database adapter. */
|
|
21
11
|
export declare function createDatabaseAdapter(databaseType: 'sqlite' | 'postgresql' | 'mysql', config?: DatabaseConfig): DatabaseAdapter;
|
|
22
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGlG,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGlG,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC;AAE1D,mDAAmD;AACnD,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,QAAQ,GAAG,YAAY,GAAG,OAAO,EAC/C,MAAM,CAAC,EAAE,cAAc,GACtB,eAAe,CAwBjB"}
|
package/dist/adapters/index.js
CHANGED
|
@@ -5,17 +5,7 @@ import { SQLiteAdapter } from './sqlite-adapter.js';
|
|
|
5
5
|
import { PostgreSQLAdapter } from './postgresql-adapter.js';
|
|
6
6
|
import { MySQLAdapter } from './mysql-adapter.js';
|
|
7
7
|
export { SQLiteAdapter, PostgreSQLAdapter, MySQLAdapter };
|
|
8
|
-
/**
|
|
9
|
-
* Factory function to create database adapter.
|
|
10
|
-
*
|
|
11
|
-
* NOTE: This factory maintains backward compatibility with the old signature
|
|
12
|
-
* that only accepts database type. For new code with authentication, create
|
|
13
|
-
* adapters directly with DatabaseConfig.
|
|
14
|
-
*
|
|
15
|
-
* @param databaseType - Database type identifier
|
|
16
|
-
* @param config - Optional database configuration (for new auth-aware code)
|
|
17
|
-
* @returns Database adapter instance
|
|
18
|
-
*/
|
|
8
|
+
/** Factory function to create database adapter. */
|
|
19
9
|
export function createDatabaseAdapter(databaseType, config) {
|
|
20
10
|
// Build default config if not provided (backward compatibility)
|
|
21
11
|
const defaultConfig = config || {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAKA,sBAAsB;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,iCAAiC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAKA,sBAAsB;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,iCAAiC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC;AAE1D,mDAAmD;AACnD,MAAM,UAAU,qBAAqB,CACnC,YAA+C,EAC/C,MAAuB;IAEvB,gEAAgE;IAChE,MAAM,aAAa,GAAmB,MAAM,IAAI;QAC9C,IAAI,EAAE,YAAY,KAAK,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY;QAC/D,UAAU,EAAE;YACV,IAAI,EAAE,EAAE;YACR,IAAI,EAAE,CAAC;YACP,QAAQ,EAAE,EAAE;SACb;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;KACF,CAAC;IAEF,QAAQ,YAAY,EAAE,CAAC;QACrB,KAAK,QAAQ;YACX,OAAO,IAAI,aAAa,CAAC,aAAa,CAAC,CAAC;QAC1C,KAAK,YAAY;YACf,OAAO,IAAI,iBAAiB,CAAC,aAAa,CAAC,CAAC;QAC9C,KAAK,OAAO;YACV,OAAO,IAAI,YAAY,CAAC,aAAa,CAAC,CAAC;QACzC;YACE,MAAM,IAAI,KAAK,CAAC,8BAA8B,YAAY,EAAE,CAAC,CAAC;IAClE,CAAC;AACH,CAAC"}
|