ts-prorm-orm 1.1.0 → 1.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 +83 -0
- package/README.md +194 -72
- package/dist/audit/history-query.d.ts +35 -0
- package/dist/audit/index.d.ts +16 -0
- package/dist/audit/logger.d.ts +126 -0
- package/dist/cache/cache-manager.d.ts +341 -0
- package/dist/cache/index.d.ts +8 -0
- package/dist/cache/redis-cluster-cache.d.ts +164 -0
- package/dist/cache/redis-cluster-cache.js +19 -36
- package/dist/cli/cloud.d.ts +55 -0
- package/dist/cli/cloud.js +318 -0
- package/dist/cli/commands/auth.d.ts +2 -0
- package/dist/cli/commands/auth.js +345 -0
- package/dist/cli/commands/billing.d.ts +2 -0
- package/dist/cli/commands/billing.js +135 -0
- package/dist/cli/commands/code.d.ts +2 -0
- package/dist/cli/commands/code.js +168 -0
- package/dist/cli/commands/config.d.ts +2 -0
- package/dist/cli/commands/config.js +154 -0
- package/dist/cli/commands/db.d.ts +2 -0
- package/dist/cli/commands/db.js +189 -0
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.js +22 -0
- package/dist/cli/commands/keys.d.ts +2 -0
- package/dist/cli/commands/keys.js +100 -0
- package/dist/cli/commands/misc.d.ts +2 -0
- package/dist/cli/commands/misc.js +282 -0
- package/dist/cli/commands/pull.d.ts +2 -0
- package/dist/cli/commands/pull.js +306 -0
- package/dist/cli/commands/runners.d.ts +2 -0
- package/dist/cli/commands/runners.js +218 -0
- package/dist/cli/commands/scaffold.d.ts +2 -0
- package/dist/cli/commands/scaffold.js +383 -0
- package/dist/cli/commands/secrets.d.ts +2 -0
- package/dist/cli/commands/secrets.js +162 -0
- package/dist/cli/commands/store.d.ts +2 -0
- package/dist/cli/commands/store.js +274 -0
- package/dist/cli/commands/system.d.ts +10 -0
- package/dist/cli/commands/system.js +169 -0
- package/dist/cli/commands/teams.d.ts +2 -0
- package/dist/cli/commands/teams.js +189 -0
- package/dist/cli/commands/user.d.ts +2 -0
- package/dist/cli/commands/user.js +171 -0
- package/dist/cli/framework.d.ts +103 -0
- package/dist/cli/framework.js +436 -0
- package/dist/cli/io.d.ts +26 -0
- package/dist/cli/io.js +181 -0
- package/dist/cli/keychain.d.ts +10 -0
- package/dist/cli/keychain.js +101 -0
- package/dist/cli/prompt.d.ts +20 -0
- package/dist/cli/prompt.js +111 -0
- package/dist/cli.d.ts +214 -0
- package/dist/cli.js +72 -5
- package/dist/compliance/audit-trail.d.ts +66 -0
- package/dist/compliance/backup-verification.d.ts +279 -0
- package/dist/compliance/breach-detector.d.ts +197 -0
- package/dist/compliance/consent-record.d.ts +107 -0
- package/dist/compliance/consent-versioning.d.ts +169 -0
- package/dist/compliance/cross-border-log.d.ts +254 -0
- package/dist/compliance/data-classifier.d.ts +127 -0
- package/dist/compliance/data-lineage.d.ts +268 -0
- package/dist/compliance/data-masker.d.ts +110 -0
- package/dist/compliance/data-portability.d.ts +98 -0
- package/dist/compliance/data-retention.d.ts +108 -0
- package/dist/compliance/dsar-workflow.d.ts +175 -0
- package/dist/compliance/field-encryption.d.ts +84 -0
- package/dist/compliance/immutable-record.d.ts +84 -0
- package/dist/compliance/index.d.ts +93 -0
- package/dist/compliance/privacy-impact-assessment.d.ts +196 -0
- package/dist/compliance/pseudonymization.d.ts +96 -0
- package/dist/compliance/query-firewall.d.ts +661 -0
- package/dist/compliance/rate-limiter.d.ts +203 -0
- package/dist/compliance/right-to-erasure.d.ts +96 -0
- package/dist/compliance/row-level-security.d.ts +152 -0
- package/dist/compliance/security-decorator.d.ts +388 -0
- package/dist/compliance/security-monitor.d.ts +170 -0
- package/dist/compliance/sensitive-data-discovery.d.ts +151 -0
- package/dist/compliance/session-isolation.d.ts +286 -0
- package/dist/compliance/tls-enforcer.d.ts +51 -0
- package/dist/compliance/worm-storage.d.ts +225 -0
- package/dist/connection-manager.d.ts +130 -0
- package/dist/connection-pool.d.ts +311 -0
- package/dist/decorators/audit.d.ts +49 -0
- package/dist/decorators/check.d.ts +218 -0
- package/dist/decorators/collate.d.ts +346 -0
- package/dist/decorators/comment.d.ts +51 -0
- package/dist/decorators/database-settings.d.ts +193 -0
- package/dist/decorators/default.d.ts +148 -0
- package/dist/decorators/encryption.d.ts +175 -0
- package/dist/decorators/engine.d.ts +97 -0
- package/dist/decorators/fk-constraints.d.ts +387 -0
- package/dist/decorators/foreign-table.d.ts +57 -0
- package/dist/decorators/generated.d.ts +232 -0
- package/dist/decorators/hstore.d.ts +96 -0
- package/dist/decorators/index.d.ts +57 -0
- package/dist/decorators/index.js +14 -30
- package/dist/decorators/json-column.d.ts +47 -0
- package/dist/decorators/jsonb.d.ts +83 -0
- package/dist/decorators/orm-decorators.d.ts +274 -0
- package/dist/decorators/permissions.d.ts +192 -0
- package/dist/decorators/procedure.d.ts +168 -0
- package/dist/decorators/procedure.js +31 -7
- package/dist/decorators/query-options.d.ts +527 -0
- package/dist/decorators/range.d.ts +122 -0
- package/dist/decorators/set-column.d.ts +43 -0
- package/dist/decorators/spatial.d.ts +60 -0
- package/dist/decorators/storage.d.ts +561 -0
- package/dist/decorators/timezone.d.ts +319 -0
- package/dist/decorators/trigger.d.ts +50 -0
- package/dist/decorators/uuid.d.ts +102 -0
- package/dist/decorators/view.d.ts +213 -0
- package/dist/diagrams/chen-diagram.d.ts +70 -0
- package/dist/diagrams/chen-diagram.js +33 -31
- package/dist/diagrams/class-diagram.d.ts +78 -0
- package/dist/diagrams/class-diagram.js +23 -27
- package/dist/diagrams/dependency-diagram.d.ts +82 -0
- package/dist/diagrams/dependency-diagram.js +18 -9
- package/dist/diagrams/er-diagram.d.ts +82 -0
- package/dist/diagrams/er-diagram.js +174 -231
- package/dist/diagrams/flow-diagram.d.ts +70 -0
- package/dist/diagrams/flow-diagram.js +23 -18
- package/dist/diagrams/gantt-diagram.d.ts +67 -0
- package/dist/diagrams/gantt-diagram.js +20 -18
- package/dist/diagrams/index-diagram.d.ts +61 -0
- package/dist/diagrams/index-diagram.js +36 -31
- package/dist/diagrams/index.d.ts +155 -0
- package/dist/diagrams/index.js +7 -1
- package/dist/diagrams/migration-diagram.d.ts +67 -0
- package/dist/diagrams/migration-diagram.js +45 -57
- package/dist/diagrams/model-diagram.d.ts +85 -0
- package/dist/diagrams/model-diagram.js +225 -287
- package/dist/diagrams/package-diagram.d.ts +69 -0
- package/dist/diagrams/package-diagram.js +30 -32
- package/dist/diagrams/palette.d.ts +138 -0
- package/dist/diagrams/palette.js +134 -25
- package/dist/diagrams/relational-diagram.d.ts +82 -0
- package/dist/diagrams/relational-diagram.js +51 -59
- package/dist/diagrams/schemadoc-diagram.d.ts +57 -0
- package/dist/diagrams/schemadoc-diagram.js +36 -28
- package/dist/diagrams/sequence-diagram.d.ts +61 -0
- package/dist/diagrams/sequence-diagram.js +20 -11
- package/dist/diagrams/state-diagram.d.ts +85 -0
- package/dist/diagrams/state-diagram.js +21 -17
- package/dist/diagrams/svg-dom.d.ts +62 -0
- package/dist/diagrams/svg-dom.js +11 -0
- package/dist/diagrams/tree-diagram.d.ts +47 -0
- package/dist/diagrams/tree-diagram.js +19 -10
- package/dist/dialects/clickhouse/index.d.ts +660 -0
- package/dist/dialects/clickhouse/index.js +107 -2
- package/dist/dialects/cockroachdb/index.d.ts +1708 -0
- package/dist/dialects/cockroachdb/index.js +139 -10
- package/dist/dialects/cratedb/index.d.ts +262 -0
- package/dist/dialects/cratedb/index.js +148 -0
- package/dist/dialects/databricks/index.d.ts +397 -0
- package/dist/dialects/databricks/index.js +233 -11
- package/dist/dialects/db2/index.d.ts +729 -0
- package/dist/dialects/db2/index.js +152 -2
- package/dist/dialects/dialect.d.ts +1653 -0
- package/dist/dialects/duckdb/index.d.ts +440 -0
- package/dist/dialects/duckdb/index.js +21 -37
- package/dist/dialects/exasol/index.d.ts +197 -0
- package/dist/dialects/exasol/index.js +14 -0
- package/dist/dialects/firebird/index.d.ts +286 -0
- package/dist/dialects/firebird/index.js +135 -0
- package/dist/dialects/greenplum/index.d.ts +336 -0
- package/dist/dialects/greenplum/index.js +168 -0
- package/dist/dialects/hana/index.d.ts +512 -0
- package/dist/dialects/hana/index.js +17 -35
- package/dist/dialects/mariadb/index.d.ts +1241 -0
- package/dist/dialects/mariadb/index.js +181 -43
- package/dist/dialects/mssql/index.d.ts +729 -0
- package/dist/dialects/mssql/index.js +76 -7
- package/dist/dialects/mysql/index.d.ts +1233 -0
- package/dist/dialects/mysql/index.js +87 -19
- package/dist/dialects/oracle/index.d.ts +1222 -0
- package/dist/dialects/oracle/index.js +210 -9
- package/dist/dialects/postgres/index.d.ts +1598 -0
- package/dist/dialects/postgres/index.js +34 -13
- package/dist/dialects/query-stream-helper.d.ts +58 -0
- package/dist/dialects/questdb/index.d.ts +430 -0
- package/dist/dialects/questdb/index.js +292 -0
- package/dist/dialects/redshift/index.d.ts +933 -0
- package/dist/dialects/redshift/index.js +17 -5
- package/dist/dialects/singlestore/index.d.ts +233 -0
- package/dist/dialects/singlestore/index.js +53 -0
- package/dist/dialects/snowflake/index.d.ts +727 -0
- package/dist/dialects/snowflake/index.js +154 -5
- package/dist/dialects/spanner/index.d.ts +660 -0
- package/dist/dialects/spanner/index.js +43 -21
- package/dist/dialects/sqlite/index.d.ts +1133 -0
- package/dist/dialects/sqlite/index.js +168 -30
- package/dist/dialects/tidb/index.d.ts +226 -0
- package/dist/dialects/tidb/index.js +10 -0
- package/dist/dialects/timescaledb/index.d.ts +286 -0
- package/dist/dialects/timescaledb/index.js +179 -0
- package/dist/dialects/trino/index.d.ts +230 -0
- package/dist/dialects/trino/index.js +85 -10
- package/dist/dialects/turso/index.d.ts +98 -0
- package/dist/dialects/turso/index.js +10 -0
- package/dist/dialects/vertica/index.d.ts +321 -0
- package/dist/dialects/vertica/index.js +161 -0
- package/dist/dialects/yugabytedb/index.d.ts +276 -0
- package/dist/dialects/yugabytedb/index.js +121 -0
- package/dist/errors/index.d.ts +378 -0
- package/dist/errors/index.js +29 -1
- package/dist/errors/utils.d.ts +53 -0
- package/dist/errors.d.ts +5 -0
- package/dist/extensions/catalog/cloud-warehouse-features.d.ts +27 -0
- package/dist/extensions/catalog/mssql-features.d.ts +20 -0
- package/dist/extensions/catalog/mysql-mariadb-plugins.d.ts +18 -0
- package/dist/extensions/catalog/oracle-db2-features.d.ts +17 -0
- package/dist/extensions/catalog/postgres-extensions.d.ts +15 -0
- package/dist/extensions/index.d.ts +34 -0
- package/dist/extensions/types.d.ts +43 -0
- package/dist/external-fields/adapters.d.ts +50 -0
- package/dist/external-fields/adapters.js +227 -0
- package/dist/external-fields/decorator.d.ts +77 -0
- package/dist/external-fields/decorator.js +80 -0
- package/dist/external-fields/index.d.ts +10 -0
- package/dist/external-fields/index.js +19 -0
- package/dist/external-fields/runtime.d.ts +39 -0
- package/dist/external-fields/runtime.js +221 -0
- package/dist/foreign-data.d.ts +168 -0
- package/dist/graph/base-graph-dialect.d.ts +250 -0
- package/dist/graph/base-graph-dialect.js +539 -0
- package/dist/graph/dgraph/index.d.ts +65 -0
- package/dist/graph/dgraph/index.js +559 -0
- package/dist/graph/gremlin/index.d.ts +59 -0
- package/dist/graph/gremlin/index.js +378 -0
- package/dist/graph/index.d.ts +60 -0
- package/dist/graph/index.js +67 -0
- package/dist/graph/neo4j/index.d.ts +50 -0
- package/dist/graph/neo4j/index.js +462 -0
- package/dist/graph/types.d.ts +213 -0
- package/dist/graph/types.js +234 -0
- package/dist/hooks/hooks-manager.d.ts +189 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/index.d.ts +711 -0
- package/dist/index.js +19 -4
- package/dist/logging.d.ts +183 -0
- package/dist/migrations/index.d.ts +9 -0
- package/dist/migrations/migration.d.ts +143 -0
- package/dist/migrations/migrator.d.ts +199 -0
- package/dist/migrations/prormmigration.d.ts +131 -0
- package/dist/migrations/query-interface.d.ts +335 -0
- package/dist/migrations/seeder.d.ts +167 -0
- package/dist/models/associations.d.ts +131 -0
- package/dist/models/associations.js +7 -2
- package/dist/models/constraints.d.ts +175 -0
- package/dist/models/data-types.d.ts +1656 -0
- package/dist/models/decorators.d.ts +328 -0
- package/dist/models/decorators.js +61 -82
- package/dist/models/eager-load.d.ts +86 -0
- package/dist/models/eager-load.js +369 -0
- package/dist/models/index.d.ts +13 -0
- package/dist/models/indexes.d.ts +325 -0
- package/dist/models/methods.d.ts +419 -0
- package/dist/models/model-manager.d.ts +76 -0
- package/dist/models/model.d.ts +820 -0
- package/dist/models/model.js +15 -101
- package/dist/models/operators.d.ts +29 -0
- package/dist/models/scopes.d.ts +71 -0
- package/dist/models/typescript-types.d.ts +177 -0
- package/dist/nosql/aerospike/index.d.ts +126 -0
- package/dist/nosql/allegrograph/index.d.ts +86 -0
- package/dist/nosql/arangodb/index.d.ts +285 -0
- package/dist/nosql/arangodb/index.js +274 -2
- package/dist/nosql/arangodb/where.d.ts +38 -0
- package/dist/nosql/arangodb/where.js +94 -0
- package/dist/nosql/azure-blob/index.d.ts +104 -0
- package/dist/nosql/beanstalkd/index.d.ts +88 -0
- package/dist/nosql/beequeue/index.d.ts +99 -0
- package/dist/nosql/bigchaindb/index.d.ts +113 -0
- package/dist/nosql/bigtable/index.d.ts +144 -0
- package/dist/nosql/blazegraph/index.d.ts +88 -0
- package/dist/nosql/bullmq/index.d.ts +83 -0
- package/dist/nosql/cassandra/index.d.ts +119 -0
- package/dist/nosql/chroma/index.d.ts +151 -0
- package/dist/nosql/cloudflare-kv/index.d.ts +120 -0
- package/dist/nosql/coherence/index.d.ts +91 -0
- package/dist/nosql/cosmosdb/index.d.ts +78 -0
- package/dist/nosql/couchbase/index.d.ts +103 -0
- package/dist/nosql/dax/index.d.ts +118 -0
- package/dist/nosql/deno-kv/index.d.ts +109 -0
- package/dist/nosql/dgraph/index.d.ts +80 -0
- package/dist/nosql/doris/index.d.ts +88 -0
- package/dist/nosql/druid/index.d.ts +95 -0
- package/dist/nosql/dynamodb/index.d.ts +643 -0
- package/dist/nosql/dynamodb/index.js +423 -0
- package/dist/nosql/elasticsearch/index.d.ts +239 -0
- package/dist/nosql/etcd/index.d.ts +243 -0
- package/dist/nosql/eventhubs/index.d.ts +89 -0
- package/dist/nosql/eventstore/index.d.ts +102 -0
- package/dist/nosql/faunadb/index.d.ts +141 -0
- package/dist/nosql/faunadb/index.js +329 -0
- package/dist/nosql/firestore/index.d.ts +67 -0
- package/dist/nosql/fluree/index.d.ts +88 -0
- package/dist/nosql/fuseki/index.d.ts +94 -0
- package/dist/nosql/gcs/index.d.ts +62 -0
- package/dist/nosql/gearman/index.d.ts +77 -0
- package/dist/nosql/geode/index.d.ts +93 -0
- package/dist/nosql/graphdb/index.d.ts +86 -0
- package/dist/nosql/graylog/index.d.ts +118 -0
- package/dist/nosql/gridgain/index.d.ts +78 -0
- package/dist/nosql/hazelcast/index.d.ts +73 -0
- package/dist/nosql/hbase/index.d.ts +123 -0
- package/dist/nosql/ignite/index.d.ts +80 -0
- package/dist/nosql/immudb/index.d.ts +131 -0
- package/dist/nosql/index.d.ts +215 -0
- package/dist/nosql/infinispan/index.d.ts +95 -0
- package/dist/nosql/influxdb/flux-compiler.d.ts +23 -0
- package/dist/nosql/influxdb/flux-compiler.js +170 -0
- package/dist/nosql/influxdb/index.d.ts +300 -0
- package/dist/nosql/influxdb/index.js +0 -0
- package/dist/nosql/kafka/index.d.ts +113 -0
- package/dist/nosql/keyspaces/index.d.ts +122 -0
- package/dist/nosql/kinesis/index.d.ts +121 -0
- package/dist/nosql/leveldb/index.d.ts +112 -0
- package/dist/nosql/leveldb/index.js +103 -1
- package/dist/nosql/lmdb/index.d.ts +76 -0
- package/dist/nosql/loki/index.d.ts +126 -0
- package/dist/nosql/marklogic/index.d.ts +76 -0
- package/dist/nosql/materialize/index.d.ts +91 -0
- package/dist/nosql/meilisearch/index.d.ts +76 -0
- package/dist/nosql/memcached/index.d.ts +138 -0
- package/dist/nosql/milvus/index.d.ts +167 -0
- package/dist/nosql/minio/index.d.ts +122 -0
- package/dist/nosql/momento/index.d.ts +99 -0
- package/dist/nosql/mongodb/index.d.ts +265 -0
- package/dist/nosql/mongodb/index.js +139 -0
- package/dist/nosql/mongodb/where.d.ts +8 -0
- package/dist/nosql/mongodb/where.js +181 -0
- package/dist/nosql/nats/index.d.ts +139 -0
- package/dist/nosql/nedb/index.d.ts +79 -0
- package/dist/nosql/neo4j/index.d.ts +217 -0
- package/dist/nosql/neo4j/index.js +26 -14
- package/dist/nosql/neptune/index.d.ts +234 -0
- package/dist/nosql/neptune/index.js +23 -9
- package/dist/nosql/nsq/index.d.ts +93 -0
- package/dist/nosql/opensearch/index.d.ts +97 -0
- package/dist/nosql/orientdb/index.d.ts +72 -0
- package/dist/nosql/papertrail/index.d.ts +120 -0
- package/dist/nosql/pinecone/index.d.ts +148 -0
- package/dist/nosql/pinot/index.d.ts +90 -0
- package/dist/nosql/pouchdb/index.d.ts +95 -0
- package/dist/nosql/prometheus/index.d.ts +112 -0
- package/dist/nosql/provendb/index.d.ts +143 -0
- package/dist/nosql/provendb/index.js +262 -0
- package/dist/nosql/pubsub/index.d.ts +83 -0
- package/dist/nosql/pulsar/index.d.ts +105 -0
- package/dist/nosql/qdrant/index.d.ts +231 -0
- package/dist/nosql/qldb/index.d.ts +182 -0
- package/dist/nosql/qldb/index.js +302 -1
- package/dist/nosql/r2/index.d.ts +160 -0
- package/dist/nosql/rabbitmq/index.d.ts +131 -0
- package/dist/nosql/ravendb/index.d.ts +138 -0
- package/dist/nosql/ravendb/index.js +323 -9
- package/dist/nosql/ravendb/where.d.ts +38 -0
- package/dist/nosql/ravendb/where.js +94 -0
- package/dist/nosql/redis/index.d.ts +267 -0
- package/dist/nosql/redis/index.js +19 -5
- package/dist/nosql/redpanda/index.d.ts +117 -0
- package/dist/nosql/resque/index.d.ts +91 -0
- package/dist/nosql/rethinkdb/index.d.ts +194 -0
- package/dist/nosql/rethinkdb/index.js +290 -0
- package/dist/nosql/rethinkdb/where.d.ts +38 -0
- package/dist/nosql/rethinkdb/where.js +94 -0
- package/dist/nosql/rocksdb/document-layer.d.ts +162 -0
- package/dist/nosql/rocksdb/document-layer.js +338 -0
- package/dist/nosql/rocksdb/index.d.ts +112 -0
- package/dist/nosql/rocksdb/index.js +103 -1
- package/dist/nosql/rocksdb/where-match.d.ts +21 -0
- package/dist/nosql/rocksdb/where-match.js +238 -0
- package/dist/nosql/rockset/index.d.ts +84 -0
- package/dist/nosql/s3/index.d.ts +170 -0
- package/dist/nosql/scylladb/index.d.ts +117 -0
- package/dist/nosql/signoz/index.d.ts +116 -0
- package/dist/nosql/sns/index.d.ts +99 -0
- package/dist/nosql/solr/index.d.ts +129 -0
- package/dist/nosql/splunk/index.d.ts +125 -0
- package/dist/nosql/sqs/index.d.ts +116 -0
- package/dist/nosql/stardog/index.d.ts +86 -0
- package/dist/nosql/starrocks/index.d.ts +89 -0
- package/dist/nosql/store.d.ts +23 -0
- package/dist/nosql/sumologic/index.d.ts +119 -0
- package/dist/nosql/surrealdb/index.d.ts +156 -0
- package/dist/nosql/surrealdb/index.js +174 -1
- package/dist/nosql/surrealdb/query-compiler.d.ts +26 -0
- package/dist/nosql/surrealdb/query-compiler.js +193 -0
- package/dist/nosql/terminusdb/index.d.ts +95 -0
- package/dist/nosql/tigergraph/index.d.ts +314 -0
- package/dist/nosql/typesense/index.d.ts +82 -0
- package/dist/nosql/unqlite/index.d.ts +68 -0
- package/dist/nosql/upstash/index.d.ts +80 -0
- package/dist/nosql/vercel-kv/index.d.ts +82 -0
- package/dist/nosql/victoriametrics/index.d.ts +129 -0
- package/dist/nosql/virtuoso/index.d.ts +87 -0
- package/dist/nosql/weaviate/index.d.ts +196 -0
- package/dist/operators/index.d.ts +7 -0
- package/dist/operators.d.ts +2947 -0
- package/dist/operators.js +46 -1
- package/dist/prisma-migrate/index.d.ts +28 -0
- package/dist/prisma-migrate/migration-generator.d.ts +21 -0
- package/dist/prisma-migrate/model-generator.d.ts +12 -0
- package/dist/prisma-migrate/relations.d.ts +28 -0
- package/dist/prisma-migrate/schema-parser.d.ts +42 -0
- package/dist/prisma-migrate/type-mapper.d.ts +20 -0
- package/dist/prorm.d.ts +2093 -0
- package/dist/prorm.js +721 -302
- package/dist/query-builders/cte-builder.d.ts +104 -0
- package/dist/query-builders/functions/aggregate.d.ts +199 -0
- package/dist/query-builders/functions/conditional.d.ts +195 -0
- package/dist/query-builders/functions/datetime.d.ts +202 -0
- package/dist/query-builders/functions/fulltext.d.ts +220 -0
- package/dist/query-builders/functions/index.d.ts +17 -0
- package/dist/query-builders/functions/json.d.ts +157 -0
- package/dist/query-builders/functions/math.d.ts +215 -0
- package/dist/query-builders/functions/string.d.ts +233 -0
- package/dist/query-builders/functions/window.d.ts +209 -0
- package/dist/query-builders/include-builder.d.ts +85 -0
- package/dist/query-builders/index-expression-builder.d.ts +153 -0
- package/dist/query-builders/index.d.ts +121 -0
- package/dist/query-builders/index.js +10 -0
- package/dist/query-builders/insert-builder.d.ts +62 -0
- package/dist/query-builders/model-helpers.d.ts +28 -0
- package/dist/query-builders/order-limit-builder.d.ts +84 -0
- package/dist/query-builders/sql-compiler.d.ts +562 -0
- package/dist/query-builders/subquery-builder.d.ts +133 -0
- package/dist/query-builders/update-builder.d.ts +71 -0
- package/dist/query-builders/view-builder.d.ts +189 -0
- package/dist/query-builders/where-builder.d.ts +124 -0
- package/dist/query-interface.d.ts +407 -0
- package/dist/query-interface.js +84 -0
- package/dist/query-optimizers/batch-optimizer.d.ts +175 -0
- package/dist/query-optimizers/explain-plans.d.ts +187 -0
- package/dist/query-optimizers/index.d.ts +27 -0
- package/dist/query-optimizers/prepared-statement-cache.d.ts +252 -0
- package/dist/query-optimizers/query-hints.d.ts +201 -0
- package/dist/query-optimizers/query-optimizer.d.ts +162 -0
- package/dist/query-optimizers/slow-query-logger.d.ts +186 -0
- package/dist/replica-manager.d.ts +235 -0
- package/dist/schema/index.d.ts +7 -0
- package/dist/schema/migration-generator.d.ts +74 -0
- package/dist/schema/schema-differ.d.ts +114 -0
- package/dist/schema/types.d.ts +246 -0
- package/dist/schema-objects.d.ts +78 -0
- package/dist/schema-objects.js +203 -0
- package/dist/sql-constants.d.ts +240 -0
- package/dist/sqlite-advanced.d.ts +572 -0
- package/dist/streams/index.d.ts +5 -0
- package/dist/streams/transforms.d.ts +120 -0
- package/dist/transaction.d.ts +221 -0
- package/dist/types/index.d.ts +3123 -0
- package/dist/user-management.d.ts +141 -0
- package/dist/utils/date.d.ts +149 -0
- package/dist/utils/index.d.ts +359 -0
- package/dist/utils/string.d.ts +88 -0
- package/dist/validators/index.d.ts +7 -0
- package/dist/validators/validator.d.ts +306 -0
- package/package.json +20 -5
|
@@ -0,0 +1,1222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Oracle dialect implementation for the TypeScript ORM
|
|
3
|
+
* Uses the oracledb driver for database connectivity
|
|
4
|
+
*/
|
|
5
|
+
import type { Connection } from 'oracledb';
|
|
6
|
+
import { Dialect, DialectOptions, ColumnDefinition, TableOptions, DropTableOptions, TableDescription, IndexOptions, IndexDefinition, InsertOptions, UpdateOptions, DeleteOptions, SelectOptions, UpsertQueryOptions, DropSchemaOptions, ViewOptions, DropViewOptions, ConstraintDefinition, DropConstraintOptions, BuildOptions, MaterializedViewOptions, RefreshOptions, DropMaterializedViewOptions } from '../dialect';
|
|
7
|
+
import { Transaction, TransactionOptions, QueryResult, QueryOptions, DataType, WhereOptions, Order, RetryOptions, CreatePartitionOptions, PartitionBound, PartitionListBound, PartitionHashBound, AttachPartitionOptions, DetachPartitionOptions, StoredProcedureOptions, DropStoredProcedureOptions, ExecuteStoredProcedureOptions, TriggerOptions, DropTriggerOptions, SequenceOptions, DropSequenceOptions, PolicyOptions, DropPolicyOptions, MaterializedViewLogOptions, StreamOptions } from '../../types';
|
|
8
|
+
import { Readable } from 'stream';
|
|
9
|
+
/**
|
|
10
|
+
* Oracle dialect options
|
|
11
|
+
*/
|
|
12
|
+
export interface OracleDialectOptions extends DialectOptions {
|
|
13
|
+
/** Oracle connection pool options */
|
|
14
|
+
pool?: {
|
|
15
|
+
max?: number;
|
|
16
|
+
min?: number;
|
|
17
|
+
increment?: number;
|
|
18
|
+
timeout?: number;
|
|
19
|
+
};
|
|
20
|
+
/** Connection retry options */
|
|
21
|
+
retry?: RetryOptions;
|
|
22
|
+
/** Whether to use thin mode (no Instant Client needed) */
|
|
23
|
+
thinMode?: boolean;
|
|
24
|
+
/** Default schema for operations */
|
|
25
|
+
schema?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Options describing an Oracle analytic (window) function invocation, e.g.
|
|
29
|
+
* `ROW_NUMBER() OVER (PARTITION BY dept ORDER BY salary DESC)`.
|
|
30
|
+
*/
|
|
31
|
+
export interface OracleWindowFunctionOptions {
|
|
32
|
+
/** Analytic/aggregate function name, e.g. 'ROW_NUMBER', 'RANK', 'LAG' */
|
|
33
|
+
fn: string;
|
|
34
|
+
/** Arguments passed to the function, e.g. LAG(salary, 1, 0) -> [column, offset, default] */
|
|
35
|
+
args?: (string | number)[];
|
|
36
|
+
/** PARTITION BY column(s) */
|
|
37
|
+
partitionBy?: string | string[];
|
|
38
|
+
/** ORDER BY within the window */
|
|
39
|
+
orderBy?: Order;
|
|
40
|
+
/** Optional windowing (frame) clause */
|
|
41
|
+
frame?: {
|
|
42
|
+
type: 'ROWS' | 'RANGE';
|
|
43
|
+
/** e.g. 'UNBOUNDED PRECEDING', 'CURRENT ROW', '3 PRECEDING' */
|
|
44
|
+
start: string;
|
|
45
|
+
/** e.g. 'CURRENT ROW', '3 FOLLOWING', 'UNBOUNDED FOLLOWING' */
|
|
46
|
+
end?: string;
|
|
47
|
+
};
|
|
48
|
+
/** Alias for the resulting column (AS alias) */
|
|
49
|
+
as?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A single Common Table Expression definition for `WITH ... AS (...)`.
|
|
53
|
+
* Oracle does not use the `RECURSIVE` keyword (unlike Postgres/MySQL) -
|
|
54
|
+
* a CTE is recursive simply by referencing itself in `unionQuery`.
|
|
55
|
+
*/
|
|
56
|
+
export interface OracleCTEOptions {
|
|
57
|
+
/** CTE name */
|
|
58
|
+
name: string;
|
|
59
|
+
/** Optional explicit column list: WITH cte(col1, col2) AS (...) */
|
|
60
|
+
columns?: string[];
|
|
61
|
+
/** Anchor member query (or the full query body for non-recursive CTEs) */
|
|
62
|
+
query: string;
|
|
63
|
+
/** Recursive member query, combined with `query` via UNION ALL */
|
|
64
|
+
unionQuery?: string;
|
|
65
|
+
/** Bind values used by `query`/`unionQuery`, in order */
|
|
66
|
+
values?: any[];
|
|
67
|
+
}
|
|
68
|
+
/** Options for Oracle's hierarchical `CONNECT BY PRIOR` query syntax */
|
|
69
|
+
export interface OracleConnectByOptions {
|
|
70
|
+
tableName: string;
|
|
71
|
+
schema?: string;
|
|
72
|
+
/** Columns to select; defaults to '*' */
|
|
73
|
+
attributes?: string[];
|
|
74
|
+
/** Root-row predicate, e.g. "manager_id IS NULL" */
|
|
75
|
+
startWith?: string;
|
|
76
|
+
/** Parent/child relationship, e.g. "manager_id = PRIOR employee_id" */
|
|
77
|
+
connectByPrior: string;
|
|
78
|
+
/** Emit NOCYCLE to tolerate cyclic data without erroring */
|
|
79
|
+
nocycle?: boolean;
|
|
80
|
+
/** Extra WHERE predicate applied to the base rows */
|
|
81
|
+
where?: WhereOptions;
|
|
82
|
+
/** ORDER SIBLINGS BY clause (preserves hierarchy while sorting siblings) */
|
|
83
|
+
orderSiblingsBy?: Order;
|
|
84
|
+
/** Include the pseudo-columns LEVEL and CONNECT_BY_ISLEAF in the SELECT list */
|
|
85
|
+
includePseudoColumns?: boolean;
|
|
86
|
+
}
|
|
87
|
+
/** General-purpose Oracle `MERGE INTO ... USING ... ON (...)` builder options */
|
|
88
|
+
export interface OracleMergeOptions {
|
|
89
|
+
/** Target table to merge into */
|
|
90
|
+
targetTable: string;
|
|
91
|
+
targetSchema?: string;
|
|
92
|
+
/** Alias for the target table (defaults to none) */
|
|
93
|
+
targetAlias?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Source of the merge: a table name, `DUAL`, or a parenthesized subquery
|
|
96
|
+
* string, e.g. `(SELECT :1 AS id, :2 AS name FROM DUAL)`.
|
|
97
|
+
*/
|
|
98
|
+
using: string;
|
|
99
|
+
usingAlias?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Match key(s). All columns are ANDed together in the ON clause, correctly
|
|
102
|
+
* supporting composite keys, e.g. ['tenant_id', 'id'] ->
|
|
103
|
+
* `target."tenant_id" = source."tenant_id" AND target."id" = source."id"`.
|
|
104
|
+
*/
|
|
105
|
+
on: string[];
|
|
106
|
+
/** Raw override for the entire ON condition (takes precedence over `on`) */
|
|
107
|
+
onCondition?: string;
|
|
108
|
+
/** Columns to set in WHEN MATCHED THEN UPDATE SET col = source.col */
|
|
109
|
+
whenMatchedUpdate?: string[];
|
|
110
|
+
/** Optional AND condition appended to WHEN MATCHED */
|
|
111
|
+
whenMatchedCondition?: string;
|
|
112
|
+
/** WHEN MATCHED ... THEN DELETE, optionally gated by a condition */
|
|
113
|
+
whenMatchedDelete?: boolean | string;
|
|
114
|
+
/** Columns to insert in WHEN NOT MATCHED THEN INSERT (cols) VALUES (source.cols) */
|
|
115
|
+
whenNotMatchedInsert?: string[];
|
|
116
|
+
/** Optional AND condition appended to WHEN NOT MATCHED */
|
|
117
|
+
whenNotMatchedCondition?: string;
|
|
118
|
+
/** Bind values referenced by the `using` subquery, in placeholder order */
|
|
119
|
+
values?: any[];
|
|
120
|
+
}
|
|
121
|
+
/** Options for Oracle's `PIVOT` clause */
|
|
122
|
+
export interface OraclePivotOptions {
|
|
123
|
+
/** Source table name or a parenthesized subquery */
|
|
124
|
+
sourceQuery: string;
|
|
125
|
+
/** Aggregate expression(s) applied per pivoted value, e.g. 'SUM(sales)' or with alias */
|
|
126
|
+
aggregate: string | {
|
|
127
|
+
expr: string;
|
|
128
|
+
as?: string;
|
|
129
|
+
} | (string | {
|
|
130
|
+
expr: string;
|
|
131
|
+
as?: string;
|
|
132
|
+
})[];
|
|
133
|
+
/** Column being pivoted */
|
|
134
|
+
pivotColumn: string;
|
|
135
|
+
/** Values to pivot into columns, optionally aliased */
|
|
136
|
+
pivotValues: (string | number | {
|
|
137
|
+
value: string | number;
|
|
138
|
+
as?: string;
|
|
139
|
+
})[];
|
|
140
|
+
/** Alias for the pivoted result set */
|
|
141
|
+
alias?: string;
|
|
142
|
+
}
|
|
143
|
+
/** Options for Oracle's `UNPIVOT` clause */
|
|
144
|
+
export interface OracleUnpivotOptions {
|
|
145
|
+
/** Source table name or a parenthesized subquery */
|
|
146
|
+
sourceQuery: string;
|
|
147
|
+
/** Name of the generated value column */
|
|
148
|
+
valueColumn: string;
|
|
149
|
+
/** Name of the generated "for" column identifying which source column a row came from */
|
|
150
|
+
forColumn: string;
|
|
151
|
+
/** Source columns to unpivot, optionally aliased to a display value */
|
|
152
|
+
inColumns: (string | {
|
|
153
|
+
column: string;
|
|
154
|
+
as?: string;
|
|
155
|
+
})[];
|
|
156
|
+
/** Include rows whose value would otherwise be NULL */
|
|
157
|
+
includeNulls?: boolean;
|
|
158
|
+
/** Alias for the unpivoted result set */
|
|
159
|
+
alias?: string;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Options for creating an Oracle PL/SQL package (`CREATE PACKAGE`) and/or its
|
|
163
|
+
* body (`CREATE PACKAGE BODY`). Packages are Oracle's primary code-organization
|
|
164
|
+
* idiom — a namespaced group of procedures, functions, types, and package-level
|
|
165
|
+
* state — none of which standalone `CREATE PROCEDURE` can express.
|
|
166
|
+
*/
|
|
167
|
+
export interface OraclePackageOptions {
|
|
168
|
+
/** Package name */
|
|
169
|
+
name: string;
|
|
170
|
+
/** Schema the package lives in (defaults to the dialect's configured schema) */
|
|
171
|
+
schema?: string;
|
|
172
|
+
/** Package specification body (the declarations between `IS`/`AS` and `END`) */
|
|
173
|
+
spec?: string;
|
|
174
|
+
/** Package implementation body (the declarations between `IS`/`AS` and `END`) */
|
|
175
|
+
body?: string;
|
|
176
|
+
/** Emit `CREATE OR REPLACE` (default true) */
|
|
177
|
+
replace?: boolean;
|
|
178
|
+
}
|
|
179
|
+
/** Options describing an Oracle flashback (`AS OF`) point-in-time read. */
|
|
180
|
+
export interface OracleFlashbackOptions {
|
|
181
|
+
/** Read the table as of this wall-clock timestamp (`AS OF TIMESTAMP ...`). */
|
|
182
|
+
timestamp?: string | Date;
|
|
183
|
+
/** Read the table as of this System Change Number (`AS OF SCN ...`). */
|
|
184
|
+
scn?: number | string;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Options for creating an Oracle external table (`ORGANIZATION EXTERNAL`), the
|
|
188
|
+
* native Oracle replacement for PostgreSQL-style foreign tables / FDW.
|
|
189
|
+
*/
|
|
190
|
+
export interface OracleExternalTableOptions {
|
|
191
|
+
/** Column definitions: name -> Oracle column type SQL (e.g. `VARCHAR2(100)`). */
|
|
192
|
+
columns: Record<string, string>;
|
|
193
|
+
/** Access driver type: ORACLE_LOADER (flat files) or ORACLE_DATAPUMP. */
|
|
194
|
+
type?: 'ORACLE_LOADER' | 'ORACLE_DATAPUMP';
|
|
195
|
+
/** Directory object the data files live in (`DEFAULT DIRECTORY dir`). */
|
|
196
|
+
directory: string;
|
|
197
|
+
/** Raw access-parameters block placed inside `ACCESS PARAMETERS (...)`. */
|
|
198
|
+
accessParameters?: string;
|
|
199
|
+
/** Data file name(s) referenced by `LOCATION (...)`. */
|
|
200
|
+
location: string | string[];
|
|
201
|
+
/** Emit `REJECT LIMIT UNLIMITED` (default) or a specific numeric reject limit. */
|
|
202
|
+
rejectLimit?: number | 'UNLIMITED';
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Oracle dialect class that implements the Dialect interface
|
|
206
|
+
*/
|
|
207
|
+
export declare class OracleDialect implements Dialect {
|
|
208
|
+
readonly name = "oracle";
|
|
209
|
+
readonly library = "oracledb";
|
|
210
|
+
private pool;
|
|
211
|
+
private _isConnected;
|
|
212
|
+
private config;
|
|
213
|
+
private retryOptions;
|
|
214
|
+
constructor(config: OracleDialectOptions);
|
|
215
|
+
/**
|
|
216
|
+
* Execute a function with retry logic
|
|
217
|
+
*/
|
|
218
|
+
private withRetry;
|
|
219
|
+
/**
|
|
220
|
+
* Escape a string for SQL (replace ' with '')
|
|
221
|
+
*/
|
|
222
|
+
private escapeString;
|
|
223
|
+
/**
|
|
224
|
+
* Connect to the Oracle database
|
|
225
|
+
*/
|
|
226
|
+
connect(): Promise<void>;
|
|
227
|
+
/**
|
|
228
|
+
* Disconnect from the Oracle database
|
|
229
|
+
*/
|
|
230
|
+
disconnect(): Promise<void>;
|
|
231
|
+
/**
|
|
232
|
+
* Get the current connection from pool
|
|
233
|
+
*/
|
|
234
|
+
getConnection(): Promise<Connection>;
|
|
235
|
+
/**
|
|
236
|
+
* Check if connected
|
|
237
|
+
*/
|
|
238
|
+
isConnected(): boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Stream query results using a correct ROWNUM-windowed pagination query
|
|
241
|
+
* (see `createOracleQueryStream()` in `src/dialects/query-stream-helper.ts`)
|
|
242
|
+
* rather than this dialect's own `buildLimitOffset()`, whose bare
|
|
243
|
+
* `WHERE ROWNUM <= n` doesn't actually skip the first `offset` rows.
|
|
244
|
+
* @param sql - The SELECT statement to stream
|
|
245
|
+
* @param options - Streaming options (batch size, backpressure watermark, model mapping)
|
|
246
|
+
*/
|
|
247
|
+
queryStream(sql: string, options?: StreamOptions): Readable;
|
|
248
|
+
/**
|
|
249
|
+
* Execute a query
|
|
250
|
+
*/
|
|
251
|
+
query(sql: string, options?: QueryOptions): Promise<QueryResult>;
|
|
252
|
+
/**
|
|
253
|
+
* Escape a value for use in a query
|
|
254
|
+
*/
|
|
255
|
+
escape(value: any): string;
|
|
256
|
+
/**
|
|
257
|
+
* Escape an identifier (Oracle uses double quotes, same as quoteIdentifier).
|
|
258
|
+
* Without the surrounding quotes, Oracle folds unquoted identifiers to
|
|
259
|
+
* uppercase, which breaks lookups for mixed-case table/column names created
|
|
260
|
+
* elsewhere via quoteIdentifier()/quoteTable().
|
|
261
|
+
*/
|
|
262
|
+
escapeId(identifier: unknown): string;
|
|
263
|
+
/**
|
|
264
|
+
* Quote an identifier with double quotes (Oracle standard)
|
|
265
|
+
*/
|
|
266
|
+
quoteIdentifier(identifier: unknown): string;
|
|
267
|
+
/**
|
|
268
|
+
* Quote a table name with optional schema
|
|
269
|
+
*/
|
|
270
|
+
quoteTable(tableName: string, schema?: string): string;
|
|
271
|
+
/**
|
|
272
|
+
* Get database version
|
|
273
|
+
*/
|
|
274
|
+
getDatabaseVersion(): Promise<string>;
|
|
275
|
+
/**
|
|
276
|
+
* `IF [NOT] EXISTS` on `CREATE`/`DROP` DDL (tables, users, roles, etc.) was
|
|
277
|
+
* only added in Oracle 23c. Against the 19c/21c versions this dialect
|
|
278
|
+
* otherwise targets, that syntax raises `ORA-00922: missing or invalid
|
|
279
|
+
* option`. This helper provides a portable, version-independent
|
|
280
|
+
* equivalent by wrapping the plain (no `IF [NOT] EXISTS`) DDL statement in
|
|
281
|
+
* an anonymous PL/SQL block that executes it via `EXECUTE IMMEDIATE` and
|
|
282
|
+
* swallows only the specific "already exists" / "does not exist" ORA
|
|
283
|
+
* error code(s) supplied, letting any other failure propagate normally.
|
|
284
|
+
*
|
|
285
|
+
* @param sql - The plain DDL statement, without any `IF [NOT] EXISTS`.
|
|
286
|
+
* @param oraCodes - The ORA error number(s) (positive, e.g. `955` for
|
|
287
|
+
* ORA-00955) that should be silently ignored.
|
|
288
|
+
*/
|
|
289
|
+
private wrapIgnoringOraErrors;
|
|
290
|
+
/** ORA-00955: name is already used by an existing object. */
|
|
291
|
+
private static readonly ORA_NAME_ALREADY_USED;
|
|
292
|
+
/** ORA-01920: user name conflicts with another user or role name. */
|
|
293
|
+
private static readonly ORA_USER_ALREADY_EXISTS;
|
|
294
|
+
/** ORA-01921: role name conflicts with another user or role name. */
|
|
295
|
+
private static readonly ORA_ROLE_ALREADY_EXISTS;
|
|
296
|
+
/** ORA-00942: table or view does not exist. */
|
|
297
|
+
private static readonly ORA_TABLE_DOES_NOT_EXIST;
|
|
298
|
+
/** ORA-01918: user does not exist. */
|
|
299
|
+
private static readonly ORA_USER_DOES_NOT_EXIST;
|
|
300
|
+
/** ORA-01919: role does not exist. */
|
|
301
|
+
private static readonly ORA_ROLE_DOES_NOT_EXIST;
|
|
302
|
+
/** ORA-02289: sequence does not exist. */
|
|
303
|
+
private static readonly ORA_SEQUENCE_DOES_NOT_EXIST;
|
|
304
|
+
/**
|
|
305
|
+
* Create a schema.
|
|
306
|
+
*
|
|
307
|
+
* Oracle has a `CREATE SCHEMA` statement, but it only exists to bundle a
|
|
308
|
+
* batch of `CREATE TABLE`/`CREATE VIEW`/`GRANT` statements into one
|
|
309
|
+
* transaction (`CREATE SCHEMA AUTHORIZATION x <stmt> <stmt> ...`) - it does
|
|
310
|
+
* not, by itself, create a schema as a standalone object, and
|
|
311
|
+
* `CREATE SCHEMA AUTHORIZATION x` with no accompanying statements is not
|
|
312
|
+
* valid Oracle usage. In Oracle a schema *is* a user (every user owns
|
|
313
|
+
* exactly one schema, and objects are always created "in" a user's
|
|
314
|
+
* schema), so creating a schema really means creating a user. A random
|
|
315
|
+
* password is generated since `CREATE USER` requires one; callers that
|
|
316
|
+
* need a specific password (or other user attributes) should use the
|
|
317
|
+
* User Management API (`buildCreateUserQuery`/`UserManager.createUser`)
|
|
318
|
+
* directly instead.
|
|
319
|
+
*/
|
|
320
|
+
createSchema(schema: string): Promise<void>;
|
|
321
|
+
/**
|
|
322
|
+
* Drop a schema.
|
|
323
|
+
*
|
|
324
|
+
* Since a schema in Oracle *is* a user, dropping a schema means dropping
|
|
325
|
+
* that user (`DROP SCHEMA`/`DROP SCHEMA ... CASCADE` are not Oracle
|
|
326
|
+
* statements at all). `CASCADE` is always applied so that the user's
|
|
327
|
+
* owned objects are dropped along with the user, matching the intent of
|
|
328
|
+
* "drop this schema and everything in it". When `ifExists` is requested,
|
|
329
|
+
* the statement is wrapped so that ORA-01918 ("user does not exist") is
|
|
330
|
+
* silently ignored (see {@link wrapIgnoringOraErrors}); Oracle's own
|
|
331
|
+
* `DROP USER ... IF EXISTS` syntax is 23c-only and would fail against the
|
|
332
|
+
* 19c/21c versions this dialect targets.
|
|
333
|
+
*/
|
|
334
|
+
dropSchema(schema: string, options?: DropSchemaOptions): Promise<void>;
|
|
335
|
+
/**
|
|
336
|
+
* Show all schemas
|
|
337
|
+
*/
|
|
338
|
+
showAllSchemas(): Promise<string[]>;
|
|
339
|
+
/**
|
|
340
|
+
* List all schemas (Oracle users)
|
|
341
|
+
*/
|
|
342
|
+
listSchemas(): Promise<string[]>;
|
|
343
|
+
/**
|
|
344
|
+
* Create database SQL (Oracle uses tablespaces)
|
|
345
|
+
*/
|
|
346
|
+
createDatabaseSQL(options: {
|
|
347
|
+
name: string;
|
|
348
|
+
encoding?: string;
|
|
349
|
+
tablespace?: string;
|
|
350
|
+
}): string;
|
|
351
|
+
/**
|
|
352
|
+
* Drop database SQL
|
|
353
|
+
*/
|
|
354
|
+
dropDatabaseSQL(name: string): string;
|
|
355
|
+
/**
|
|
356
|
+
* Create a table
|
|
357
|
+
*/
|
|
358
|
+
createTable(tableName: string, columns: Record<string, ColumnDefinition>, options?: TableOptions): Promise<void>;
|
|
359
|
+
/**
|
|
360
|
+
* Build column definition for Oracle
|
|
361
|
+
*/
|
|
362
|
+
private buildColumnDefinition;
|
|
363
|
+
/**
|
|
364
|
+
* Build constraint definition
|
|
365
|
+
*/
|
|
366
|
+
private buildConstraintDefinition;
|
|
367
|
+
/**
|
|
368
|
+
* Drop a table
|
|
369
|
+
*/
|
|
370
|
+
dropTable(tableName: string, options?: DropTableOptions): Promise<void>;
|
|
371
|
+
/**
|
|
372
|
+
* Create partitioned table (Oracle supports RANGE, LIST, HASH, and INTERVAL partitioning)
|
|
373
|
+
*/
|
|
374
|
+
createPartitionedTable(tableName: string, columns: Record<string, ColumnDefinition>, options?: TableOptions & {
|
|
375
|
+
partitionBy: {
|
|
376
|
+
type: 'range' | 'list' | 'hash' | 'interval' | 'reference';
|
|
377
|
+
/** Partition key column(s). Not used (and not required) for 'reference' partitioning. */
|
|
378
|
+
column?: string | string[];
|
|
379
|
+
interval?: string;
|
|
380
|
+
/**
|
|
381
|
+
* Name of the FK constraint (defined on this table) whose parent
|
|
382
|
+
* table's partitioning scheme should be inherited. Required when
|
|
383
|
+
* `type` is 'reference'.
|
|
384
|
+
* Oracle syntax: `PARTITION BY REFERENCE (constraint_name)`.
|
|
385
|
+
*/
|
|
386
|
+
referenceConstraint?: string;
|
|
387
|
+
};
|
|
388
|
+
partitions?: {
|
|
389
|
+
name: string;
|
|
390
|
+
bound?: PartitionBound | PartitionListBound | PartitionHashBound;
|
|
391
|
+
tablespace?: string;
|
|
392
|
+
storageParameters?: Record<string, string | number>;
|
|
393
|
+
compression?: boolean;
|
|
394
|
+
}[];
|
|
395
|
+
subpartitionBy?: {
|
|
396
|
+
type: 'range' | 'list' | 'hash';
|
|
397
|
+
column: string | string[];
|
|
398
|
+
};
|
|
399
|
+
subpartitions?: {
|
|
400
|
+
name: string;
|
|
401
|
+
bound?: PartitionBound | PartitionListBound | PartitionHashBound;
|
|
402
|
+
tablespace?: string;
|
|
403
|
+
}[];
|
|
404
|
+
}): Promise<void>;
|
|
405
|
+
/**
|
|
406
|
+
* Create partition
|
|
407
|
+
* Supports subpartitions in Oracle
|
|
408
|
+
*/
|
|
409
|
+
createPartition(options: CreatePartitionOptions & {
|
|
410
|
+
subpartitionBy?: {
|
|
411
|
+
type: 'range' | 'list' | 'hash';
|
|
412
|
+
column: string | string[];
|
|
413
|
+
};
|
|
414
|
+
subpartitions?: {
|
|
415
|
+
name: string;
|
|
416
|
+
bound?: PartitionBound | PartitionListBound | PartitionHashBound;
|
|
417
|
+
tablespace?: string;
|
|
418
|
+
}[];
|
|
419
|
+
tablespace?: string;
|
|
420
|
+
compression?: boolean;
|
|
421
|
+
storageParameters?: Record<string, string | number>;
|
|
422
|
+
}): Promise<void>;
|
|
423
|
+
/**
|
|
424
|
+
* "Attach" a partition (Oracle has no PostgreSQL-style `ATTACH PARTITION`
|
|
425
|
+
* statement). The real Oracle equivalent for bringing an existing
|
|
426
|
+
* standalone table's data into a partitioned table's partition is
|
|
427
|
+
* `ALTER TABLE ... EXCHANGE PARTITION ... WITH TABLE ...`, which swaps the
|
|
428
|
+
* data segment of the partition with that of the standalone table as a
|
|
429
|
+
* fast, DDL-only (no data movement) operation.
|
|
430
|
+
*
|
|
431
|
+
* `options.exchangeTable` names the standalone table whose data becomes
|
|
432
|
+
* the partition's data; it defaults to `options.partitionName` for
|
|
433
|
+
* backwards compatibility with callers that used the partition name and
|
|
434
|
+
* the exchange-table name interchangeably.
|
|
435
|
+
*/
|
|
436
|
+
attachPartition(options: AttachPartitionOptions & {
|
|
437
|
+
exchangeTable?: string;
|
|
438
|
+
includingIndexes?: boolean;
|
|
439
|
+
validation?: 'WITH VALIDATION' | 'WITHOUT VALIDATION';
|
|
440
|
+
}): Promise<void>;
|
|
441
|
+
/**
|
|
442
|
+
* "Detach" a partition (Oracle has no PostgreSQL-style `DETACH PARTITION`
|
|
443
|
+
* statement). The real Oracle equivalent for extracting a partition's data
|
|
444
|
+
* out into a standalone table is the same `EXCHANGE PARTITION` statement
|
|
445
|
+
* used by {@link attachPartition} - it symmetrically swaps segments, so
|
|
446
|
+
* "detaching" is exchanging the partition with an (often empty) standalone
|
|
447
|
+
* table, leaving that table holding the former partition's data.
|
|
448
|
+
*/
|
|
449
|
+
detachPartition(options: DetachPartitionOptions & {
|
|
450
|
+
parentTable: string;
|
|
451
|
+
exchangeTable?: string;
|
|
452
|
+
includingIndexes?: boolean;
|
|
453
|
+
}): Promise<void>;
|
|
454
|
+
/**
|
|
455
|
+
* Drop partition
|
|
456
|
+
* Enhanced with cascade option for Oracle
|
|
457
|
+
*/
|
|
458
|
+
dropPartition(partitionName: string, options?: {
|
|
459
|
+
ifExists?: boolean;
|
|
460
|
+
cascade?: boolean;
|
|
461
|
+
updateIndexes?: boolean;
|
|
462
|
+
}): Promise<void>;
|
|
463
|
+
/**
|
|
464
|
+
* Add a partition to an existing partitioned table (Oracle)
|
|
465
|
+
* @param tableName - Name of the partitioned table
|
|
466
|
+
* @param partitionName - Name for the new partition
|
|
467
|
+
* @param partitionSpec - Partition specification
|
|
468
|
+
*/
|
|
469
|
+
addPartition(tableName: string, partitionName: string, partitionSpec: {
|
|
470
|
+
values?: string;
|
|
471
|
+
forValues?: string;
|
|
472
|
+
}): Promise<void>;
|
|
473
|
+
/**
|
|
474
|
+
* List partitions for a table with details
|
|
475
|
+
*/
|
|
476
|
+
listPartitions(tableName: string): Promise<Array<{
|
|
477
|
+
partitionName: string;
|
|
478
|
+
partitionPosition: number;
|
|
479
|
+
highValue: string;
|
|
480
|
+
partitionType: string;
|
|
481
|
+
tablespaceName: string;
|
|
482
|
+
compression: string;
|
|
483
|
+
numRows: number;
|
|
484
|
+
}>>;
|
|
485
|
+
/**
|
|
486
|
+
* Modify partition (move, compress)
|
|
487
|
+
*/
|
|
488
|
+
modifyPartition(tableName: string, partitionName: string, options?: {
|
|
489
|
+
move?: boolean;
|
|
490
|
+
compress?: boolean;
|
|
491
|
+
tablespace?: string;
|
|
492
|
+
storageParameters?: Record<string, string | number>;
|
|
493
|
+
updateIndexes?: boolean;
|
|
494
|
+
}): Promise<void>;
|
|
495
|
+
/**
|
|
496
|
+
* Create foreign data wrapper (stub)
|
|
497
|
+
* Oracle uses Data Guard instead of FDW
|
|
498
|
+
*/
|
|
499
|
+
createForeignDataWrapper(_fdwName: string, _options?: {
|
|
500
|
+
handler?: string;
|
|
501
|
+
}): Promise<void>;
|
|
502
|
+
/**
|
|
503
|
+
* Drop foreign data wrapper (stub)
|
|
504
|
+
* Oracle uses Data Guard instead of FDW
|
|
505
|
+
*/
|
|
506
|
+
dropForeignDataWrapper(_fdwName: string, _options?: {
|
|
507
|
+
ifExists?: boolean;
|
|
508
|
+
}): Promise<void>;
|
|
509
|
+
/**
|
|
510
|
+
* Create foreign server (stub)
|
|
511
|
+
* Oracle uses Data Guard instead of FDW
|
|
512
|
+
*/
|
|
513
|
+
createForeignServer(_serverName: string, _fdwName: string, _options?: {
|
|
514
|
+
options?: Record<string, string>;
|
|
515
|
+
ifNotExists?: boolean;
|
|
516
|
+
}): Promise<void>;
|
|
517
|
+
/**
|
|
518
|
+
* Drop foreign server (stub)
|
|
519
|
+
* Oracle uses Data Guard instead of FDW
|
|
520
|
+
*/
|
|
521
|
+
dropForeignServer(_serverName: string, _options?: {
|
|
522
|
+
ifExists?: boolean;
|
|
523
|
+
}): Promise<void>;
|
|
524
|
+
/**
|
|
525
|
+
* Create foreign table (stub)
|
|
526
|
+
* Oracle uses Data Guard instead of FDW
|
|
527
|
+
*/
|
|
528
|
+
createForeignTable(_tableName: string, _columns: Record<string, any>, _options?: {
|
|
529
|
+
serverName: string;
|
|
530
|
+
schema?: string;
|
|
531
|
+
options?: Record<string, string>;
|
|
532
|
+
ifNotExists?: boolean;
|
|
533
|
+
}): Promise<void>;
|
|
534
|
+
/**
|
|
535
|
+
* Create user mapping (stub)
|
|
536
|
+
* Oracle uses Data Guard instead of FDW
|
|
537
|
+
*/
|
|
538
|
+
createUserMapping(_serverName: string, _userName: string, _options?: {
|
|
539
|
+
options?: Record<string, string>;
|
|
540
|
+
ifNotExists?: boolean;
|
|
541
|
+
}): Promise<void>;
|
|
542
|
+
/**
|
|
543
|
+
* Drop user mapping (stub)
|
|
544
|
+
* Oracle uses Data Guard instead of FDW
|
|
545
|
+
*/
|
|
546
|
+
dropUserMapping(_serverName: string, _userName: string, _options?: {
|
|
547
|
+
ifExists?: boolean;
|
|
548
|
+
}): Promise<void>;
|
|
549
|
+
changeOwner(_newOwner: string, _tableName: string): Promise<void>;
|
|
550
|
+
addConstraint(_tableName: string, _options: {
|
|
551
|
+
type: 'UNIQUE' | 'CHECK' | 'PRIMARY KEY' | 'FOREIGN KEY';
|
|
552
|
+
fields: string[];
|
|
553
|
+
name?: string;
|
|
554
|
+
references?: {
|
|
555
|
+
table: string;
|
|
556
|
+
fields: string[];
|
|
557
|
+
};
|
|
558
|
+
check?: string;
|
|
559
|
+
}): Promise<void>;
|
|
560
|
+
removeConstraint(_tableName: string, _constraintName: string): Promise<void>;
|
|
561
|
+
createSecurityPolicy(_policyName: string, _tableName: string, _options?: {
|
|
562
|
+
predicate?: string;
|
|
563
|
+
}): Promise<void>;
|
|
564
|
+
dropSecurityPolicy(_policyName: string, _tableName: string): Promise<void>;
|
|
565
|
+
/**
|
|
566
|
+
* Create a view
|
|
567
|
+
*/
|
|
568
|
+
createView(viewName: string, query: string, options?: ViewOptions): Promise<void>;
|
|
569
|
+
/**
|
|
570
|
+
* Drop a view
|
|
571
|
+
*/
|
|
572
|
+
dropView(viewName: string, options?: DropViewOptions): Promise<void>;
|
|
573
|
+
/**
|
|
574
|
+
* Show all views
|
|
575
|
+
*/
|
|
576
|
+
showViews(): Promise<string[]>;
|
|
577
|
+
/**
|
|
578
|
+
* Create a materialized view
|
|
579
|
+
* Oracle syntax:
|
|
580
|
+
* CREATE MATERIALIZED VIEW mv_name
|
|
581
|
+
* BUILD [IMMEDIATE | DEFERRED]
|
|
582
|
+
* REFRESH [FAST | COMPLETE | FORCE]
|
|
583
|
+
* ON [COMMIT | DEMAND]
|
|
584
|
+
* AS query
|
|
585
|
+
*/
|
|
586
|
+
createMaterializedView(options: MaterializedViewOptions): Promise<void>;
|
|
587
|
+
/**
|
|
588
|
+
* Refresh a materialized view
|
|
589
|
+
* Oracle supports: FAST, COMPLETE, FORCE
|
|
590
|
+
* - FAST: Incremental refresh using materialized view logs
|
|
591
|
+
* - COMPLETE: Full refresh (recreates the entire view)
|
|
592
|
+
* - FORCE: Tries FAST, falls back to COMPLETE if not possible
|
|
593
|
+
*/
|
|
594
|
+
refreshMaterializedView(viewName: string, options?: RefreshOptions): Promise<void>;
|
|
595
|
+
/**
|
|
596
|
+
* Drop a materialized view
|
|
597
|
+
*/
|
|
598
|
+
dropMaterializedView(viewName: string, options?: DropMaterializedViewOptions): Promise<void>;
|
|
599
|
+
/**
|
|
600
|
+
* Show all materialized views
|
|
601
|
+
*/
|
|
602
|
+
showMaterializedViews(): Promise<string[]>;
|
|
603
|
+
/**
|
|
604
|
+
* Check if a materialized view exists
|
|
605
|
+
* @param viewName - Name of the materialized view
|
|
606
|
+
* @param schema - Optional schema name
|
|
607
|
+
* @returns True if the materialized view exists
|
|
608
|
+
*/
|
|
609
|
+
hasMaterializedView(viewName: string, schema?: string): Promise<boolean>;
|
|
610
|
+
/**
|
|
611
|
+
* Add comment to materialized view
|
|
612
|
+
*/
|
|
613
|
+
private commentMaterializedView;
|
|
614
|
+
/**
|
|
615
|
+
* Create a materialized view log on a master table.
|
|
616
|
+
*
|
|
617
|
+
* FAST (incremental) refresh - as used by `refreshMaterializedView()` -
|
|
618
|
+
* requires a materialized view log on every master table referenced by the
|
|
619
|
+
* materialized view; without one, `DBMS_MVIEW.REFRESH(..., 'F')` fails with
|
|
620
|
+
* ORA-23413. This creates that log.
|
|
621
|
+
*
|
|
622
|
+
* Oracle syntax:
|
|
623
|
+
* ```sql
|
|
624
|
+
* CREATE MATERIALIZED VIEW LOG ON table_name
|
|
625
|
+
* WITH [ROWID] [, PRIMARY KEY] [, SEQUENCE] [(col1, col2, ...)] [INCLUDING NEW VALUES]
|
|
626
|
+
* ```
|
|
627
|
+
*/
|
|
628
|
+
createMaterializedViewLog(tableName: string, options?: MaterializedViewLogOptions): Promise<void>;
|
|
629
|
+
/**
|
|
630
|
+
* Drop a materialized view log from a master table.
|
|
631
|
+
* Oracle syntax: `DROP MATERIALIZED VIEW LOG ON table_name`
|
|
632
|
+
* (Oracle has no `IF EXISTS` variant for this statement.)
|
|
633
|
+
*/
|
|
634
|
+
dropMaterializedViewLog(tableName: string, options?: Pick<MaterializedViewLogOptions, 'schema'>): Promise<void>;
|
|
635
|
+
/**
|
|
636
|
+
* Add a column
|
|
637
|
+
*/
|
|
638
|
+
addColumn(tableName: string, columnName: string, definition: ColumnDefinition): Promise<void>;
|
|
639
|
+
/**
|
|
640
|
+
* Remove a column
|
|
641
|
+
*/
|
|
642
|
+
removeColumn(tableName: string, columnName: string): Promise<void>;
|
|
643
|
+
/**
|
|
644
|
+
* Change a column
|
|
645
|
+
*/
|
|
646
|
+
changeColumn(tableName: string, columnName: string, definition: ColumnDefinition): Promise<void>;
|
|
647
|
+
/**
|
|
648
|
+
* Describe a table
|
|
649
|
+
*/
|
|
650
|
+
describeTable(tableName: string): Promise<TableDescription>;
|
|
651
|
+
/**
|
|
652
|
+
* Rename a table
|
|
653
|
+
*/
|
|
654
|
+
renameTable(oldName: string, newName: string): Promise<void>;
|
|
655
|
+
/**
|
|
656
|
+
* Show all tables
|
|
657
|
+
*/
|
|
658
|
+
showTables(): Promise<string[]>;
|
|
659
|
+
/**
|
|
660
|
+
* Get table status (Oracle implementation)
|
|
661
|
+
*/
|
|
662
|
+
getTableStatus(tableName?: string): Promise<Record<string, any>[]>;
|
|
663
|
+
/**
|
|
664
|
+
* Get table create statement (Oracle implementation)
|
|
665
|
+
*/
|
|
666
|
+
getCreateTable(tableName: string): Promise<string>;
|
|
667
|
+
/**
|
|
668
|
+
* Check if a table has partitions (Oracle implementation)
|
|
669
|
+
*/
|
|
670
|
+
hasPartition(tableName: string): Promise<boolean>;
|
|
671
|
+
/**
|
|
672
|
+
* Show constraints for a table
|
|
673
|
+
*/
|
|
674
|
+
showConstraints(tableName: string): Promise<any[]>;
|
|
675
|
+
/**
|
|
676
|
+
* Show indexes for a table
|
|
677
|
+
*/
|
|
678
|
+
showIndexes(tableName: string): Promise<any[]>;
|
|
679
|
+
/**
|
|
680
|
+
* Add an index
|
|
681
|
+
*/
|
|
682
|
+
addIndex(tableName: string, indexName: string, fields: string[], options?: IndexOptions): Promise<void>;
|
|
683
|
+
/**
|
|
684
|
+
* Build CREATE INDEX SQL
|
|
685
|
+
*/
|
|
686
|
+
private buildCreateIndexSql;
|
|
687
|
+
/**
|
|
688
|
+
* Remove an index
|
|
689
|
+
*/
|
|
690
|
+
removeIndex(tableName: string, indexName: string): Promise<void>;
|
|
691
|
+
/**
|
|
692
|
+
* Create an index with full options
|
|
693
|
+
*/
|
|
694
|
+
createIndex(tableName: string, indexDef: IndexDefinition): Promise<void>;
|
|
695
|
+
/**
|
|
696
|
+
* Drop an index
|
|
697
|
+
*/
|
|
698
|
+
dropIndex(tableName: string, indexName: string, _options?: {
|
|
699
|
+
ifExists?: boolean;
|
|
700
|
+
cascade?: boolean;
|
|
701
|
+
}): Promise<void>;
|
|
702
|
+
/**
|
|
703
|
+
* Create a constraint
|
|
704
|
+
*/
|
|
705
|
+
createConstraint(tableName: string, constraintDef: ConstraintDefinition): Promise<void>;
|
|
706
|
+
/**
|
|
707
|
+
* Drop a constraint
|
|
708
|
+
*/
|
|
709
|
+
dropConstraint(tableName: string, constraintName: string, options?: DropConstraintOptions): Promise<void>;
|
|
710
|
+
/**
|
|
711
|
+
* Oracle only genuinely supports two isolation levels via
|
|
712
|
+
* `SET TRANSACTION ISOLATION LEVEL`: READ COMMITTED (the default) and
|
|
713
|
+
* SERIALIZABLE. It also supports `SET TRANSACTION READ ONLY`, which is not
|
|
714
|
+
* an isolation level but is sometimes requested through the same option.
|
|
715
|
+
* The ANSI four-level model (READ UNCOMMITTED, REPEATABLE READ) that other
|
|
716
|
+
* dialects in this codebase assume has no equivalent in Oracle's
|
|
717
|
+
* multiversion-concurrency-control engine, so rather than silently
|
|
718
|
+
* downgrading to a different (and misleadingly named) guarantee, we throw
|
|
719
|
+
* a clear error for anything Oracle can't actually provide.
|
|
720
|
+
*/
|
|
721
|
+
private static readonly SUPPORTED_ISOLATION_LEVELS;
|
|
722
|
+
/**
|
|
723
|
+
* Start a transaction
|
|
724
|
+
*/
|
|
725
|
+
startTransaction(options?: TransactionOptions): Promise<Transaction>;
|
|
726
|
+
/**
|
|
727
|
+
* Commit a transaction
|
|
728
|
+
*/
|
|
729
|
+
/**
|
|
730
|
+
* Generate SQL for creating a savepoint
|
|
731
|
+
*/
|
|
732
|
+
createSavepointSQL(name?: string): string;
|
|
733
|
+
/**
|
|
734
|
+
* Generate SQL for releasing a savepoint
|
|
735
|
+
*/
|
|
736
|
+
releaseSavepointSQL(name: string): string;
|
|
737
|
+
/**
|
|
738
|
+
* Generate SQL for rolling back to a savepoint
|
|
739
|
+
*/
|
|
740
|
+
rollbackToSavepointSQL(name: string): string;
|
|
741
|
+
/**
|
|
742
|
+
* Commit a transaction
|
|
743
|
+
*/
|
|
744
|
+
commitTransaction(transaction: Transaction): Promise<void>;
|
|
745
|
+
/**
|
|
746
|
+
* Rollback a transaction
|
|
747
|
+
*/
|
|
748
|
+
rollbackTransaction(transaction: Transaction): Promise<void>;
|
|
749
|
+
/**
|
|
750
|
+
* Get SQL for a data type
|
|
751
|
+
*/
|
|
752
|
+
getDataTypeSql(dataType: DataType): string;
|
|
753
|
+
/**
|
|
754
|
+
* Map ORM data type to Oracle data type
|
|
755
|
+
*
|
|
756
|
+
* `attrs` carries the optional `length`/`precision`/`scale` fields present
|
|
757
|
+
* on types like `DataTypeString` and `DataTypeNumber`/`DataTypeDecimal`
|
|
758
|
+
* (see `src/types/index.ts`) so that, e.g., `STRING(4000)` correctly emits
|
|
759
|
+
* `VARCHAR2(4000)` and `DECIMAL(18,4)` emits `NUMBER(18,4)` instead of
|
|
760
|
+
* silently falling back to the default sizes.
|
|
761
|
+
*/
|
|
762
|
+
private mapDataType;
|
|
763
|
+
/**
|
|
764
|
+
* Build WHERE clause
|
|
765
|
+
*/
|
|
766
|
+
buildWhereClause(where: WhereOptions, options?: BuildOptions): {
|
|
767
|
+
sql: string;
|
|
768
|
+
values: any[];
|
|
769
|
+
};
|
|
770
|
+
/**
|
|
771
|
+
* Build operator WHERE clause
|
|
772
|
+
*/
|
|
773
|
+
private buildOperatorWhere;
|
|
774
|
+
/**
|
|
775
|
+
* Build ORDER BY clause
|
|
776
|
+
*/
|
|
777
|
+
buildOrderClause(order: Order, _options?: BuildOptions): string;
|
|
778
|
+
/**
|
|
779
|
+
* Build a list of ORDER BY items (without the leading `ORDER BY` keyword),
|
|
780
|
+
* suitable for embedding inside `OVER (...)` / `WITHIN GROUP (...)` clauses.
|
|
781
|
+
*/
|
|
782
|
+
private buildOrderByItems;
|
|
783
|
+
/**
|
|
784
|
+
* Build an Oracle analytic/window function expression, e.g.
|
|
785
|
+
* `ROW_NUMBER() OVER (PARTITION BY "dept" ORDER BY "salary" DESC)`.
|
|
786
|
+
*/
|
|
787
|
+
buildWindowFunction(options: OracleWindowFunctionOptions): string;
|
|
788
|
+
/**
|
|
789
|
+
* Build a `WITH ... AS (...)` common table expression clause and prepend it
|
|
790
|
+
* to a main query. A CTE is made recursive simply by supplying
|
|
791
|
+
* `unionQuery` (Oracle has no `RECURSIVE` keyword - the self-reference
|
|
792
|
+
* inside the UNION ALL member is what makes it recursive).
|
|
793
|
+
*/
|
|
794
|
+
buildCTE(ctes: OracleCTEOptions | OracleCTEOptions[], mainQuery: string): {
|
|
795
|
+
sql: string;
|
|
796
|
+
values: any[];
|
|
797
|
+
};
|
|
798
|
+
/**
|
|
799
|
+
* Build an Oracle hierarchical query using `START WITH ... CONNECT BY PRIOR`,
|
|
800
|
+
* the pre-recursive-CTE idiom Oracle has supported since 8i and still
|
|
801
|
+
* commonly used/expected in Oracle codebases.
|
|
802
|
+
*/
|
|
803
|
+
buildConnectByQuery(options: OracleConnectByOptions): {
|
|
804
|
+
sql: string;
|
|
805
|
+
values: any[];
|
|
806
|
+
};
|
|
807
|
+
/**
|
|
808
|
+
* Build LIMIT/OFFSET clause using ROWNUM
|
|
809
|
+
*/
|
|
810
|
+
buildLimitOffset(limit?: number | string, offset?: number | string): string;
|
|
811
|
+
/**
|
|
812
|
+
* Build INSERT query
|
|
813
|
+
*/
|
|
814
|
+
buildInsertQuery(tableName: string, values: Record<string, any>, options?: InsertOptions): {
|
|
815
|
+
sql: string;
|
|
816
|
+
values: any[];
|
|
817
|
+
};
|
|
818
|
+
/**
|
|
819
|
+
* Build UPDATE query
|
|
820
|
+
*/
|
|
821
|
+
buildUpdateQuery(tableName: string, values: Record<string, any>, where: WhereOptions, options?: UpdateOptions): {
|
|
822
|
+
sql: string;
|
|
823
|
+
values: any[];
|
|
824
|
+
};
|
|
825
|
+
/**
|
|
826
|
+
* Build DELETE query
|
|
827
|
+
*/
|
|
828
|
+
buildDeleteQuery(tableName: string, where: WhereOptions, options?: DeleteOptions): {
|
|
829
|
+
sql: string;
|
|
830
|
+
values: any[];
|
|
831
|
+
};
|
|
832
|
+
/**
|
|
833
|
+
* Build SELECT query
|
|
834
|
+
*/
|
|
835
|
+
buildSelectQuery(options: SelectOptions): {
|
|
836
|
+
sql: string;
|
|
837
|
+
values: any[];
|
|
838
|
+
};
|
|
839
|
+
/**
|
|
840
|
+
* Build a general-purpose Oracle `MERGE INTO ... USING ... ON (...)` statement.
|
|
841
|
+
* Supports composite (multi-column) match keys, conditional
|
|
842
|
+
* `WHEN [NOT] MATCHED` predicates, and `WHEN MATCHED ... THEN DELETE`.
|
|
843
|
+
*/
|
|
844
|
+
buildMergeQuery(options: OracleMergeOptions): {
|
|
845
|
+
sql: string;
|
|
846
|
+
values: any[];
|
|
847
|
+
};
|
|
848
|
+
/**
|
|
849
|
+
* Build UPSERT query (MERGE for Oracle)
|
|
850
|
+
*/
|
|
851
|
+
buildUpsertQuery(tableName: string, values: Record<string, any>, options?: UpsertQueryOptions): {
|
|
852
|
+
sql: string;
|
|
853
|
+
values: any[];
|
|
854
|
+
};
|
|
855
|
+
/**
|
|
856
|
+
* Build increment query
|
|
857
|
+
*/
|
|
858
|
+
buildIncrementQuery(tableName: string, fields: string | string[] | Record<string, number>, where: WhereOptions, options?: {
|
|
859
|
+
by?: number;
|
|
860
|
+
}): {
|
|
861
|
+
sql: string;
|
|
862
|
+
values: any[];
|
|
863
|
+
};
|
|
864
|
+
/**
|
|
865
|
+
* Replace placeholders in SQL
|
|
866
|
+
*/
|
|
867
|
+
replaceReplacements(sql: string, replacements?: Record<string, unknown> | unknown[]): string;
|
|
868
|
+
createExtension(_extensionName: string, _options?: any): Promise<void>;
|
|
869
|
+
dropExtension(_extensionName: string, _options?: any): Promise<void>;
|
|
870
|
+
getExtensions(): Promise<any[]>;
|
|
871
|
+
hasExtension(_extensionName: string): Promise<boolean>;
|
|
872
|
+
buildCreateServerQuery(_name: string, _opts: any): string;
|
|
873
|
+
buildAlterServerQuery(_name: string, _opts: any): string;
|
|
874
|
+
buildDropServerQuery(_name: string, _opts?: any): string;
|
|
875
|
+
buildCreateUserMappingQuery(_opts: any): string;
|
|
876
|
+
buildAlterUserMappingQuery(_opts: any): string;
|
|
877
|
+
buildDropUserMappingQuery(_serverName: string, _user: string, _opts?: any): string;
|
|
878
|
+
buildCreateForeignTableQuery(_tableName: string, _opts: any): string;
|
|
879
|
+
buildDropForeignTableQuery(_tableName: string, _opts?: any): string;
|
|
880
|
+
buildImportForeignSchemaQuery(_remoteSchema: string, _serverName: string, _opts?: any): string;
|
|
881
|
+
getServersQuery(): string;
|
|
882
|
+
/**
|
|
883
|
+
* Build a CREATE USER statement for Oracle.
|
|
884
|
+
*
|
|
885
|
+
* Oracle syntax: CREATE USER username IDENTIFIED BY password
|
|
886
|
+
*/
|
|
887
|
+
buildCreateUserQuery(username: string, options?: import('../../user-management').CreateUserOptions): string;
|
|
888
|
+
/**
|
|
889
|
+
* Build an ALTER USER statement for Oracle.
|
|
890
|
+
*
|
|
891
|
+
* Oracle syntax: ALTER USER username IDENTIFIED BY password
|
|
892
|
+
*/
|
|
893
|
+
buildAlterUserQuery(username: string, options: import('../../user-management').AlterUserOptions): string;
|
|
894
|
+
/**
|
|
895
|
+
* Build a DROP USER statement for Oracle.
|
|
896
|
+
*/
|
|
897
|
+
buildDropUserQuery(username: string, options?: {
|
|
898
|
+
ifExists?: boolean;
|
|
899
|
+
cascade?: boolean;
|
|
900
|
+
}): string;
|
|
901
|
+
/**
|
|
902
|
+
* Return a query that lists all Oracle users.
|
|
903
|
+
*/
|
|
904
|
+
getUsersQuery(): string;
|
|
905
|
+
/**
|
|
906
|
+
* Build a GRANT statement for Oracle.
|
|
907
|
+
*
|
|
908
|
+
* Oracle syntax: GRANT privilege ON object TO user
|
|
909
|
+
*/
|
|
910
|
+
buildGrantQuery(options: import('../../user-management').GrantOptions): string;
|
|
911
|
+
/**
|
|
912
|
+
* Build a REVOKE statement for Oracle.
|
|
913
|
+
*
|
|
914
|
+
* Oracle syntax: REVOKE privilege ON object FROM user
|
|
915
|
+
*/
|
|
916
|
+
buildRevokeQuery(options: import('../../user-management').RevokeOptions): string;
|
|
917
|
+
/**
|
|
918
|
+
* Build a SHOW GRANTS query for Oracle.
|
|
919
|
+
* Queries USER_TAB_PRIVS for object grants.
|
|
920
|
+
*/
|
|
921
|
+
buildShowGrantsQuery(username: string, _host?: string): string;
|
|
922
|
+
/**
|
|
923
|
+
* Oracle does not require FLUSH PRIVILEGES - return a no-op.
|
|
924
|
+
*/
|
|
925
|
+
buildFlushPrivilegesQuery(): string;
|
|
926
|
+
/**
|
|
927
|
+
* Build a CREATE ROLE statement for Oracle.
|
|
928
|
+
*/
|
|
929
|
+
buildCreateRoleQuery(roleName: string, options?: import('../../user-management').RoleOptions): string;
|
|
930
|
+
/**
|
|
931
|
+
* Build a DROP ROLE statement for Oracle.
|
|
932
|
+
*/
|
|
933
|
+
buildDropRoleQuery(roleName: string, options?: {
|
|
934
|
+
ifExists?: boolean;
|
|
935
|
+
}): string;
|
|
936
|
+
/**
|
|
937
|
+
* Build a GRANT ROLE statement for Oracle.
|
|
938
|
+
*/
|
|
939
|
+
buildGrantRoleQuery(role: string, to: string | string[], options?: {
|
|
940
|
+
withAdminOption?: boolean;
|
|
941
|
+
}): string;
|
|
942
|
+
/**
|
|
943
|
+
* Build a REVOKE ROLE statement for Oracle.
|
|
944
|
+
*/
|
|
945
|
+
buildRevokeRoleQuery(role: string, from: string | string[], _options?: {
|
|
946
|
+
cascade?: boolean;
|
|
947
|
+
}): string;
|
|
948
|
+
/**
|
|
949
|
+
* Return a query that lists all Oracle roles.
|
|
950
|
+
*/
|
|
951
|
+
getRolesQuery(): string;
|
|
952
|
+
/**
|
|
953
|
+
* Build Oracle privilege scope for GRANT/REVOKE.
|
|
954
|
+
*/
|
|
955
|
+
private buildPrivilegeScope;
|
|
956
|
+
/**
|
|
957
|
+
* Escape a string value for Oracle (quote with double quotes).
|
|
958
|
+
*/
|
|
959
|
+
private escapeStringValue;
|
|
960
|
+
createSequence(options: SequenceOptions): Promise<void>;
|
|
961
|
+
/**
|
|
962
|
+
* Drop a sequence.
|
|
963
|
+
*
|
|
964
|
+
* Like the other DDL paths in this dialect (tables, users, roles), Oracle's
|
|
965
|
+
* `DROP SEQUENCE ... IF EXISTS` syntax is 23c-only and raises ORA-00922
|
|
966
|
+
* against the 19c/21c versions this dialect targets. When `ifExists` is
|
|
967
|
+
* requested, wrap the plain DDL so that ORA-02289 ("sequence does not
|
|
968
|
+
* exist") is silently ignored instead (see {@link wrapIgnoringOraErrors}).
|
|
969
|
+
*/
|
|
970
|
+
dropSequence(sequenceName: string, options?: DropSequenceOptions): Promise<void>;
|
|
971
|
+
nextSequenceValue(sequenceName: string): Promise<number>;
|
|
972
|
+
hasSequence(sequenceName: string, schema?: string): Promise<boolean>;
|
|
973
|
+
/**
|
|
974
|
+
* List all sequences in the database (Oracle)
|
|
975
|
+
* @returns Array of sequence names
|
|
976
|
+
*/
|
|
977
|
+
listSequences(): Promise<string[]>;
|
|
978
|
+
createStoredProcedure(options: StoredProcedureOptions): Promise<void>;
|
|
979
|
+
dropStoredProcedure(procedureName: string, options?: DropStoredProcedureOptions): Promise<void>;
|
|
980
|
+
/**
|
|
981
|
+
* Drop a stored procedure (alias for dropStoredProcedure)
|
|
982
|
+
*/
|
|
983
|
+
dropProcedure(procedureName: string, options?: DropStoredProcedureOptions): Promise<void>;
|
|
984
|
+
/**
|
|
985
|
+
* Create a stored procedure (alias for createStoredProcedure)
|
|
986
|
+
*/
|
|
987
|
+
createProcedure(options: StoredProcedureOptions): Promise<void>;
|
|
988
|
+
executeStoredProcedure(options: ExecuteStoredProcedureOptions): Promise<QueryResult>;
|
|
989
|
+
hasStoredProcedure(procedureName: string, schema?: string): Promise<boolean>;
|
|
990
|
+
private commentProcedure;
|
|
991
|
+
createTrigger(options: TriggerOptions): Promise<void>;
|
|
992
|
+
dropTrigger(triggerName: string, tableName: string, options?: DropTriggerOptions): Promise<void>;
|
|
993
|
+
hasTrigger(triggerName: string, tableName: string, schema?: string): Promise<boolean>;
|
|
994
|
+
/**
|
|
995
|
+
* Create a security policy (RLS)
|
|
996
|
+
*/
|
|
997
|
+
createPolicy(options: PolicyOptions): Promise<void>;
|
|
998
|
+
/**
|
|
999
|
+
* Drop a security policy
|
|
1000
|
+
*/
|
|
1001
|
+
dropPolicy(policyName: string, tableName: string, options?: DropPolicyOptions): Promise<void>;
|
|
1002
|
+
/**
|
|
1003
|
+
* Enable Row-Level Security on a table
|
|
1004
|
+
*/
|
|
1005
|
+
enableRLS(tableName: string, schema?: string): Promise<void>;
|
|
1006
|
+
/**
|
|
1007
|
+
* Disable Row-Level Security on a table
|
|
1008
|
+
*/
|
|
1009
|
+
disableRLS(tableName: string, schema?: string): Promise<void>;
|
|
1010
|
+
/**
|
|
1011
|
+
* Check if a policy exists
|
|
1012
|
+
*/
|
|
1013
|
+
hasPolicy(policyName: string, tableName: string): Promise<boolean>;
|
|
1014
|
+
/**
|
|
1015
|
+
* Add comment to a table
|
|
1016
|
+
*/
|
|
1017
|
+
commentTable(tableName: string, comment: string): Promise<void>;
|
|
1018
|
+
/**
|
|
1019
|
+
* Add comment to a column
|
|
1020
|
+
*/
|
|
1021
|
+
commentColumn(tableName: string, columnName: string, comment: string): Promise<void>;
|
|
1022
|
+
/**
|
|
1023
|
+
* Create a partial index (index with WHERE clause)
|
|
1024
|
+
*/
|
|
1025
|
+
createPartialIndex(tableName: string, indexName: string, fields: string[], where: string, options?: IndexOptions): Promise<void>;
|
|
1026
|
+
/**
|
|
1027
|
+
* Create an expression index (functional index)
|
|
1028
|
+
*/
|
|
1029
|
+
createExpressionIndex(tableName: string, indexName: string, expression: string, options?: IndexOptions): Promise<void>;
|
|
1030
|
+
/**
|
|
1031
|
+
* Create an identity column (auto-increment)
|
|
1032
|
+
*/
|
|
1033
|
+
createIdentityColumn(tableName: string, columnName: string, options?: {
|
|
1034
|
+
startWith?: number;
|
|
1035
|
+
incrementBy?: number;
|
|
1036
|
+
minvalue?: number;
|
|
1037
|
+
maxvalue?: number;
|
|
1038
|
+
cycle?: boolean;
|
|
1039
|
+
}): Promise<void>;
|
|
1040
|
+
/**
|
|
1041
|
+
* Create a computed (virtual) column
|
|
1042
|
+
*/
|
|
1043
|
+
createComputedColumn(tableName: string, columnName: string, expression: string, options?: {
|
|
1044
|
+
persisted?: boolean;
|
|
1045
|
+
type?: string;
|
|
1046
|
+
}): Promise<void>;
|
|
1047
|
+
/**
|
|
1048
|
+
* Bulk insert records into a table
|
|
1049
|
+
*/
|
|
1050
|
+
bulkInsert(tableName: string, records: Record<string, any>[], _options?: any): Promise<QueryResult>;
|
|
1051
|
+
/**
|
|
1052
|
+
* Add a foreign key to a table
|
|
1053
|
+
*/
|
|
1054
|
+
addForeignKey(tableName: string, columnName: string, referencedTableName: string, referencedColumnName: string, options?: {
|
|
1055
|
+
name?: string;
|
|
1056
|
+
onDelete?: 'CASCADE' | 'RESTRICT' | 'SET NULL' | 'NO ACTION';
|
|
1057
|
+
onUpdate?: 'CASCADE' | 'RESTRICT' | 'SET NULL' | 'NO ACTION';
|
|
1058
|
+
}): Promise<void>;
|
|
1059
|
+
/**
|
|
1060
|
+
* Rename a column
|
|
1061
|
+
*/
|
|
1062
|
+
renameColumn(tableName: string, oldColumnName: string, newColumnName: string): Promise<void>;
|
|
1063
|
+
/**
|
|
1064
|
+
* Create a fulltext index (Oracle uses Oracle Text)
|
|
1065
|
+
*/
|
|
1066
|
+
createFulltextIndex(tableName: string, indexName: string, fields: string[], options?: {
|
|
1067
|
+
parser?: string;
|
|
1068
|
+
comment?: string;
|
|
1069
|
+
}): Promise<void>;
|
|
1070
|
+
/**
|
|
1071
|
+
* Create a spatial index (Oracle uses Spatial indexing)
|
|
1072
|
+
*/
|
|
1073
|
+
createSpatialIndex(tableName: string, indexName: string, fields: string[], _options?: {
|
|
1074
|
+
srid?: number;
|
|
1075
|
+
}): Promise<void>;
|
|
1076
|
+
/**
|
|
1077
|
+
* ST_Distance - calculate distance between two geometries (Oracle)
|
|
1078
|
+
*/
|
|
1079
|
+
stDistance(geom1: string, geom2: string, srid?: number): string;
|
|
1080
|
+
/**
|
|
1081
|
+
* ST_Within - check if geometry A is within geometry B (Oracle)
|
|
1082
|
+
*/
|
|
1083
|
+
stWithin(geom1: string, geom2: string, srid?: number): string;
|
|
1084
|
+
/**
|
|
1085
|
+
* ST_Contains - check if geometry A contains geometry B (Oracle)
|
|
1086
|
+
*/
|
|
1087
|
+
stContains(geom1: string, geom2: string, srid?: number): string;
|
|
1088
|
+
/**
|
|
1089
|
+
* ST_Intersects - check if geometries intersect (Oracle)
|
|
1090
|
+
*/
|
|
1091
|
+
stIntersects(geom1: string, geom2: string, srid?: number): string;
|
|
1092
|
+
/**
|
|
1093
|
+
* ST_DWithin - check if geometries are within a given distance (Oracle)
|
|
1094
|
+
*/
|
|
1095
|
+
stDWithin(geom1: string, geom2: string, distance: number, srid?: number): string;
|
|
1096
|
+
/**
|
|
1097
|
+
* ST_AsText - convert geometry to text representation (Oracle)
|
|
1098
|
+
*/
|
|
1099
|
+
stAsText(geom: string): string;
|
|
1100
|
+
/**
|
|
1101
|
+
* ST_GeomFromText - create geometry from text (Oracle)
|
|
1102
|
+
*/
|
|
1103
|
+
stGeomFromText(wkt: string, srid?: number): string;
|
|
1104
|
+
/**
|
|
1105
|
+
* Build a JSON_TABLE expression to shred a JSON document/array into relational rows
|
|
1106
|
+
* (Oracle 12c+). Useful to project a JSON array column into rows instead of a
|
|
1107
|
+
* correlated subquery.
|
|
1108
|
+
* Oracle: JSON_TABLE(expr, '$[*]' COLUMNS(name type PATH '$.path', ...)) alias
|
|
1109
|
+
*/
|
|
1110
|
+
buildJsonTable(jsonExpression: string, rowPath: string, columns: Array<{
|
|
1111
|
+
name: string;
|
|
1112
|
+
type?: string;
|
|
1113
|
+
path?: string;
|
|
1114
|
+
forOrdinality?: boolean;
|
|
1115
|
+
}>, alias: string): string;
|
|
1116
|
+
/**
|
|
1117
|
+
* Build a `LISTAGG(expr, delimiter) WITHIN GROUP (ORDER BY ...)` expression
|
|
1118
|
+
* (Oracle 11gR2+), the standard idiom for collapsing grouped rows into a
|
|
1119
|
+
* single delimited string.
|
|
1120
|
+
*/
|
|
1121
|
+
listAgg(expr: string, delimiter?: string, orderBy?: Order, overflow?: string): string;
|
|
1122
|
+
/**
|
|
1123
|
+
* Build an Oracle `PIVOT` query, rotating rows into columns (11g+).
|
|
1124
|
+
*/
|
|
1125
|
+
buildPivotQuery(options: OraclePivotOptions): string;
|
|
1126
|
+
/**
|
|
1127
|
+
* Build an Oracle `UNPIVOT` query, rotating columns into rows (11g+).
|
|
1128
|
+
*/
|
|
1129
|
+
buildUnpivotQuery(options: OracleUnpivotOptions): string;
|
|
1130
|
+
/**
|
|
1131
|
+
* Convert a dot/bracket JSON path (e.g. `address.city` or `items[0].sku`) into
|
|
1132
|
+
* an Oracle JSON path expression rooted at `$` (`$.address.city`,
|
|
1133
|
+
* `$.items[0].sku`). A path already starting with `$` is passed through.
|
|
1134
|
+
*/
|
|
1135
|
+
private toOracleJsonPath;
|
|
1136
|
+
/**
|
|
1137
|
+
* Build a scalar `JSON_VALUE(column, '$.path' RETURNING type)` accessor
|
|
1138
|
+
* (Oracle 12c+), the standard way to extract a scalar out of a JSON column.
|
|
1139
|
+
*/
|
|
1140
|
+
buildJsonValue(column: string, path: string, options?: {
|
|
1141
|
+
returning?: string;
|
|
1142
|
+
onError?: string;
|
|
1143
|
+
}): string;
|
|
1144
|
+
/**
|
|
1145
|
+
* Build a `JSON_QUERY(column, '$.path')` accessor (Oracle 12c+) for extracting
|
|
1146
|
+
* a JSON object/array fragment (rather than a scalar) out of a JSON column.
|
|
1147
|
+
*/
|
|
1148
|
+
buildJsonQuery(column: string, path: string, options?: {
|
|
1149
|
+
wrapper?: 'WITH WRAPPER' | 'WITHOUT WRAPPER' | 'WITH CONDITIONAL WRAPPER';
|
|
1150
|
+
}): string;
|
|
1151
|
+
/**
|
|
1152
|
+
* Build a `JSON_EXISTS(column, '$.path')` predicate (Oracle 12c+) for use in a
|
|
1153
|
+
* WHERE clause to test for the presence of a JSON path.
|
|
1154
|
+
*/
|
|
1155
|
+
buildJsonExists(column: string, path: string): string;
|
|
1156
|
+
/**
|
|
1157
|
+
* Create an Oracle PL/SQL package specification and/or body. Emits
|
|
1158
|
+
* `CREATE [OR REPLACE] PACKAGE name AS <spec> END;` and, when `body` is given,
|
|
1159
|
+
* a following `CREATE [OR REPLACE] PACKAGE BODY name AS <body> END;`.
|
|
1160
|
+
* At least one of `spec`/`body` must be provided.
|
|
1161
|
+
*/
|
|
1162
|
+
createPackage(options: OraclePackageOptions): Promise<void>;
|
|
1163
|
+
/**
|
|
1164
|
+
* Drop an Oracle PL/SQL package. Pass `bodyOnly` to drop just the body and
|
|
1165
|
+
* keep the specification.
|
|
1166
|
+
*/
|
|
1167
|
+
dropPackage(packageName: string, options?: {
|
|
1168
|
+
schema?: string;
|
|
1169
|
+
bodyOnly?: boolean;
|
|
1170
|
+
}): Promise<void>;
|
|
1171
|
+
/**
|
|
1172
|
+
* Build an Oracle flashback `AS OF` clause (`AS OF TIMESTAMP ...` or
|
|
1173
|
+
* `AS OF SCN ...`) to append to a table reference for a point-in-time read.
|
|
1174
|
+
* Returns an empty string when neither timestamp nor SCN is given.
|
|
1175
|
+
*/
|
|
1176
|
+
buildFlashbackClause(options: OracleFlashbackOptions): string;
|
|
1177
|
+
/**
|
|
1178
|
+
* Build a flashback SELECT: `SELECT ... FROM table AS OF ... [WHERE ...]`,
|
|
1179
|
+
* reading the table's rows as they existed at a past timestamp or SCN.
|
|
1180
|
+
*/
|
|
1181
|
+
buildFlashbackQuery(tableName: string, flashback: OracleFlashbackOptions, options?: {
|
|
1182
|
+
schema?: string;
|
|
1183
|
+
attributes?: string[];
|
|
1184
|
+
where?: WhereOptions;
|
|
1185
|
+
}): {
|
|
1186
|
+
sql: string;
|
|
1187
|
+
values: any[];
|
|
1188
|
+
};
|
|
1189
|
+
/**
|
|
1190
|
+
* Flashback a table to a past point in time (`FLASHBACK TABLE t TO TIMESTAMP/SCN ...`).
|
|
1191
|
+
* Requires row movement enabled on the table.
|
|
1192
|
+
*/
|
|
1193
|
+
flashbackTable(tableName: string, flashback: OracleFlashbackOptions): Promise<void>;
|
|
1194
|
+
/**
|
|
1195
|
+
* Restore a dropped table from the recycle bin
|
|
1196
|
+
* (`FLASHBACK TABLE t TO BEFORE DROP [RENAME TO newName]`).
|
|
1197
|
+
*/
|
|
1198
|
+
flashbackTableBeforeDrop(tableName: string, renameTo?: string): Promise<void>;
|
|
1199
|
+
/**
|
|
1200
|
+
* Create an Oracle external table (`ORGANIZATION EXTERNAL`) — the native
|
|
1201
|
+
* Oracle mechanism for reading flat files / Data Pump dumps as a table, and
|
|
1202
|
+
* the recommended replacement for the PostgreSQL-only foreign-table API that
|
|
1203
|
+
* this dialect rejects.
|
|
1204
|
+
*/
|
|
1205
|
+
createExternalTable(tableName: string, options: OracleExternalTableOptions): Promise<void>;
|
|
1206
|
+
/**
|
|
1207
|
+
* Build an Oracle Text `CONTAINS(column, 'query') > 0` predicate for use in a
|
|
1208
|
+
* WHERE clause against a `CTXSYS.CONTEXT` index (see `createFulltextIndex`).
|
|
1209
|
+
* `label` ties the predicate to a `SCORE(label)` projection.
|
|
1210
|
+
*/
|
|
1211
|
+
buildContains(column: string, query: string, label?: number): string;
|
|
1212
|
+
/**
|
|
1213
|
+
* Build an Oracle Text `SCORE(label)` projection expression that reports the
|
|
1214
|
+
* relevance score computed by a matching `CONTAINS(..., label)` predicate.
|
|
1215
|
+
*/
|
|
1216
|
+
buildScore(label?: number): string;
|
|
1217
|
+
}
|
|
1218
|
+
/**
|
|
1219
|
+
* Create Oracle dialect instance
|
|
1220
|
+
*/
|
|
1221
|
+
export declare function createOracleDialect(options?: OracleDialectOptions): OracleDialect;
|
|
1222
|
+
export default OracleDialect;
|