@ductape/sdk 0.0.4-v5 → 0.0.4-v51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/api/services/appApi.service.d.ts +48 -2
- package/dist/api/services/appApi.service.js +101 -2
- package/dist/api/services/appApi.service.js.map +1 -1
- package/dist/api/services/pricingApi.service.d.ts +10 -0
- package/dist/api/services/pricingApi.service.js +34 -0
- package/dist/api/services/pricingApi.service.js.map +1 -0
- package/dist/api/services/processorApi.service.d.ts +12 -2
- package/dist/api/services/processorApi.service.js +12 -2
- package/dist/api/services/processorApi.service.js.map +1 -1
- package/dist/api/services/productsApi.service.d.ts +40 -1
- package/dist/api/services/productsApi.service.js +105 -1
- package/dist/api/services/productsApi.service.js.map +1 -1
- package/dist/api/services/userApi.service.js +1 -0
- package/dist/api/services/userApi.service.js.map +1 -1
- package/dist/api/services/workspaceApi.service.js +1 -0
- package/dist/api/services/workspaceApi.service.js.map +1 -1
- package/dist/api/services/workspaceSecretsApi.service.d.ts +75 -0
- package/dist/api/services/workspaceSecretsApi.service.js +62 -0
- package/dist/api/services/workspaceSecretsApi.service.js.map +1 -0
- package/dist/api/urls.d.ts +6 -1
- package/dist/api/urls.js +12 -2
- package/dist/api/urls.js.map +1 -1
- package/dist/api/utils/cache.utils.d.ts +1 -1
- package/dist/api/utils/cache.utils.js +10 -4
- package/dist/api/utils/cache.utils.js.map +1 -1
- package/dist/api/utils/strings.utils.d.ts +2 -0
- package/dist/api/utils/strings.utils.js +14 -0
- package/dist/api/utils/strings.utils.js.map +1 -1
- package/dist/apps/services/app.service.d.ts +51 -33
- package/dist/apps/services/app.service.js +488 -244
- package/dist/apps/services/app.service.js.map +1 -1
- package/dist/apps/validators/joi-validators/create.appAction.validator.d.ts +1 -2
- package/dist/apps/validators/joi-validators/create.appAction.validator.js +21 -2
- package/dist/apps/validators/joi-validators/create.appAction.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.d.ts +1 -2
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js +2 -15
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/update.appAction.validator.js +11 -1
- package/dist/apps/validators/joi-validators/update.appAction.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.d.ts +1 -1
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js +34 -1
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js.map +1 -1
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.d.ts +1 -2
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js +2 -14
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js.map +1 -1
- package/dist/clients/pricing.client.d.ts +3 -0
- package/dist/clients/pricing.client.js +33 -0
- package/dist/clients/pricing.client.js.map +1 -0
- package/dist/database/adapters/base.adapter.d.ts +176 -0
- package/dist/database/adapters/base.adapter.js +31 -0
- package/dist/database/adapters/base.adapter.js.map +1 -0
- package/dist/database/adapters/dynamodb.adapter.d.ts +91 -0
- package/dist/database/adapters/dynamodb.adapter.js +1608 -0
- package/dist/database/adapters/dynamodb.adapter.js.map +1 -0
- package/dist/database/adapters/mongodb.adapter.d.ts +71 -0
- package/dist/database/adapters/mongodb.adapter.js +1072 -0
- package/dist/database/adapters/mongodb.adapter.js.map +1 -0
- package/dist/database/adapters/mysql.adapter.d.ts +146 -0
- package/dist/database/adapters/mysql.adapter.js +1492 -0
- package/dist/database/adapters/mysql.adapter.js.map +1 -0
- package/dist/database/adapters/postgresql.adapter.d.ts +147 -0
- package/dist/database/adapters/postgresql.adapter.js +1603 -0
- package/dist/database/adapters/postgresql.adapter.js.map +1 -0
- package/dist/database/database.service.d.ts +232 -0
- package/dist/database/database.service.js +802 -0
- package/dist/database/database.service.js.map +1 -0
- package/dist/database/index.d.ts +18 -0
- package/dist/database/index.js +98 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/types/aggregation.types.d.ts +261 -0
- package/dist/database/types/aggregation.types.js +21 -0
- package/dist/database/types/aggregation.types.js.map +1 -0
- package/dist/database/types/connection.types.d.ts +132 -0
- package/dist/database/types/connection.types.js +6 -0
- package/dist/database/types/connection.types.js.map +1 -0
- package/dist/database/types/database.types.d.ts +175 -0
- package/dist/database/types/database.types.js +75 -0
- package/dist/database/types/database.types.js.map +1 -0
- package/dist/database/types/index.d.ts +12 -0
- package/dist/database/types/index.js +37 -0
- package/dist/database/types/index.js.map +1 -0
- package/dist/database/types/index.types.d.ts +220 -0
- package/dist/database/types/index.types.js +27 -0
- package/dist/database/types/index.types.js.map +1 -0
- package/dist/database/types/migration.types.d.ts +205 -0
- package/dist/database/types/migration.types.js +44 -0
- package/dist/database/types/migration.types.js.map +1 -0
- package/dist/database/types/query.types.d.ts +305 -0
- package/dist/database/types/query.types.js +57 -0
- package/dist/database/types/query.types.js.map +1 -0
- package/dist/database/types/result.types.d.ts +220 -0
- package/dist/database/types/result.types.js +6 -0
- package/dist/database/types/result.types.js.map +1 -0
- package/dist/database/types/schema.types.d.ts +190 -0
- package/dist/database/types/schema.types.js +69 -0
- package/dist/database/types/schema.types.js.map +1 -0
- package/dist/database/utils/helpers.d.ts +66 -0
- package/dist/database/utils/helpers.js +501 -0
- package/dist/database/utils/helpers.js.map +1 -0
- package/dist/database/utils/migration.utils.d.ts +151 -0
- package/dist/database/utils/migration.utils.js +476 -0
- package/dist/database/utils/migration.utils.js.map +1 -0
- package/dist/database/utils/transaction.d.ts +64 -0
- package/dist/database/utils/transaction.js +130 -0
- package/dist/database/utils/transaction.js.map +1 -0
- package/dist/database/validators/connection.validator.d.ts +20 -0
- package/dist/database/validators/connection.validator.js +267 -0
- package/dist/database/validators/connection.validator.js.map +1 -0
- package/dist/database/validators/query.validator.d.ts +31 -0
- package/dist/database/validators/query.validator.js +305 -0
- package/dist/database/validators/query.validator.js.map +1 -0
- package/dist/database/validators/schema.validator.d.ts +31 -0
- package/dist/database/validators/schema.validator.js +334 -0
- package/dist/database/validators/schema.validator.js.map +1 -0
- package/dist/graph/adapters/arangodb.adapter.d.ts +80 -0
- package/dist/graph/adapters/arangodb.adapter.js +1393 -0
- package/dist/graph/adapters/arangodb.adapter.js.map +1 -0
- package/dist/graph/adapters/base.adapter.d.ts +228 -0
- package/dist/graph/adapters/base.adapter.js +38 -0
- package/dist/graph/adapters/base.adapter.js.map +1 -0
- package/dist/graph/adapters/index.d.ts +10 -0
- package/dist/graph/adapters/index.js +23 -0
- package/dist/graph/adapters/index.js.map +1 -0
- package/dist/graph/adapters/memgraph.adapter.d.ts +85 -0
- package/dist/graph/adapters/memgraph.adapter.js +1491 -0
- package/dist/graph/adapters/memgraph.adapter.js.map +1 -0
- package/dist/graph/adapters/neo4j.adapter.d.ts +88 -0
- package/dist/graph/adapters/neo4j.adapter.js +1861 -0
- package/dist/graph/adapters/neo4j.adapter.js.map +1 -0
- package/dist/graph/adapters/neptune.adapter.d.ts +87 -0
- package/dist/graph/adapters/neptune.adapter.js +1430 -0
- package/dist/graph/adapters/neptune.adapter.js.map +1 -0
- package/dist/graph/graph.service.d.ts +278 -0
- package/dist/graph/graph.service.js +687 -0
- package/dist/graph/graph.service.js.map +1 -0
- package/dist/graph/index.d.ts +11 -0
- package/dist/graph/index.js +42 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/types/connection.types.d.ts +158 -0
- package/dist/graph/types/connection.types.js +43 -0
- package/dist/graph/types/connection.types.js.map +1 -0
- package/dist/graph/types/graph.types.d.ts +144 -0
- package/dist/graph/types/graph.types.js +84 -0
- package/dist/graph/types/graph.types.js.map +1 -0
- package/dist/graph/types/index.d.ts +11 -0
- package/dist/graph/types/index.js +35 -0
- package/dist/graph/types/index.js.map +1 -0
- package/dist/graph/types/node.types.d.ts +193 -0
- package/dist/graph/types/node.types.js +49 -0
- package/dist/graph/types/node.types.js.map +1 -0
- package/dist/graph/types/path.types.d.ts +224 -0
- package/dist/graph/types/path.types.js +38 -0
- package/dist/graph/types/path.types.js.map +1 -0
- package/dist/graph/types/query.types.d.ts +247 -0
- package/dist/graph/types/query.types.js +23 -0
- package/dist/graph/types/query.types.js.map +1 -0
- package/dist/graph/types/relationship.types.d.ts +224 -0
- package/dist/graph/types/relationship.types.js +35 -0
- package/dist/graph/types/relationship.types.js.map +1 -0
- package/dist/graph/types/result.types.d.ts +237 -0
- package/dist/graph/types/result.types.js +7 -0
- package/dist/graph/types/result.types.js.map +1 -0
- package/dist/graph/validators/index.d.ts +81 -0
- package/dist/graph/validators/index.js +243 -0
- package/dist/graph/validators/index.js.map +1 -0
- package/dist/imports/imports.service.d.ts +3 -3
- package/dist/imports/imports.service.js +7 -7
- package/dist/imports/imports.service.js.map +1 -1
- package/dist/imports/imports.types.d.ts +8 -0
- package/dist/imports/repos/postmanV21.repo.d.ts +1 -1
- package/dist/imports/repos/postmanV21.repo.js +29 -2
- package/dist/imports/repos/postmanV21.repo.js.map +1 -1
- package/dist/index.d.ts +1244 -150
- package/dist/index.js +1309 -209
- package/dist/index.js.map +1 -1
- package/dist/inputs/inputs.service.js +2 -2
- package/dist/inputs/inputs.service.js.map +1 -1
- package/dist/inputs/utils/inputs.utils.create.js +1 -1
- package/dist/inputs/utils/inputs.utils.create.js.map +1 -1
- package/dist/logs/logs.types.d.ts +5 -0
- package/dist/logs/logs.types.js +1 -0
- package/dist/logs/logs.types.js.map +1 -1
- package/dist/parsers/index.d.ts +3 -0
- package/dist/parsers/index.js +27 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/parsers/pipelines/postman.pipelines.d.ts +15 -0
- package/dist/parsers/pipelines/postman.pipelines.js +103 -0
- package/dist/parsers/pipelines/postman.pipelines.js.map +1 -0
- package/dist/parsers/types/postman.types.d.ts +200 -0
- package/dist/parsers/types/postman.types.js +3 -0
- package/dist/parsers/types/postman.types.js.map +1 -0
- package/dist/parsers/utils/postman.utils.d.ts +12 -0
- package/dist/parsers/utils/postman.utils.js +116 -0
- package/dist/parsers/utils/postman.utils.js.map +1 -0
- package/dist/parsers/validators/postman-auth.validators.d.ts +10 -0
- package/dist/parsers/validators/postman-auth.validators.js +127 -0
- package/dist/parsers/validators/postman-auth.validators.js.map +1 -0
- package/dist/parsers/validators/postman-request.validators.d.ts +13 -0
- package/dist/parsers/validators/postman-request.validators.js +139 -0
- package/dist/parsers/validators/postman-request.validators.js.map +1 -0
- package/dist/parsers/validators/postman-response.validators.d.ts +13 -0
- package/dist/parsers/validators/postman-response.validators.js +150 -0
- package/dist/parsers/validators/postman-response.validators.js.map +1 -0
- package/dist/parsers/validators/postman-variable.validators.d.ts +14 -0
- package/dist/parsers/validators/postman-variable.validators.js +163 -0
- package/dist/parsers/validators/postman-variable.validators.js.map +1 -0
- package/dist/pricing/pricing.repo.d.ts +0 -0
- package/dist/pricing/pricing.repo.js +1 -0
- package/dist/pricing/pricing.repo.js.map +1 -0
- package/dist/pricing/pricing.service.d.ts +24 -0
- package/dist/pricing/pricing.service.js +51 -0
- package/dist/pricing/pricing.service.js.map +1 -0
- package/dist/pricing/pricing.types.d.ts +76 -0
- package/dist/pricing/pricing.types.js +21 -0
- package/dist/pricing/pricing.types.js.map +1 -0
- package/dist/pricing/utils/string.utils.d.ts +1 -0
- package/dist/pricing/utils/string.utils.js +9 -0
- package/dist/pricing/utils/string.utils.js.map +1 -0
- package/dist/processor/repos/sms.repo.d.ts +4 -4
- package/dist/processor/repos/sms.repo.js +23 -10
- package/dist/processor/repos/sms.repo.js.map +1 -1
- package/dist/processor/services/messagebrokers/kafka.service.js +0 -2
- package/dist/processor/services/messagebrokers/kafka.service.js.map +1 -1
- package/dist/processor/services/messagebrokers/rabbitmq.service.d.ts +9 -1
- package/dist/processor/services/messagebrokers/rabbitmq.service.js +40 -11
- package/dist/processor/services/messagebrokers/rabbitmq.service.js.map +1 -1
- package/dist/processor/services/processor.service.d.ts +38 -10
- package/dist/processor/services/processor.service.js +533 -248
- package/dist/processor/services/processor.service.js.map +1 -1
- package/dist/processor/services/request.service.d.ts +36 -0
- package/dist/processor/services/request.service.js +304 -0
- package/dist/processor/services/request.service.js.map +1 -0
- package/dist/processor/types/request.types.d.ts +14 -0
- package/dist/processor/types/request.types.js +3 -0
- package/dist/processor/types/request.types.js.map +1 -0
- package/dist/processor/utils/processor.utils.d.ts +3 -0
- package/dist/processor/utils/processor.utils.js +84 -22
- package/dist/processor/utils/processor.utils.js.map +1 -1
- package/dist/processor/utils/request.utils.d.ts +20 -0
- package/dist/processor/utils/request.utils.js +113 -0
- package/dist/processor/utils/request.utils.js.map +1 -0
- package/dist/products/services/products.service.d.ts +114 -77
- package/dist/products/services/products.service.js +805 -362
- package/dist/products/services/products.service.js.map +1 -1
- package/dist/products/services/utils/crypt.utils.d.ts +1 -0
- package/dist/products/services/utils/crypt.utils.js +17 -0
- package/dist/products/services/utils/crypt.utils.js.map +1 -0
- package/dist/products/services/utils/functions.utils.d.ts +13 -0
- package/dist/products/services/utils/functions.utils.js +289 -0
- package/dist/products/services/utils/functions.utils.js.map +1 -0
- package/dist/products/services/utils/objects.utils.d.ts +13 -0
- package/dist/products/services/utils/objects.utils.js +89 -0
- package/dist/products/services/utils/objects.utils.js.map +1 -0
- package/dist/products/services/utils/string.utils.d.ts +12 -0
- package/dist/products/services/utils/string.utils.js +168 -0
- package/dist/products/services/utils/string.utils.js.map +1 -0
- package/dist/products/utils/string.utils.d.ts +1 -1
- package/dist/products/utils/string.utils.js +14 -2
- package/dist/products/utils/string.utils.js.map +1 -1
- package/dist/products/validators/index.d.ts +4 -1
- package/dist/products/validators/index.js +7 -1
- package/dist/products/validators/index.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.d.ts +15 -4
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js +501 -109
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productEnv.validator.js +1 -0
- package/dist/products/validators/joi-validators/create.productEnv.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productGraph.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productGraph.validator.js +82 -0
- package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productGraphAction.validator.d.ts +14 -0
- package/dist/products/validators/joi-validators/create.productGraphAction.validator.js +696 -0
- package/dist/products/validators/joi-validators/create.productGraphAction.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.d.ts +4 -0
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js +58 -0
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js +1 -0
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +9 -4
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productNotification.validator.js +5 -2
- package/dist/products/validators/joi-validators/create.productNotification.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.userAuth.validator.js +1 -0
- package/dist/products/validators/joi-validators/create.userAuth.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.dataValue.validator.js +1 -0
- package/dist/products/validators/joi-validators/update.dataValue.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.d.ts +6 -0
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js +28 -26
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productEnv.validator.js +3 -0
- package/dist/products/validators/joi-validators/update.productEnv.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productGraph.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productGraph.validator.js +87 -0
- package/dist/products/validators/joi-validators/update.productGraph.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productGraphAction.validator.d.ts +7 -0
- package/dist/products/validators/joi-validators/update.productGraphAction.validator.js +72 -0
- package/dist/products/validators/joi-validators/update.productGraphAction.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js +1 -0
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.userAuth.validator.js +1 -0
- package/dist/products/validators/joi-validators/update.userAuth.validator.js.map +1 -1
- package/dist/test/test.health.d.ts +1 -0
- package/dist/test/test.health.js +49 -0
- package/dist/test/test.health.js.map +1 -0
- package/dist/test/test.import.js +51 -4
- package/dist/test/test.import.js.map +1 -1
- package/dist/test/test.imports.js +22 -7
- package/dist/test/test.imports.js.map +1 -1
- package/dist/test/test.notifiers.d.ts +1 -0
- package/dist/test/test.notifiers.js +85 -0
- package/dist/test/test.notifiers.js.map +1 -0
- package/dist/test/test.processor.js +30 -115
- package/dist/test/test.processor.js.map +1 -1
- package/dist/test/test.products.d.ts +1 -0
- package/dist/test/test.products.js +49 -0
- package/dist/test/test.products.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/appBuilder.types.d.ts +5 -12
- package/dist/types/enums.d.ts +4 -1
- package/dist/types/enums.js +3 -0
- package/dist/types/enums.js.map +1 -1
- package/dist/types/index.types.d.ts +4 -0
- package/dist/types/pricing.types.d.ts +4 -0
- package/dist/types/pricing.types.js +3 -0
- package/dist/types/pricing.types.js.map +1 -0
- package/dist/types/processor.types.d.ts +67 -11
- package/dist/types/processor.types.js.map +1 -1
- package/dist/types/productsBuilder.types.d.ts +132 -14
- package/dist/types/productsBuilder.types.js +69 -4
- package/dist/types/productsBuilder.types.js.map +1 -1
- package/dist/types/request-tracker.interface.d.ts +0 -0
- package/dist/types/request-tracker.interface.js +1 -0
- package/dist/types/request-tracker.interface.js.map +1 -0
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +5 -0
- package/dist/utils/constants.js.map +1 -0
- package/package.json +17 -3
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result type definitions for database operations
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Query result
|
|
6
|
+
*/
|
|
7
|
+
export interface IQueryResult<T = any> {
|
|
8
|
+
/** Result rows/documents */
|
|
9
|
+
data: T[];
|
|
10
|
+
/** Total count (if available) */
|
|
11
|
+
count?: number;
|
|
12
|
+
/** Execution time in milliseconds */
|
|
13
|
+
executionTime?: number;
|
|
14
|
+
/** Database type that executed the query */
|
|
15
|
+
databaseType?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Insert result
|
|
19
|
+
*/
|
|
20
|
+
export interface IInsertResult<T = any> {
|
|
21
|
+
/** Number of rows inserted */
|
|
22
|
+
insertedCount: number;
|
|
23
|
+
/** Inserted row IDs */
|
|
24
|
+
insertedIds?: (string | number)[];
|
|
25
|
+
/** Inserted rows (if returning option was used) */
|
|
26
|
+
data?: T[];
|
|
27
|
+
/** Execution time in milliseconds */
|
|
28
|
+
executionTime?: number;
|
|
29
|
+
/** Success flag */
|
|
30
|
+
success: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Update result
|
|
34
|
+
*/
|
|
35
|
+
export interface IUpdateResult<T = any> {
|
|
36
|
+
/** Number of rows updated */
|
|
37
|
+
updatedCount: number;
|
|
38
|
+
/** Number of rows matched by the where clause */
|
|
39
|
+
matchedCount?: number;
|
|
40
|
+
/** Updated rows (if returning option was used) */
|
|
41
|
+
data?: T[];
|
|
42
|
+
/** Execution time in milliseconds */
|
|
43
|
+
executionTime?: number;
|
|
44
|
+
/** Success flag */
|
|
45
|
+
success: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Delete result
|
|
49
|
+
*/
|
|
50
|
+
export interface IDeleteResult<T = any> {
|
|
51
|
+
/** Number of rows deleted */
|
|
52
|
+
deletedCount: number;
|
|
53
|
+
/** Deleted rows (if returning option was used) */
|
|
54
|
+
data?: T[];
|
|
55
|
+
/** Execution time in milliseconds */
|
|
56
|
+
executionTime?: number;
|
|
57
|
+
/** Success flag */
|
|
58
|
+
success: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Upsert result
|
|
62
|
+
*/
|
|
63
|
+
export interface IUpsertResult<T = any> {
|
|
64
|
+
/** Number of rows inserted */
|
|
65
|
+
insertedCount: number;
|
|
66
|
+
/** Number of rows updated */
|
|
67
|
+
updatedCount: number;
|
|
68
|
+
/** Total affected rows */
|
|
69
|
+
affectedCount: number;
|
|
70
|
+
/** Operation performed ('insert' or 'update') - only applicable for single-row upserts */
|
|
71
|
+
operation?: 'insert' | 'update';
|
|
72
|
+
/** Upserted rows (if returning option was used) */
|
|
73
|
+
data?: T[];
|
|
74
|
+
/** Execution time in milliseconds */
|
|
75
|
+
executionTime?: number;
|
|
76
|
+
/** Success flag */
|
|
77
|
+
success: boolean;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Bulk operation result
|
|
81
|
+
*/
|
|
82
|
+
export interface IBulkOperationResult {
|
|
83
|
+
/** Number of successful operations */
|
|
84
|
+
successCount: number;
|
|
85
|
+
/** Number of failed operations */
|
|
86
|
+
failedCount: number;
|
|
87
|
+
/** Total operations */
|
|
88
|
+
totalCount: number;
|
|
89
|
+
/** Errors (if any) */
|
|
90
|
+
errors?: Array<{
|
|
91
|
+
index: number;
|
|
92
|
+
error: string;
|
|
93
|
+
}>;
|
|
94
|
+
/** Execution time in milliseconds */
|
|
95
|
+
executionTime?: number;
|
|
96
|
+
/** Success flag */
|
|
97
|
+
success: boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Transaction result
|
|
101
|
+
*/
|
|
102
|
+
export interface ITransactionResult {
|
|
103
|
+
/** Transaction ID */
|
|
104
|
+
transactionId?: string;
|
|
105
|
+
/** Operations executed */
|
|
106
|
+
operationsCount: number;
|
|
107
|
+
/** Success flag */
|
|
108
|
+
success: boolean;
|
|
109
|
+
/** Error message (if failed) */
|
|
110
|
+
error?: string;
|
|
111
|
+
/** Execution time in milliseconds */
|
|
112
|
+
executionTime?: number;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Schema operation result
|
|
116
|
+
*/
|
|
117
|
+
export interface ISchemaOperationResult {
|
|
118
|
+
/** Success flag */
|
|
119
|
+
success: boolean;
|
|
120
|
+
/** Operation type */
|
|
121
|
+
operation: 'create' | 'alter' | 'drop' | 'rename';
|
|
122
|
+
/** Table/Collection name */
|
|
123
|
+
table: string;
|
|
124
|
+
/** Error message (if failed) */
|
|
125
|
+
error?: string;
|
|
126
|
+
/** Migration generated (if applicable) */
|
|
127
|
+
migration?: {
|
|
128
|
+
tag: string;
|
|
129
|
+
name: string;
|
|
130
|
+
};
|
|
131
|
+
/** Execution time in milliseconds */
|
|
132
|
+
executionTime?: number;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Index operation result
|
|
136
|
+
*/
|
|
137
|
+
export interface IIndexOperationResult {
|
|
138
|
+
/** Success flag */
|
|
139
|
+
success: boolean;
|
|
140
|
+
/** Operation type */
|
|
141
|
+
operation: 'create' | 'drop';
|
|
142
|
+
/** Index name */
|
|
143
|
+
indexName: string;
|
|
144
|
+
/** Table name */
|
|
145
|
+
table: string;
|
|
146
|
+
/** Error message (if failed) */
|
|
147
|
+
error?: string;
|
|
148
|
+
/** Execution time in milliseconds */
|
|
149
|
+
executionTime?: number;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Raw query result
|
|
153
|
+
*/
|
|
154
|
+
export interface IRawQueryResult<T = any> {
|
|
155
|
+
/** Result rows/documents */
|
|
156
|
+
rows: T[];
|
|
157
|
+
/** Row count */
|
|
158
|
+
rowCount: number;
|
|
159
|
+
/** Fields/columns info */
|
|
160
|
+
fields?: Array<{
|
|
161
|
+
name: string;
|
|
162
|
+
type: string;
|
|
163
|
+
}>;
|
|
164
|
+
/** Execution time in milliseconds */
|
|
165
|
+
executionTime?: number;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Paginated result
|
|
169
|
+
*/
|
|
170
|
+
export interface IPaginatedResult<T = any> {
|
|
171
|
+
/** Current page data */
|
|
172
|
+
data: T[];
|
|
173
|
+
/** Pagination metadata */
|
|
174
|
+
pagination: {
|
|
175
|
+
/** Current page number */
|
|
176
|
+
page: number;
|
|
177
|
+
/** Page size */
|
|
178
|
+
pageSize: number;
|
|
179
|
+
/** Total records */
|
|
180
|
+
totalRecords: number;
|
|
181
|
+
/** Total pages */
|
|
182
|
+
totalPages: number;
|
|
183
|
+
/** Has next page */
|
|
184
|
+
hasNext: boolean;
|
|
185
|
+
/** Has previous page */
|
|
186
|
+
hasPrevious: boolean;
|
|
187
|
+
};
|
|
188
|
+
/** Execution time in milliseconds */
|
|
189
|
+
executionTime?: number;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Batch operation result item
|
|
193
|
+
*/
|
|
194
|
+
export interface IBatchOperationResultItem {
|
|
195
|
+
/** Operation index */
|
|
196
|
+
index: number;
|
|
197
|
+
/** Success flag */
|
|
198
|
+
success: boolean;
|
|
199
|
+
/** Result data */
|
|
200
|
+
result?: any;
|
|
201
|
+
/** Error (if failed) */
|
|
202
|
+
error?: string;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Connection test result
|
|
206
|
+
*/
|
|
207
|
+
export interface IConnectionTestResult {
|
|
208
|
+
/** Is connection successful */
|
|
209
|
+
connected: boolean;
|
|
210
|
+
/** Connection message */
|
|
211
|
+
message: string;
|
|
212
|
+
/** Database type */
|
|
213
|
+
databaseType: string;
|
|
214
|
+
/** Database version */
|
|
215
|
+
version?: string;
|
|
216
|
+
/** Response time in milliseconds */
|
|
217
|
+
responseTime: number;
|
|
218
|
+
/** Error (if failed) */
|
|
219
|
+
error?: string;
|
|
220
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.types.js","sourceRoot":"","sources":["../../../src/database/types/result.types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema type definitions for tables, columns, and data types
|
|
3
|
+
* Provides unified interface for SQL and NoSQL schema operations
|
|
4
|
+
*/
|
|
5
|
+
import type { IIndexDefinition } from './index.types';
|
|
6
|
+
/**
|
|
7
|
+
* Column data types (unified across SQL and NoSQL)
|
|
8
|
+
*/
|
|
9
|
+
export declare enum ColumnType {
|
|
10
|
+
STRING = "string",
|
|
11
|
+
TEXT = "text",
|
|
12
|
+
VARCHAR = "varchar",
|
|
13
|
+
CHAR = "char",
|
|
14
|
+
INTEGER = "integer",
|
|
15
|
+
BIGINT = "bigint",
|
|
16
|
+
SMALLINT = "smallint",
|
|
17
|
+
DECIMAL = "decimal",
|
|
18
|
+
NUMERIC = "numeric",
|
|
19
|
+
FLOAT = "float",
|
|
20
|
+
DOUBLE = "double",
|
|
21
|
+
REAL = "real",
|
|
22
|
+
BOOLEAN = "boolean",
|
|
23
|
+
DATE = "date",
|
|
24
|
+
TIME = "time",
|
|
25
|
+
DATETIME = "datetime",
|
|
26
|
+
TIMESTAMP = "timestamp",
|
|
27
|
+
JSON = "json",
|
|
28
|
+
JSONB = "jsonb",
|
|
29
|
+
OBJECT = "object",
|
|
30
|
+
ARRAY = "array",
|
|
31
|
+
BINARY = "binary",
|
|
32
|
+
BLOB = "blob",
|
|
33
|
+
UUID = "uuid",
|
|
34
|
+
ENUM = "enum"
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Column constraint types
|
|
38
|
+
*/
|
|
39
|
+
export declare enum ConstraintType {
|
|
40
|
+
PRIMARY_KEY = "primary_key",
|
|
41
|
+
FOREIGN_KEY = "foreign_key",
|
|
42
|
+
UNIQUE = "unique",
|
|
43
|
+
NOT_NULL = "not_null",
|
|
44
|
+
DEFAULT = "default",
|
|
45
|
+
CHECK = "check",
|
|
46
|
+
INDEX = "index"
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Column definition
|
|
50
|
+
*/
|
|
51
|
+
export interface IColumnDefinition {
|
|
52
|
+
/** Column name */
|
|
53
|
+
name: string;
|
|
54
|
+
/** Column type */
|
|
55
|
+
type: ColumnType;
|
|
56
|
+
/** Is column nullable */
|
|
57
|
+
nullable?: boolean;
|
|
58
|
+
/** Default value */
|
|
59
|
+
defaultValue?: any;
|
|
60
|
+
/** Is primary key */
|
|
61
|
+
primaryKey?: boolean;
|
|
62
|
+
/** Is unique */
|
|
63
|
+
unique?: boolean;
|
|
64
|
+
/** Is auto-increment */
|
|
65
|
+
autoIncrement?: boolean;
|
|
66
|
+
/** Column length (for string types) */
|
|
67
|
+
length?: number;
|
|
68
|
+
/** Precision (for decimal/numeric) */
|
|
69
|
+
precision?: number;
|
|
70
|
+
/** Scale (for decimal/numeric) */
|
|
71
|
+
scale?: number;
|
|
72
|
+
/** Enum values (for enum type) */
|
|
73
|
+
enumValues?: string[];
|
|
74
|
+
/** Foreign key reference */
|
|
75
|
+
foreignKey?: IForeignKeyDefinition;
|
|
76
|
+
/** Check constraint */
|
|
77
|
+
check?: string;
|
|
78
|
+
/** Comment */
|
|
79
|
+
comment?: string;
|
|
80
|
+
/** For nested objects (NoSQL) */
|
|
81
|
+
nested?: INestedFieldDefinition;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Foreign key definition
|
|
85
|
+
*/
|
|
86
|
+
export interface IForeignKeyDefinition {
|
|
87
|
+
/** Referenced table */
|
|
88
|
+
table: string;
|
|
89
|
+
/** Referenced column */
|
|
90
|
+
column: string;
|
|
91
|
+
/** On delete action */
|
|
92
|
+
onDelete?: 'CASCADE' | 'SET NULL' | 'NO ACTION' | 'RESTRICT';
|
|
93
|
+
/** On update action */
|
|
94
|
+
onUpdate?: 'CASCADE' | 'SET NULL' | 'NO ACTION' | 'RESTRICT';
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Nested field definition (for NoSQL/JSON columns)
|
|
98
|
+
*/
|
|
99
|
+
export interface INestedFieldDefinition {
|
|
100
|
+
/** Nested field type */
|
|
101
|
+
type: ColumnType;
|
|
102
|
+
/** Is array of values */
|
|
103
|
+
isArray?: boolean;
|
|
104
|
+
/** Child fields (for nested objects) */
|
|
105
|
+
fields?: Record<string, INestedFieldDefinition>;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Table schema definition
|
|
109
|
+
*/
|
|
110
|
+
export interface ITableSchema {
|
|
111
|
+
/** Table/Collection name */
|
|
112
|
+
name: string;
|
|
113
|
+
/** Column definitions */
|
|
114
|
+
columns: IColumnDefinition[];
|
|
115
|
+
/** Primary key columns (composite keys) */
|
|
116
|
+
primaryKeys?: string[];
|
|
117
|
+
/** Indexes */
|
|
118
|
+
indexes?: IIndexDefinition[];
|
|
119
|
+
/** Unique constraints */
|
|
120
|
+
uniqueConstraints?: string[][];
|
|
121
|
+
/** Check constraints */
|
|
122
|
+
checkConstraints?: Array<{
|
|
123
|
+
name: string;
|
|
124
|
+
expression: string;
|
|
125
|
+
}>;
|
|
126
|
+
/** Table comment */
|
|
127
|
+
comment?: string;
|
|
128
|
+
/** Table options (engine, charset, etc.) */
|
|
129
|
+
options?: Record<string, any>;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Column alteration types
|
|
133
|
+
*/
|
|
134
|
+
export declare enum ColumnAlterationType {
|
|
135
|
+
ADD = "add",
|
|
136
|
+
MODIFY = "modify",
|
|
137
|
+
DROP = "drop",
|
|
138
|
+
RENAME = "rename"
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Column alteration operation
|
|
142
|
+
*/
|
|
143
|
+
export interface IColumnAlteration {
|
|
144
|
+
/** Type of alteration */
|
|
145
|
+
type: ColumnAlterationType;
|
|
146
|
+
/** Column definition (for ADD/MODIFY) */
|
|
147
|
+
column?: IColumnDefinition;
|
|
148
|
+
/** Old column name (for RENAME) */
|
|
149
|
+
oldName?: string;
|
|
150
|
+
/** New column name (for RENAME) */
|
|
151
|
+
newName?: string;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Schema validation result
|
|
155
|
+
*/
|
|
156
|
+
export interface ISchemaValidationResult {
|
|
157
|
+
/** Is schema valid */
|
|
158
|
+
valid: boolean;
|
|
159
|
+
/** Validation errors */
|
|
160
|
+
errors: Array<{
|
|
161
|
+
field: string;
|
|
162
|
+
message: string;
|
|
163
|
+
}>;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Table creation options
|
|
167
|
+
*/
|
|
168
|
+
export interface ICreateTableOptions {
|
|
169
|
+
/** Create if not exists */
|
|
170
|
+
ifNotExists?: boolean;
|
|
171
|
+
/** Table comment */
|
|
172
|
+
comment?: string;
|
|
173
|
+
/** Table engine (MySQL) */
|
|
174
|
+
engine?: string;
|
|
175
|
+
/** Character set (MySQL) */
|
|
176
|
+
charset?: string;
|
|
177
|
+
/** Collation */
|
|
178
|
+
collate?: string;
|
|
179
|
+
/** Additional options */
|
|
180
|
+
options?: Record<string, any>;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Table alteration options
|
|
184
|
+
*/
|
|
185
|
+
export interface IAlterTableOptions {
|
|
186
|
+
/** Generate migration */
|
|
187
|
+
generateMigration?: boolean;
|
|
188
|
+
/** Migration name */
|
|
189
|
+
migrationName?: string;
|
|
190
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Schema type definitions for tables, columns, and data types
|
|
4
|
+
* Provides unified interface for SQL and NoSQL schema operations
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ColumnAlterationType = exports.ConstraintType = exports.ColumnType = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Column data types (unified across SQL and NoSQL)
|
|
10
|
+
*/
|
|
11
|
+
var ColumnType;
|
|
12
|
+
(function (ColumnType) {
|
|
13
|
+
// String types
|
|
14
|
+
ColumnType["STRING"] = "string";
|
|
15
|
+
ColumnType["TEXT"] = "text";
|
|
16
|
+
ColumnType["VARCHAR"] = "varchar";
|
|
17
|
+
ColumnType["CHAR"] = "char";
|
|
18
|
+
// Number types
|
|
19
|
+
ColumnType["INTEGER"] = "integer";
|
|
20
|
+
ColumnType["BIGINT"] = "bigint";
|
|
21
|
+
ColumnType["SMALLINT"] = "smallint";
|
|
22
|
+
ColumnType["DECIMAL"] = "decimal";
|
|
23
|
+
ColumnType["NUMERIC"] = "numeric";
|
|
24
|
+
ColumnType["FLOAT"] = "float";
|
|
25
|
+
ColumnType["DOUBLE"] = "double";
|
|
26
|
+
ColumnType["REAL"] = "real";
|
|
27
|
+
// Boolean
|
|
28
|
+
ColumnType["BOOLEAN"] = "boolean";
|
|
29
|
+
// Date/Time types
|
|
30
|
+
ColumnType["DATE"] = "date";
|
|
31
|
+
ColumnType["TIME"] = "time";
|
|
32
|
+
ColumnType["DATETIME"] = "datetime";
|
|
33
|
+
ColumnType["TIMESTAMP"] = "timestamp";
|
|
34
|
+
// JSON/Object types
|
|
35
|
+
ColumnType["JSON"] = "json";
|
|
36
|
+
ColumnType["JSONB"] = "jsonb";
|
|
37
|
+
ColumnType["OBJECT"] = "object";
|
|
38
|
+
ColumnType["ARRAY"] = "array";
|
|
39
|
+
// Binary
|
|
40
|
+
ColumnType["BINARY"] = "binary";
|
|
41
|
+
ColumnType["BLOB"] = "blob";
|
|
42
|
+
// Special types
|
|
43
|
+
ColumnType["UUID"] = "uuid";
|
|
44
|
+
ColumnType["ENUM"] = "enum";
|
|
45
|
+
})(ColumnType || (exports.ColumnType = ColumnType = {}));
|
|
46
|
+
/**
|
|
47
|
+
* Column constraint types
|
|
48
|
+
*/
|
|
49
|
+
var ConstraintType;
|
|
50
|
+
(function (ConstraintType) {
|
|
51
|
+
ConstraintType["PRIMARY_KEY"] = "primary_key";
|
|
52
|
+
ConstraintType["FOREIGN_KEY"] = "foreign_key";
|
|
53
|
+
ConstraintType["UNIQUE"] = "unique";
|
|
54
|
+
ConstraintType["NOT_NULL"] = "not_null";
|
|
55
|
+
ConstraintType["DEFAULT"] = "default";
|
|
56
|
+
ConstraintType["CHECK"] = "check";
|
|
57
|
+
ConstraintType["INDEX"] = "index";
|
|
58
|
+
})(ConstraintType || (exports.ConstraintType = ConstraintType = {}));
|
|
59
|
+
/**
|
|
60
|
+
* Column alteration types
|
|
61
|
+
*/
|
|
62
|
+
var ColumnAlterationType;
|
|
63
|
+
(function (ColumnAlterationType) {
|
|
64
|
+
ColumnAlterationType["ADD"] = "add";
|
|
65
|
+
ColumnAlterationType["MODIFY"] = "modify";
|
|
66
|
+
ColumnAlterationType["DROP"] = "drop";
|
|
67
|
+
ColumnAlterationType["RENAME"] = "rename";
|
|
68
|
+
})(ColumnAlterationType || (exports.ColumnAlterationType = ColumnAlterationType = {}));
|
|
69
|
+
//# sourceMappingURL=schema.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.types.js","sourceRoot":"","sources":["../../../src/database/types/schema.types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACH,IAAY,UAuCX;AAvCD,WAAY,UAAU;IACpB,eAAe;IACf,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IACb,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IAEb,eAAe;IACf,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IAEb,UAAU;IACV,iCAAmB,CAAA;IAEnB,kBAAkB;IAClB,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,mCAAqB,CAAA;IACrB,qCAAuB,CAAA;IAEvB,oBAAoB;IACpB,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,6BAAe,CAAA;IAEf,SAAS;IACT,+BAAiB,CAAA;IACjB,2BAAa,CAAA;IAEb,gBAAgB;IAChB,2BAAa,CAAA;IACb,2BAAa,CAAA;AACf,CAAC,EAvCW,UAAU,0BAAV,UAAU,QAuCrB;AAED;;GAEG;AACH,IAAY,cAQX;AARD,WAAY,cAAc;IACxB,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAC3B,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,iCAAe,CAAA;AACjB,CAAC,EARW,cAAc,8BAAd,cAAc,QAQzB;AAyFD;;GAEG;AACH,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,mCAAW,CAAA;IACX,yCAAiB,CAAA;IACjB,qCAAa,CAAA;IACb,yCAAiB,CAAA;AACnB,CAAC,EALW,oBAAoB,oCAApB,oBAAoB,QAK/B"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Database Helper Utilities
|
|
3
|
+
* Type mapping, query building, and error handling utilities
|
|
4
|
+
*/
|
|
5
|
+
import { ColumnType } from '../types/schema.types';
|
|
6
|
+
import { DatabaseType } from '../types/database.types';
|
|
7
|
+
import { WhereClause } from '../types/query.types';
|
|
8
|
+
/**
|
|
9
|
+
* Map generic column types to database-specific types
|
|
10
|
+
*/
|
|
11
|
+
export declare function mapColumnTypeToNative(type: ColumnType, dbType: DatabaseType): string;
|
|
12
|
+
/**
|
|
13
|
+
* Build WHERE clause string for SQL databases from WhereClause
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildWhereClause(where: WhereClause, paramIndex?: number): {
|
|
16
|
+
sql: string;
|
|
17
|
+
params: any[];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Build MongoDB query from WhereClause
|
|
21
|
+
*/
|
|
22
|
+
export declare function buildMongoQuery(where: WhereClause): any;
|
|
23
|
+
/**
|
|
24
|
+
* Escape identifier (table/column name) for SQL
|
|
25
|
+
*/
|
|
26
|
+
export declare function escapeIdentifier(identifier: string, dbType: DatabaseType): string;
|
|
27
|
+
/**
|
|
28
|
+
* Escape string value for SQL
|
|
29
|
+
*/
|
|
30
|
+
export declare function escapeValue(value: any): string;
|
|
31
|
+
/**
|
|
32
|
+
* Format error message with context
|
|
33
|
+
*/
|
|
34
|
+
export declare function formatDatabaseError(error: any, operation: string, tableName?: string): Error;
|
|
35
|
+
/**
|
|
36
|
+
* Check if error is a connection error
|
|
37
|
+
*/
|
|
38
|
+
export declare function isConnectionError(error: any): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Check if error is a duplicate key error
|
|
41
|
+
*/
|
|
42
|
+
export declare function isDuplicateKeyError(error: any): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Check if error is a foreign key constraint error
|
|
45
|
+
*/
|
|
46
|
+
export declare function isForeignKeyError(error: any): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Retry a database operation with exponential backoff
|
|
49
|
+
*/
|
|
50
|
+
export declare function retryOperation<T>(operation: () => Promise<T>, maxRetries?: number, initialDelay?: number): Promise<T>;
|
|
51
|
+
/**
|
|
52
|
+
* Sanitize table name to prevent SQL injection
|
|
53
|
+
*/
|
|
54
|
+
export declare function sanitizeTableName(tableName: string): string;
|
|
55
|
+
/**
|
|
56
|
+
* Convert camelCase to snake_case
|
|
57
|
+
*/
|
|
58
|
+
export declare function camelToSnake(str: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* Convert snake_case to camelCase
|
|
61
|
+
*/
|
|
62
|
+
export declare function snakeToCamel(str: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* Deep clone an object
|
|
65
|
+
*/
|
|
66
|
+
export declare function deepClone<T>(obj: T): T;
|