@carllee1983/dbcli 12.0.0 → 12.1.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/dist/core.d.ts CHANGED
@@ -2,298 +2,6 @@
2
2
 
3
3
  import { z } from 'zod';
4
4
 
5
- /**
6
- * Database adapter type definitions and interfaces
7
- * Defines the contract that all database adapters must implement
8
- */
9
- export type DatabaseSystem = "postgresql" | "mysql" | "mariadb" | "sqlite" | "mongodb" | "redis" | "elasticsearch";
10
- type SqlDatabaseSystem = Extract<DatabaseSystem, "postgresql" | "mysql" | "mariadb" | "sqlite">;
11
- type SqlExecutionMode = "normal" | "native-read-only";
12
- type QueryableDatabaseSystem = Exclude<DatabaseSystem, SqlDatabaseSystem>;
13
- /**
14
- * Connection configuration for database adapters
15
- */
16
- export interface ConnectionOptions {
17
- /** Database system type */
18
- system: DatabaseSystem;
19
- /** Database host address or hostname */
20
- host: string;
21
- /** Database port number */
22
- port: number;
23
- /** Database user name */
24
- user: string;
25
- /** Database password */
26
- password: string;
27
- /** Database name */
28
- database: string;
29
- /** SQLite database file path (required for SQLite connections, absent otherwise) */
30
- file?: string;
31
- /** MongoDB connection URI (optional, for MongoDB connections) */
32
- uri?: string;
33
- /** MongoDB auth database — used when building URI from host/port/user/password (default: 'admin') */
34
- authSource?: string;
35
- /** MongoDB replica set name (optional, field-based config) */
36
- replicaSet?: string;
37
- /** MongoDB TLS switch (optional, field-based config; implied true when srv) */
38
- tls?: boolean;
39
- /** MongoDB extra driver options appended to the URI query string (field-based config, plain strings only) */
40
- options?: Record<string, string>;
41
- /** MongoDB SRV lookup — build a mongodb+srv:// URI from host (optional, field-based config) */
42
- srv?: boolean;
43
- /** Connection timeout in milliseconds (default: 5000) */
44
- timeout?: number;
45
- /**
46
- * Statement timeout in milliseconds. Falls back to `timeout` when unset, and
47
- * to the server default when neither is given — an unset statement timeout
48
- * means the server decides, not that 5000ms applies. 0 removes the limit.
49
- */
50
- statementTimeout?: number;
51
- /** Elasticsearch protocol (http or https) */
52
- protocol?: "http" | "https";
53
- /** Elasticsearch nodes for round-robin (optional) */
54
- nodes?: string[];
55
- /** Elasticsearch Cloud ID (optional) */
56
- cloudId?: string;
57
- /** Elasticsearch API Key (optional) */
58
- apiKey?: string;
59
- /** Elasticsearch CA Certificate Path (optional) */
60
- caPath?: string;
61
- /** Whether to reject unauthorized TLS connections (default: true) */
62
- rejectUnauthorized?: boolean;
63
- }
64
- export type SqlConnectionOptions = ConnectionOptions & {
65
- system: SqlDatabaseSystem;
66
- };
67
- export type QueryableConnectionOptions = ConnectionOptions & {
68
- system: QueryableDatabaseSystem;
69
- };
70
- /**
71
- * Schema information for a single column
72
- */
73
- export interface ColumnSchema {
74
- /** Column name */
75
- name: string;
76
- /** Column data type */
77
- type: string;
78
- /** Whether column allows NULL values */
79
- nullable: boolean;
80
- /** Default value for column (if any) */
81
- default?: string;
82
- /** Whether column is primary key */
83
- primaryKey?: boolean;
84
- /** Foreign key reference if applicable */
85
- foreignKey?: {
86
- table: string;
87
- column: string;
88
- };
89
- /** Whether column is auto-incremented */
90
- autoIncrement?: boolean;
91
- /** Column comment/description */
92
- comment?: string | null;
93
- /** Enum values if column is ENUM type */
94
- enumValues?: string[];
95
- /** MongoDB only: 0..1 fraction of sampled docs that contained this dot-path. Undefined for SQL. */
96
- presence?: number;
97
- /** MongoDB only: true when this dot-path matches a blacklist pattern. Undefined for SQL. */
98
- redacted?: boolean;
99
- }
100
- /**
101
- * Complete schema information for a table
102
- */
103
- export interface TableSchema {
104
- /** Some metadata was omitted to protect blacklisted identities. No protected names. */
105
- metadataOmitted?: boolean;
106
- /** Table name */
107
- name: string;
108
- /** Exact database schema/catalog namespace, when reliably available */
109
- schema?: string;
110
- /** Array of columns in the table */
111
- columns: ColumnSchema[];
112
- /** Approximate row count (if available) */
113
- rowCount?: number;
114
- /** Storage engine (PostgreSQL/MySQL) */
115
- engine?: string;
116
- /** Primary key column names */
117
- primaryKey?: string[];
118
- /** Foreign key constraints with metadata */
119
- foreignKeys?: Array<{
120
- name: string;
121
- columns: string[];
122
- refSchema?: string;
123
- refTable: string;
124
- refColumns: string[];
125
- }>;
126
- /** Table indexes with column information */
127
- indexes?: Array<{
128
- name: string;
129
- columns: string[];
130
- unique: boolean;
131
- /** False when expressions/predicates prevent complete column-only representation. */
132
- columnsComplete?: boolean;
133
- }>;
134
- /** Column count (used by listTables when full column details are not loaded) */
135
- columnCount?: number;
136
- /** Estimated row count in table */
137
- estimatedRowCount?: number;
138
- /** Type of table (table or view) */
139
- tableType?: "table" | "view";
140
- }
141
- type ConnectionErrorCode = "ECONNREFUSED" | "ETIMEDOUT" | "AUTH_FAILED" | "DB_PERMISSION_DENIED" | "ENOTFOUND" | "EHOSTUNREACH" | "CONNECTION_LOST" | "TOO_MANY_CONNECTIONS" | "TLS_ERROR" | "SERVER_NOT_READY" | "CONNECTION_REJECTED" | "SQL_SYNTAX_ERROR" | "STATEMENT_TIMEOUT" | "TABLE_NOT_FOUND" | "COLUMN_NOT_FOUND" | "QUERY_ONLY_BOUNDARY_FAILED" | "UNKNOWN";
142
- export declare class ConnectionError extends Error {
143
- /** Error category code */
144
- code: ConnectionErrorCode;
145
- /** Array of actionable troubleshooting hints */
146
- hints: string[];
147
- /**
148
- * The ceiling that was in force, in milliseconds. Set on STATEMENT_TIMEOUT so
149
- * consumers can state it without parsing `message`; the recovery envelope needs
150
- * it to tell an agent what `--statement-timeout <ms>` it was already up against.
151
- */
152
- limitMs?: number | undefined;
153
- /** Whether an interactive caller may safely retry the statement after reconnecting. */
154
- readonly retrySafe: boolean;
155
- constructor(
156
- /** Error category code */
157
- code: ConnectionErrorCode,
158
- /** User-friendly error message */
159
- message: string,
160
- /** Array of actionable troubleshooting hints */
161
- hints: string[],
162
- /**
163
- * The ceiling that was in force, in milliseconds. Set on STATEMENT_TIMEOUT so
164
- * consumers can state it without parsing `message`; the recovery envelope needs
165
- * it to tell an agent what `--statement-timeout <ms>` it was already up against.
166
- */
167
- limitMs?: number | undefined,
168
- /** Whether an interactive caller may safely retry the statement after reconnecting. */
169
- retrySafe?: boolean);
170
- }
171
- /**
172
- * Result of a database query or command execution
173
- */
174
- export interface ExecutionResult<T> {
175
- /** Array of result rows as objects (for SELECT queries) */
176
- rows: T[];
177
- /** Number of rows affected by the operation (for INSERT/UPDATE/DELETE) */
178
- affectedRows: number;
179
- /** Last inserted ID if applicable (for INSERT operations) */
180
- lastInsertId?: number | string;
181
- /** Convenience row count — used by formatters; mirrors rows.length on read paths */
182
- rowCount?: number;
183
- /** Column ordering for the rows, used by formatters that render tabular output */
184
- columnNames?: string[];
185
- /** Optional warnings — emitted today only by RedisAdapter (size guard / blacklist filter). */
186
- warnings?: RedisWarning[];
187
- }
188
- type RedisWarning = {
189
- code: "REDIS_SIZE_REWRITE";
190
- command: string;
191
- original: string[];
192
- rewritten: string[];
193
- } | {
194
- code: "REDIS_SIZE_TRUNCATE";
195
- command: string;
196
- kept: number;
197
- droppedAtLeast: number;
198
- } | {
199
- code: "REDIS_BLACKLIST_FILTERED";
200
- count: number;
201
- };
202
- interface TableSchemaOptions {
203
- /** Single-object schema command: validate presence/type and mark incomplete index metadata. */
204
- metadataProtection?: boolean;
205
- /** Explicit SQL namespace; local tableName remains literal. Never performs an exact count. */
206
- namespace?: string;
207
- /** MongoDB: 取樣文件數 */
208
- sampleSize?: number;
209
- /** MongoDB: 取樣方式 */
210
- sampleMethod?: "random" | "natural";
211
- /**
212
- * 精確列數要掃全表。掃描整個資料庫時設為 false,改用引擎的估計值——
213
- * 一百張表的資料庫做不起一百次全表 COUNT。預設 true。
214
- */
215
- exactRowCount?: boolean;
216
- }
217
- /**
218
- * Database adapter interface - contract for all database implementations
219
- * Defines methods that all database adapters must implement
220
- */
221
- export interface DatabaseAdapter {
222
- /**
223
- * Establish connection and verify credentials
224
- * Throws ConnectionError with categorized error type on failure
225
- * @throws {ConnectionError} If connection fails (server down, auth failed, timeout, etc.)
226
- */
227
- connect(): Promise<void>;
228
- /**
229
- * Close connection and release resources
230
- * Should never throw; safe to call multiple times
231
- * Handles cleanup gracefully even if already disconnected
232
- */
233
- disconnect(): Promise<void>;
234
- /**
235
- * Execute arbitrary SQL query with parameterized values
236
- * Prevents SQL injection by using parameter binding
237
- * @param sql Query string with parameter placeholders ($1, $2, etc. for PostgreSQL or ? for MySQL)
238
- * @param params Array of parameter values in order
239
- * @returns Execution result containing rows and metadata
240
- * @throws {ConnectionError} If query execution fails
241
- */
242
- execute<T>(sql: string, params?: (string | number | boolean | null)[], options?: {
243
- noLimit?: boolean;
244
- sqlMode?: SqlExecutionMode;
245
- }): Promise<ExecutionResult<T>>;
246
- /**
247
- * List all tables in the connected database
248
- * Includes metadata such as row count and storage engine
249
- * @returns Array of table schemas with basic information
250
- * @throws {ConnectionError} If query fails
251
- */
252
- listTables(): Promise<TableSchema[]>;
253
- /**
254
- * Fetch complete schema for a single table
255
- * Includes all columns with types and constraints
256
- * @param tableName Name of table to inspect
257
- * @param options Optional adapter-specific knobs (e.g. mongo `sampleSize`); SQL adapters ignore them.
258
- * @returns Complete table schema including all column details
259
- * @throws {ConnectionError} If query fails
260
- */
261
- getTableSchema(tableName: string, options?: TableSchemaOptions): Promise<TableSchema>;
262
- /**
263
- * Test connection with lightweight probe query
264
- * Executes SELECT 1 or equivalent to verify connection is alive
265
- * @returns true if connection successful
266
- * @throws {ConnectionError} If connection test fails
267
- */
268
- testConnection(): Promise<boolean>;
269
- /**
270
- * Get the database server version string
271
- * @returns Raw version string from the server (e.g. "8.0.35", "15.4", "10.11.6-MariaDB")
272
- * @throws {ConnectionError} If not connected or query fails
273
- */
274
- getServerVersion(): Promise<string>;
275
- }
276
- type SideEffectTier = "readonly" | "dry-run" | "local-write" | "db-write" | "interactive" | "none";
277
- interface BlacklistConfig {
278
- /** Table names to block all operations on */
279
- tables: string[];
280
- /** Column names to omit per table: { tableName: [col1, col2] } */
281
- columns: Record<string, string[]>;
282
- }
283
- interface BlacklistState {
284
- /** Set of lowercase table names for O(1) case-insensitive lookup */
285
- tables: Set<string>;
286
- /** Map of table name -> Set of blacklisted column names */
287
- columns: Map<string, Set<string>>;
288
- }
289
- /**
290
- * Error thrown when an operation is blocked by blacklist rules
291
- */
292
- export declare class BlacklistError extends Error {
293
- readonly tableName: string;
294
- readonly operation: string;
295
- constructor(message: string, tableName: string, operation: string);
296
- }
297
5
  /**
298
6
  * Type definitions for data modification operations
299
7
  * Defines results and options for data modification (INSERT, UPDATE, DELETE) operations
@@ -383,7 +91,32 @@ export interface MutationConfirmationRequest {
383
91
  * Returns true to proceed, false to abandon the mutation.
384
92
  */
385
93
  export type MutationConfirmer = (request: MutationConfirmationRequest) => Promise<boolean>;
94
+ interface BlacklistConfig {
95
+ /** Table names to block all operations on */
96
+ tables: string[];
97
+ /** Column names to omit per table: { tableName: [col1, col2] } */
98
+ columns: Record<string, string[]>;
99
+ }
100
+ interface BlacklistState {
101
+ /** Set of lowercase table names for O(1) case-insensitive lookup */
102
+ tables: Set<string>;
103
+ /** Map of table name -> Set of blacklisted column names */
104
+ columns: Map<string, Set<string>>;
105
+ }
106
+ /**
107
+ * Error thrown when an operation is blocked by blacklist rules
108
+ */
109
+ export declare class BlacklistError extends Error {
110
+ readonly tableName: string;
111
+ readonly operation: string;
112
+ constructor(message: string, tableName: string, operation: string);
113
+ }
114
+ interface SqlTlsConfig {
115
+ mode: "verify-full";
116
+ caPath: string;
117
+ }
386
118
  interface SqlConnectionConfig {
119
+ sqlTls?: SqlTlsConfig;
387
120
  system: "postgresql" | "mysql" | "mariadb";
388
121
  host: string | {
389
122
  $env: string;
@@ -502,22 +235,296 @@ interface ElasticsearchConnectionConfig {
502
235
  caPath?: string;
503
236
  rejectUnauthorized?: boolean;
504
237
  }
505
- type ConnectionConfig = SqlConnectionConfig | SqliteConnectionConfig | MongoDBConnectionConfig | RedisConnectionConfig | ElasticsearchConnectionConfig;
238
+ type ConnectionConfig = SqlConnectionConfig | SqliteConnectionConfig | MongoDBConnectionConfig | RedisConnectionConfig | ElasticsearchConnectionConfig;
239
+ /**
240
+ * Permission level (coarse-grained access control)
241
+ */
242
+ export type Permission = "query-only" | "read-write" | "data-admin" | "admin";
243
+ interface Metadata {
244
+ createdAt?: string;
245
+ version: string;
246
+ }
247
+ interface DbcliConfig {
248
+ connection: ConnectionConfig;
249
+ permission: Permission;
250
+ schema?: Record<string, unknown>;
251
+ metadata?: Metadata;
252
+ blacklist?: BlacklistConfig;
253
+ }
254
+ /**
255
+ * Database adapter type definitions and interfaces
256
+ * Defines the contract that all database adapters must implement
257
+ */
258
+ export type DatabaseSystem = "postgresql" | "mysql" | "mariadb" | "sqlite" | "mongodb" | "redis" | "elasticsearch";
259
+ type SqlDatabaseSystem = Extract<DatabaseSystem, "postgresql" | "mysql" | "mariadb" | "sqlite">;
260
+ type SqlExecutionMode = "normal" | "native-read-only";
261
+ type QueryableDatabaseSystem = Exclude<DatabaseSystem, SqlDatabaseSystem>;
262
+ /**
263
+ * Connection configuration for database adapters
264
+ */
265
+ export interface ConnectionOptions {
266
+ /** Explicit verified SQL TLS; currently PostgreSQL only. */
267
+ sqlTls?: SqlTlsConfig;
268
+ /** Database system type */
269
+ system: DatabaseSystem;
270
+ /** Database host address or hostname */
271
+ host: string;
272
+ /** Database port number */
273
+ port: number;
274
+ /** Database user name */
275
+ user: string;
276
+ /** Database password */
277
+ password: string;
278
+ /** Database name */
279
+ database: string;
280
+ /** SQLite database file path (required for SQLite connections, absent otherwise) */
281
+ file?: string;
282
+ /** MongoDB connection URI (optional, for MongoDB connections) */
283
+ uri?: string;
284
+ /** MongoDB auth database — used when building URI from host/port/user/password (default: 'admin') */
285
+ authSource?: string;
286
+ /** MongoDB replica set name (optional, field-based config) */
287
+ replicaSet?: string;
288
+ /** MongoDB TLS switch (optional, field-based config; implied true when srv) */
289
+ tls?: boolean;
290
+ /** MongoDB extra driver options appended to the URI query string (field-based config, plain strings only) */
291
+ options?: Record<string, string>;
292
+ /** MongoDB SRV lookup — build a mongodb+srv:// URI from host (optional, field-based config) */
293
+ srv?: boolean;
294
+ /** Connection timeout in milliseconds (default: 5000) */
295
+ timeout?: number;
296
+ /**
297
+ * Statement timeout in milliseconds. Falls back to `timeout` when unset, and
298
+ * to the server default when neither is given — an unset statement timeout
299
+ * means the server decides, not that 5000ms applies. 0 removes the limit.
300
+ */
301
+ statementTimeout?: number;
302
+ /** Elasticsearch protocol (http or https) */
303
+ protocol?: "http" | "https";
304
+ /** Elasticsearch nodes for round-robin (optional) */
305
+ nodes?: string[];
306
+ /** Elasticsearch Cloud ID (optional) */
307
+ cloudId?: string;
308
+ /** Elasticsearch API Key (optional) */
309
+ apiKey?: string;
310
+ /** Elasticsearch CA Certificate Path (optional) */
311
+ caPath?: string;
312
+ /** Whether to reject unauthorized TLS connections (default: true) */
313
+ rejectUnauthorized?: boolean;
314
+ }
315
+ export type SqlConnectionOptions = ConnectionOptions & {
316
+ system: SqlDatabaseSystem;
317
+ };
318
+ export type QueryableConnectionOptions = ConnectionOptions & {
319
+ system: QueryableDatabaseSystem;
320
+ };
321
+ /**
322
+ * Schema information for a single column
323
+ */
324
+ export interface ColumnSchema {
325
+ /** Column name */
326
+ name: string;
327
+ /** Column data type */
328
+ type: string;
329
+ /** Whether column allows NULL values */
330
+ nullable: boolean;
331
+ /** Default value for column (if any) */
332
+ default?: string;
333
+ /** Whether column is primary key */
334
+ primaryKey?: boolean;
335
+ /** Foreign key reference if applicable */
336
+ foreignKey?: {
337
+ table: string;
338
+ column: string;
339
+ };
340
+ /** Whether column is auto-incremented */
341
+ autoIncrement?: boolean;
342
+ /** Column comment/description */
343
+ comment?: string | null;
344
+ /** Enum values if column is ENUM type */
345
+ enumValues?: string[];
346
+ /** MongoDB only: 0..1 fraction of sampled docs that contained this dot-path. Undefined for SQL. */
347
+ presence?: number;
348
+ /** MongoDB only: true when this dot-path matches a blacklist pattern. Undefined for SQL. */
349
+ redacted?: boolean;
350
+ }
351
+ /**
352
+ * Complete schema information for a table
353
+ */
354
+ export interface TableSchema {
355
+ /** Some metadata was omitted to protect blacklisted identities. No protected names. */
356
+ metadataOmitted?: boolean;
357
+ /** Table name */
358
+ name: string;
359
+ /** Exact database schema/catalog namespace, when reliably available */
360
+ schema?: string;
361
+ /** Array of columns in the table */
362
+ columns: ColumnSchema[];
363
+ /** Approximate row count (if available) */
364
+ rowCount?: number;
365
+ /** Storage engine (PostgreSQL/MySQL) */
366
+ engine?: string;
367
+ /** Primary key column names */
368
+ primaryKey?: string[];
369
+ /** Foreign key constraints with metadata */
370
+ foreignKeys?: Array<{
371
+ name: string;
372
+ columns: string[];
373
+ refSchema?: string;
374
+ refTable: string;
375
+ refColumns: string[];
376
+ }>;
377
+ /** Table indexes with column information */
378
+ indexes?: Array<{
379
+ name: string;
380
+ columns: string[];
381
+ unique: boolean;
382
+ /** False when expressions/predicates prevent complete column-only representation. */
383
+ columnsComplete?: boolean;
384
+ }>;
385
+ /** Column count (used by listTables when full column details are not loaded) */
386
+ columnCount?: number;
387
+ /** Estimated row count in table */
388
+ estimatedRowCount?: number;
389
+ /** Type of table (table or view) */
390
+ tableType?: "table" | "view";
391
+ }
392
+ type ConnectionErrorCode = "ECONNREFUSED" | "ETIMEDOUT" | "AUTH_FAILED" | "DB_PERMISSION_DENIED" | "ENOTFOUND" | "EHOSTUNREACH" | "CONNECTION_LOST" | "TOO_MANY_CONNECTIONS" | "TLS_ERROR" | "SERVER_NOT_READY" | "CONNECTION_REJECTED" | "SQL_SYNTAX_ERROR" | "STATEMENT_TIMEOUT" | "TABLE_NOT_FOUND" | "COLUMN_NOT_FOUND" | "QUERY_ONLY_BOUNDARY_FAILED" | "UNKNOWN";
393
+ export declare class ConnectionError extends Error {
394
+ /** Error category code */
395
+ code: ConnectionErrorCode;
396
+ /** Array of actionable troubleshooting hints */
397
+ hints: string[];
398
+ /**
399
+ * The ceiling that was in force, in milliseconds. Set on STATEMENT_TIMEOUT so
400
+ * consumers can state it without parsing `message`; the recovery envelope needs
401
+ * it to tell an agent what `--statement-timeout <ms>` it was already up against.
402
+ */
403
+ limitMs?: number | undefined;
404
+ /** Whether an interactive caller may safely retry the statement after reconnecting. */
405
+ readonly retrySafe: boolean;
406
+ constructor(
407
+ /** Error category code */
408
+ code: ConnectionErrorCode,
409
+ /** User-friendly error message */
410
+ message: string,
411
+ /** Array of actionable troubleshooting hints */
412
+ hints: string[],
413
+ /**
414
+ * The ceiling that was in force, in milliseconds. Set on STATEMENT_TIMEOUT so
415
+ * consumers can state it without parsing `message`; the recovery envelope needs
416
+ * it to tell an agent what `--statement-timeout <ms>` it was already up against.
417
+ */
418
+ limitMs?: number | undefined,
419
+ /** Whether an interactive caller may safely retry the statement after reconnecting. */
420
+ retrySafe?: boolean);
421
+ }
422
+ /**
423
+ * Result of a database query or command execution
424
+ */
425
+ export interface ExecutionResult<T> {
426
+ /** Array of result rows as objects (for SELECT queries) */
427
+ rows: T[];
428
+ /** Number of rows affected by the operation (for INSERT/UPDATE/DELETE) */
429
+ affectedRows: number;
430
+ /** Last inserted ID if applicable (for INSERT operations) */
431
+ lastInsertId?: number | string;
432
+ /** Convenience row count — used by formatters; mirrors rows.length on read paths */
433
+ rowCount?: number;
434
+ /** Column ordering for the rows, used by formatters that render tabular output */
435
+ columnNames?: string[];
436
+ /** Optional warnings — emitted today only by RedisAdapter (size guard / blacklist filter). */
437
+ warnings?: RedisWarning[];
438
+ }
439
+ type RedisWarning = {
440
+ code: "REDIS_SIZE_REWRITE";
441
+ command: string;
442
+ original: string[];
443
+ rewritten: string[];
444
+ } | {
445
+ code: "REDIS_SIZE_TRUNCATE";
446
+ command: string;
447
+ kept: number;
448
+ droppedAtLeast: number;
449
+ } | {
450
+ code: "REDIS_BLACKLIST_FILTERED";
451
+ count: number;
452
+ };
453
+ interface TableSchemaOptions {
454
+ /** Single-object schema command: validate presence/type and mark incomplete index metadata. */
455
+ metadataProtection?: boolean;
456
+ /** Explicit SQL namespace; local tableName remains literal. Never performs an exact count. */
457
+ namespace?: string;
458
+ /** MongoDB: 取樣文件數 */
459
+ sampleSize?: number;
460
+ /** MongoDB: 取樣方式 */
461
+ sampleMethod?: "random" | "natural";
462
+ /**
463
+ * 精確列數要掃全表。掃描整個資料庫時設為 false,改用引擎的估計值——
464
+ * 一百張表的資料庫做不起一百次全表 COUNT。預設 true。
465
+ */
466
+ exactRowCount?: boolean;
467
+ }
506
468
  /**
507
- * Permission level (coarse-grained access control)
469
+ * Database adapter interface - contract for all database implementations
470
+ * Defines methods that all database adapters must implement
508
471
  */
509
- export type Permission = "query-only" | "read-write" | "data-admin" | "admin";
510
- interface Metadata {
511
- createdAt?: string;
512
- version: string;
513
- }
514
- interface DbcliConfig {
515
- connection: ConnectionConfig;
516
- permission: Permission;
517
- schema?: Record<string, unknown>;
518
- metadata?: Metadata;
519
- blacklist?: BlacklistConfig;
472
+ export interface DatabaseAdapter {
473
+ /**
474
+ * Establish connection and verify credentials
475
+ * Throws ConnectionError with categorized error type on failure
476
+ * @throws {ConnectionError} If connection fails (server down, auth failed, timeout, etc.)
477
+ */
478
+ connect(): Promise<void>;
479
+ /**
480
+ * Close connection and release resources
481
+ * Should never throw; safe to call multiple times
482
+ * Handles cleanup gracefully even if already disconnected
483
+ */
484
+ disconnect(): Promise<void>;
485
+ /**
486
+ * Execute arbitrary SQL query with parameterized values
487
+ * Prevents SQL injection by using parameter binding
488
+ * @param sql Query string with parameter placeholders ($1, $2, etc. for PostgreSQL or ? for MySQL)
489
+ * @param params Array of parameter values in order
490
+ * @returns Execution result containing rows and metadata
491
+ * @throws {ConnectionError} If query execution fails
492
+ */
493
+ execute<T>(sql: string, params?: (string | number | boolean | null)[], options?: {
494
+ noLimit?: boolean;
495
+ sqlMode?: SqlExecutionMode;
496
+ }): Promise<ExecutionResult<T>>;
497
+ /**
498
+ * List all tables in the connected database
499
+ * Includes metadata such as row count and storage engine
500
+ * @returns Array of table schemas with basic information
501
+ * @throws {ConnectionError} If query fails
502
+ */
503
+ listTables(): Promise<TableSchema[]>;
504
+ /**
505
+ * Fetch complete schema for a single table
506
+ * Includes all columns with types and constraints
507
+ * @param tableName Name of table to inspect
508
+ * @param options Optional adapter-specific knobs (e.g. mongo `sampleSize`); SQL adapters ignore them.
509
+ * @returns Complete table schema including all column details
510
+ * @throws {ConnectionError} If query fails
511
+ */
512
+ getTableSchema(tableName: string, options?: TableSchemaOptions): Promise<TableSchema>;
513
+ /**
514
+ * Test connection with lightweight probe query
515
+ * Executes SELECT 1 or equivalent to verify connection is alive
516
+ * @returns true if connection successful
517
+ * @throws {ConnectionError} If connection test fails
518
+ */
519
+ testConnection(): Promise<boolean>;
520
+ /**
521
+ * Get the database server version string
522
+ * @returns Raw version string from the server (e.g. "8.0.35", "15.4", "10.11.6-MariaDB")
523
+ * @throws {ConnectionError} If not connected or query fails
524
+ */
525
+ getServerVersion(): Promise<string>;
520
526
  }
527
+ type SideEffectTier = "readonly" | "dry-run" | "local-write" | "db-write" | "interactive" | "none";
521
528
  interface AppliedLimitMetadata {
522
529
  /** True only when the caller fetched and removed an additional row. */
523
530
  truncated: boolean;
@@ -821,10 +828,20 @@ export declare class BlacklistValidator {
821
828
  buildSecurityNotification(_tableName: string, omittedColumns: string[]): string;
822
829
  }
823
830
  declare const DbcliConfigSchema: z.ZodObject<{
824
- connection: z.ZodUnion<[
831
+ connection: z.ZodEffects<z.ZodUnion<[
825
832
  z.ZodObject<{
826
833
  timeout: z.ZodOptional<z.ZodNumber>;
827
834
  statementTimeout: z.ZodOptional<z.ZodNumber>;
835
+ sqlTls: z.ZodOptional<z.ZodObject<{
836
+ mode: z.ZodLiteral<"verify-full">;
837
+ caPath: z.ZodEffects<z.ZodString, string, string>;
838
+ }, "strict", z.ZodTypeAny, {
839
+ mode: "verify-full";
840
+ caPath: string;
841
+ }, {
842
+ mode: "verify-full";
843
+ caPath: string;
844
+ }>>;
828
845
  system: z.ZodEnum<[
829
846
  "postgresql",
830
847
  "mysql",
@@ -884,10 +901,10 @@ declare const DbcliConfigSchema: z.ZodObject<{
884
901
  password: string | {
885
902
  $env: string;
886
903
  };
887
- system: "postgresql" | "mysql" | "mariadb";
888
904
  host: string | {
889
905
  $env: string;
890
906
  };
907
+ system: "postgresql" | "mysql" | "mariadb";
891
908
  port: number | {
892
909
  $env: string;
893
910
  };
@@ -899,11 +916,15 @@ declare const DbcliConfigSchema: z.ZodObject<{
899
916
  };
900
917
  timeout?: number | undefined;
901
918
  statementTimeout?: number | undefined;
919
+ sqlTls?: {
920
+ mode: "verify-full";
921
+ caPath: string;
922
+ } | undefined;
902
923
  }, {
903
- system: "postgresql" | "mysql" | "mariadb";
904
924
  host: string | {
905
925
  $env: string;
906
926
  };
927
+ system: "postgresql" | "mysql" | "mariadb";
907
928
  port: number | {
908
929
  $env: string;
909
930
  };
@@ -918,6 +939,10 @@ declare const DbcliConfigSchema: z.ZodObject<{
918
939
  } | undefined;
919
940
  timeout?: number | undefined;
920
941
  statementTimeout?: number | undefined;
942
+ sqlTls?: {
943
+ mode: "verify-full";
944
+ caPath: string;
945
+ } | undefined;
921
946
  }>,
922
947
  z.ZodObject<{
923
948
  timeout: z.ZodOptional<z.ZodNumber>;
@@ -991,10 +1016,10 @@ declare const DbcliConfigSchema: z.ZodObject<{
991
1016
  password: string | {
992
1017
  $env: string;
993
1018
  };
994
- system: "sqlite";
995
1019
  host: string | {
996
1020
  $env: string;
997
1021
  };
1022
+ system: "sqlite";
998
1023
  port: number | {
999
1024
  $env: string;
1000
1025
  };
@@ -1123,10 +1148,10 @@ declare const DbcliConfigSchema: z.ZodObject<{
1123
1148
  password: string | {
1124
1149
  $env: string;
1125
1150
  };
1126
- system: "mongodb";
1127
1151
  host: string | {
1128
1152
  $env: string;
1129
1153
  };
1154
+ system: "mongodb";
1130
1155
  port: number | {
1131
1156
  $env: string;
1132
1157
  };
@@ -1137,9 +1162,7 @@ declare const DbcliConfigSchema: z.ZodObject<{
1137
1162
  $env: string;
1138
1163
  };
1139
1164
  srv: boolean;
1140
- uri?: string | {
1141
- $env: string;
1142
- } | undefined;
1165
+ options?: Record<string, string> | undefined;
1143
1166
  authSource?: string | {
1144
1167
  $env: string;
1145
1168
  } | undefined;
@@ -1147,7 +1170,9 @@ declare const DbcliConfigSchema: z.ZodObject<{
1147
1170
  $env: string;
1148
1171
  } | undefined;
1149
1172
  tls?: boolean | undefined;
1150
- options?: Record<string, string> | undefined;
1173
+ uri?: string | {
1174
+ $env: string;
1175
+ } | undefined;
1151
1176
  timeout?: number | undefined;
1152
1177
  statementTimeout?: number | undefined;
1153
1178
  }, {
@@ -1158,26 +1183,26 @@ declare const DbcliConfigSchema: z.ZodObject<{
1158
1183
  host?: string | {
1159
1184
  $env: string;
1160
1185
  } | undefined;
1161
- port?: number | {
1186
+ options?: Record<string, string> | undefined;
1187
+ authSource?: string | {
1162
1188
  $env: string;
1163
1189
  } | undefined;
1164
- user?: string | {
1190
+ replicaSet?: string | {
1165
1191
  $env: string;
1166
1192
  } | undefined;
1167
- database?: string | {
1193
+ tls?: boolean | undefined;
1194
+ uri?: string | {
1168
1195
  $env: string;
1169
1196
  } | undefined;
1170
- uri?: string | {
1197
+ port?: number | {
1171
1198
  $env: string;
1172
1199
  } | undefined;
1173
- authSource?: string | {
1200
+ user?: string | {
1174
1201
  $env: string;
1175
1202
  } | undefined;
1176
- replicaSet?: string | {
1203
+ database?: string | {
1177
1204
  $env: string;
1178
1205
  } | undefined;
1179
- tls?: boolean | undefined;
1180
- options?: Record<string, string> | undefined;
1181
1206
  srv?: boolean | undefined;
1182
1207
  timeout?: number | undefined;
1183
1208
  statementTimeout?: number | undefined;
@@ -1240,10 +1265,10 @@ declare const DbcliConfigSchema: z.ZodObject<{
1240
1265
  password: string | {
1241
1266
  $env: string;
1242
1267
  };
1243
- system: "redis";
1244
1268
  host: string | {
1245
1269
  $env: string;
1246
1270
  };
1271
+ system: "redis";
1247
1272
  port: number | {
1248
1273
  $env: string;
1249
1274
  };
@@ -1256,10 +1281,10 @@ declare const DbcliConfigSchema: z.ZodObject<{
1256
1281
  timeout?: number | undefined;
1257
1282
  statementTimeout?: number | undefined;
1258
1283
  }, {
1259
- system: "redis";
1260
1284
  host: string | {
1261
1285
  $env: string;
1262
1286
  };
1287
+ system: "redis";
1263
1288
  port: number | {
1264
1289
  $env: string;
1265
1290
  };
@@ -1360,10 +1385,10 @@ declare const DbcliConfigSchema: z.ZodObject<{
1360
1385
  password: string | {
1361
1386
  $env: string;
1362
1387
  };
1363
- system: "elasticsearch";
1364
1388
  host: string | {
1365
1389
  $env: string;
1366
1390
  };
1391
+ system: "elasticsearch";
1367
1392
  port: number | {
1368
1393
  $env: string;
1369
1394
  };
@@ -1373,8 +1398,9 @@ declare const DbcliConfigSchema: z.ZodObject<{
1373
1398
  database: string | {
1374
1399
  $env: string;
1375
1400
  };
1376
- rejectUnauthorized: boolean;
1377
1401
  protocol: "http" | "https";
1402
+ rejectUnauthorized: boolean;
1403
+ caPath?: string | undefined;
1378
1404
  timeout?: number | undefined;
1379
1405
  statementTimeout?: number | undefined;
1380
1406
  nodes?: string[] | undefined;
@@ -1384,7 +1410,6 @@ declare const DbcliConfigSchema: z.ZodObject<{
1384
1410
  apiKey?: string | {
1385
1411
  $env: string;
1386
1412
  } | undefined;
1387
- caPath?: string | undefined;
1388
1413
  }, {
1389
1414
  system: "elasticsearch";
1390
1415
  password?: string | {
@@ -1393,6 +1418,7 @@ declare const DbcliConfigSchema: z.ZodObject<{
1393
1418
  host?: string | {
1394
1419
  $env: string;
1395
1420
  } | undefined;
1421
+ caPath?: string | undefined;
1396
1422
  port?: number | {
1397
1423
  $env: string;
1398
1424
  } | undefined;
@@ -1402,7 +1428,6 @@ declare const DbcliConfigSchema: z.ZodObject<{
1402
1428
  database?: string | {
1403
1429
  $env: string;
1404
1430
  } | undefined;
1405
- rejectUnauthorized?: boolean | undefined;
1406
1431
  timeout?: number | undefined;
1407
1432
  statementTimeout?: number | undefined;
1408
1433
  protocol?: "http" | "https" | undefined;
@@ -1413,9 +1438,133 @@ declare const DbcliConfigSchema: z.ZodObject<{
1413
1438
  apiKey?: string | {
1414
1439
  $env: string;
1415
1440
  } | undefined;
1416
- caPath?: string | undefined;
1441
+ rejectUnauthorized?: boolean | undefined;
1417
1442
  }>
1418
- ]>;
1443
+ ]>, {
1444
+ password: string | {
1445
+ $env: string;
1446
+ };
1447
+ host: string | {
1448
+ $env: string;
1449
+ };
1450
+ system: "mongodb";
1451
+ port: number | {
1452
+ $env: string;
1453
+ };
1454
+ user: string | {
1455
+ $env: string;
1456
+ };
1457
+ database: string | {
1458
+ $env: string;
1459
+ };
1460
+ srv: boolean;
1461
+ options?: Record<string, string> | undefined;
1462
+ authSource?: string | {
1463
+ $env: string;
1464
+ } | undefined;
1465
+ replicaSet?: string | {
1466
+ $env: string;
1467
+ } | undefined;
1468
+ tls?: boolean | undefined;
1469
+ uri?: string | {
1470
+ $env: string;
1471
+ } | undefined;
1472
+ timeout?: number | undefined;
1473
+ statementTimeout?: number | undefined;
1474
+ } | {
1475
+ password: string | {
1476
+ $env: string;
1477
+ };
1478
+ host: string | {
1479
+ $env: string;
1480
+ };
1481
+ system: "postgresql" | "mysql" | "mariadb";
1482
+ port: number | {
1483
+ $env: string;
1484
+ };
1485
+ user: string | {
1486
+ $env: string;
1487
+ };
1488
+ database: string | {
1489
+ $env: string;
1490
+ };
1491
+ timeout?: number | undefined;
1492
+ statementTimeout?: number | undefined;
1493
+ sqlTls?: {
1494
+ mode: "verify-full";
1495
+ caPath: string;
1496
+ } | undefined;
1497
+ } | {
1498
+ password: string | {
1499
+ $env: string;
1500
+ };
1501
+ host: string | {
1502
+ $env: string;
1503
+ };
1504
+ system: "sqlite";
1505
+ port: number | {
1506
+ $env: string;
1507
+ };
1508
+ user: string | {
1509
+ $env: string;
1510
+ };
1511
+ database: string | {
1512
+ $env: string;
1513
+ };
1514
+ file: string | {
1515
+ $env: string;
1516
+ };
1517
+ timeout?: number | undefined;
1518
+ statementTimeout?: number | undefined;
1519
+ } | {
1520
+ password: string | {
1521
+ $env: string;
1522
+ };
1523
+ host: string | {
1524
+ $env: string;
1525
+ };
1526
+ system: "redis";
1527
+ port: number | {
1528
+ $env: string;
1529
+ };
1530
+ user: string | {
1531
+ $env: string;
1532
+ };
1533
+ database: string | {
1534
+ $env: string;
1535
+ };
1536
+ timeout?: number | undefined;
1537
+ statementTimeout?: number | undefined;
1538
+ } | {
1539
+ password: string | {
1540
+ $env: string;
1541
+ };
1542
+ host: string | {
1543
+ $env: string;
1544
+ };
1545
+ system: "elasticsearch";
1546
+ port: number | {
1547
+ $env: string;
1548
+ };
1549
+ user: string | {
1550
+ $env: string;
1551
+ };
1552
+ database: string | {
1553
+ $env: string;
1554
+ };
1555
+ protocol: "http" | "https";
1556
+ rejectUnauthorized: boolean;
1557
+ caPath?: string | undefined;
1558
+ timeout?: number | undefined;
1559
+ statementTimeout?: number | undefined;
1560
+ nodes?: string[] | undefined;
1561
+ cloudId?: string | {
1562
+ $env: string;
1563
+ } | undefined;
1564
+ apiKey?: string | {
1565
+ $env: string;
1566
+ } | undefined;
1567
+ }, unknown>;
1419
1568
  permission: z.ZodDefault<z.ZodEnum<[
1420
1569
  "query-only",
1421
1570
  "read-write",
@@ -1555,15 +1704,14 @@ declare const DbcliConfigSchema: z.ZodObject<{
1555
1704
  max_entries: number;
1556
1705
  };
1557
1706
  };
1558
- permission: "admin" | "query-only" | "read-write" | "data-admin";
1559
1707
  connection: {
1560
1708
  password: string | {
1561
1709
  $env: string;
1562
1710
  };
1563
- system: "mongodb";
1564
1711
  host: string | {
1565
1712
  $env: string;
1566
1713
  };
1714
+ system: "mongodb";
1567
1715
  port: number | {
1568
1716
  $env: string;
1569
1717
  };
@@ -1574,27 +1722,27 @@ declare const DbcliConfigSchema: z.ZodObject<{
1574
1722
  $env: string;
1575
1723
  };
1576
1724
  srv: boolean;
1577
- uri?: string | {
1578
- $env: string;
1579
- } | undefined;
1725
+ options?: Record<string, string> | undefined;
1580
1726
  authSource?: string | {
1581
1727
  $env: string;
1582
1728
  } | undefined;
1583
1729
  replicaSet?: string | {
1584
1730
  $env: string;
1585
1731
  } | undefined;
1586
- tls?: boolean | undefined;
1587
- options?: Record<string, string> | undefined;
1732
+ tls?: boolean | undefined;
1733
+ uri?: string | {
1734
+ $env: string;
1735
+ } | undefined;
1588
1736
  timeout?: number | undefined;
1589
1737
  statementTimeout?: number | undefined;
1590
1738
  } | {
1591
1739
  password: string | {
1592
1740
  $env: string;
1593
1741
  };
1594
- system: "postgresql" | "mysql" | "mariadb";
1595
1742
  host: string | {
1596
1743
  $env: string;
1597
1744
  };
1745
+ system: "postgresql" | "mysql" | "mariadb";
1598
1746
  port: number | {
1599
1747
  $env: string;
1600
1748
  };
@@ -1606,14 +1754,18 @@ declare const DbcliConfigSchema: z.ZodObject<{
1606
1754
  };
1607
1755
  timeout?: number | undefined;
1608
1756
  statementTimeout?: number | undefined;
1757
+ sqlTls?: {
1758
+ mode: "verify-full";
1759
+ caPath: string;
1760
+ } | undefined;
1609
1761
  } | {
1610
1762
  password: string | {
1611
1763
  $env: string;
1612
1764
  };
1613
- system: "sqlite";
1614
1765
  host: string | {
1615
1766
  $env: string;
1616
1767
  };
1768
+ system: "sqlite";
1617
1769
  port: number | {
1618
1770
  $env: string;
1619
1771
  };
@@ -1632,10 +1784,10 @@ declare const DbcliConfigSchema: z.ZodObject<{
1632
1784
  password: string | {
1633
1785
  $env: string;
1634
1786
  };
1635
- system: "redis";
1636
1787
  host: string | {
1637
1788
  $env: string;
1638
1789
  };
1790
+ system: "redis";
1639
1791
  port: number | {
1640
1792
  $env: string;
1641
1793
  };
@@ -1651,10 +1803,10 @@ declare const DbcliConfigSchema: z.ZodObject<{
1651
1803
  password: string | {
1652
1804
  $env: string;
1653
1805
  };
1654
- system: "elasticsearch";
1655
1806
  host: string | {
1656
1807
  $env: string;
1657
1808
  };
1809
+ system: "elasticsearch";
1658
1810
  port: number | {
1659
1811
  $env: string;
1660
1812
  };
@@ -1664,8 +1816,9 @@ declare const DbcliConfigSchema: z.ZodObject<{
1664
1816
  database: string | {
1665
1817
  $env: string;
1666
1818
  };
1667
- rejectUnauthorized: boolean;
1668
1819
  protocol: "http" | "https";
1820
+ rejectUnauthorized: boolean;
1821
+ caPath?: string | undefined;
1669
1822
  timeout?: number | undefined;
1670
1823
  statementTimeout?: number | undefined;
1671
1824
  nodes?: string[] | undefined;
@@ -1675,8 +1828,8 @@ declare const DbcliConfigSchema: z.ZodObject<{
1675
1828
  apiKey?: string | {
1676
1829
  $env: string;
1677
1830
  } | undefined;
1678
- caPath?: string | undefined;
1679
1831
  };
1832
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
1680
1833
  metadata: {
1681
1834
  version: string;
1682
1835
  createdAt?: string | undefined;
@@ -1690,127 +1843,6 @@ declare const DbcliConfigSchema: z.ZodObject<{
1690
1843
  }[];
1691
1844
  } | undefined;
1692
1845
  }, {
1693
- connection: {
1694
- system: "mongodb";
1695
- password?: string | {
1696
- $env: string;
1697
- } | undefined;
1698
- host?: string | {
1699
- $env: string;
1700
- } | undefined;
1701
- port?: number | {
1702
- $env: string;
1703
- } | undefined;
1704
- user?: string | {
1705
- $env: string;
1706
- } | undefined;
1707
- database?: string | {
1708
- $env: string;
1709
- } | undefined;
1710
- uri?: string | {
1711
- $env: string;
1712
- } | undefined;
1713
- authSource?: string | {
1714
- $env: string;
1715
- } | undefined;
1716
- replicaSet?: string | {
1717
- $env: string;
1718
- } | undefined;
1719
- tls?: boolean | undefined;
1720
- options?: Record<string, string> | undefined;
1721
- srv?: boolean | undefined;
1722
- timeout?: number | undefined;
1723
- statementTimeout?: number | undefined;
1724
- } | {
1725
- system: "postgresql" | "mysql" | "mariadb";
1726
- host: string | {
1727
- $env: string;
1728
- };
1729
- port: number | {
1730
- $env: string;
1731
- };
1732
- user: string | {
1733
- $env: string;
1734
- };
1735
- database: string | {
1736
- $env: string;
1737
- };
1738
- password?: string | {
1739
- $env: string;
1740
- } | undefined;
1741
- timeout?: number | undefined;
1742
- statementTimeout?: number | undefined;
1743
- } | {
1744
- system: "sqlite";
1745
- file: string | {
1746
- $env: string;
1747
- };
1748
- password?: string | {
1749
- $env: string;
1750
- } | undefined;
1751
- host?: string | {
1752
- $env: string;
1753
- } | undefined;
1754
- port?: number | {
1755
- $env: string;
1756
- } | undefined;
1757
- user?: string | {
1758
- $env: string;
1759
- } | undefined;
1760
- database?: string | {
1761
- $env: string;
1762
- } | undefined;
1763
- timeout?: number | undefined;
1764
- statementTimeout?: number | undefined;
1765
- } | {
1766
- system: "redis";
1767
- host: string | {
1768
- $env: string;
1769
- };
1770
- port: number | {
1771
- $env: string;
1772
- };
1773
- password?: string | {
1774
- $env: string;
1775
- } | undefined;
1776
- user?: string | {
1777
- $env: string;
1778
- } | undefined;
1779
- database?: string | {
1780
- $env: string;
1781
- } | undefined;
1782
- timeout?: number | undefined;
1783
- statementTimeout?: number | undefined;
1784
- } | {
1785
- system: "elasticsearch";
1786
- password?: string | {
1787
- $env: string;
1788
- } | undefined;
1789
- host?: string | {
1790
- $env: string;
1791
- } | undefined;
1792
- port?: number | {
1793
- $env: string;
1794
- } | undefined;
1795
- user?: string | {
1796
- $env: string;
1797
- } | undefined;
1798
- database?: string | {
1799
- $env: string;
1800
- } | undefined;
1801
- rejectUnauthorized?: boolean | undefined;
1802
- timeout?: number | undefined;
1803
- statementTimeout?: number | undefined;
1804
- protocol?: "http" | "https" | undefined;
1805
- nodes?: string[] | undefined;
1806
- cloudId?: string | {
1807
- $env: string;
1808
- } | undefined;
1809
- apiKey?: string | {
1810
- $env: string;
1811
- } | undefined;
1812
- caPath?: string | undefined;
1813
- };
1814
1846
  redis?: {
1815
1847
  mask?: {
1816
1848
  keyPattern: string;
@@ -1830,7 +1862,8 @@ declare const DbcliConfigSchema: z.ZodObject<{
1830
1862
  max_entries?: number | undefined;
1831
1863
  } | undefined;
1832
1864
  } | undefined;
1833
- permission?: "admin" | "query-only" | "read-write" | "data-admin" | undefined;
1865
+ connection?: unknown;
1866
+ permission?: "query-only" | "read-write" | "data-admin" | "admin" | undefined;
1834
1867
  metadata?: {
1835
1868
  version?: string | undefined;
1836
1869
  createdAt?: string | undefined;
@@ -1849,6 +1882,16 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
1849
1882
  z.ZodObject<{
1850
1883
  timeout: z.ZodOptional<z.ZodNumber>;
1851
1884
  statementTimeout: z.ZodOptional<z.ZodNumber>;
1885
+ sqlTls: z.ZodOptional<z.ZodObject<{
1886
+ mode: z.ZodLiteral<"verify-full">;
1887
+ caPath: z.ZodEffects<z.ZodString, string, string>;
1888
+ }, "strict", z.ZodTypeAny, {
1889
+ mode: "verify-full";
1890
+ caPath: string;
1891
+ }, {
1892
+ mode: "verify-full";
1893
+ caPath: string;
1894
+ }>>;
1852
1895
  system: z.ZodEnum<[
1853
1896
  "postgresql",
1854
1897
  "mysql",
@@ -1917,10 +1960,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
1917
1960
  password: string | {
1918
1961
  $env: string;
1919
1962
  };
1920
- system: "postgresql" | "mysql" | "mariadb";
1921
1963
  host: string | {
1922
1964
  $env: string;
1923
1965
  };
1966
+ system: "postgresql" | "mysql" | "mariadb";
1924
1967
  port: number | {
1925
1968
  $env: string;
1926
1969
  };
@@ -1930,16 +1973,20 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
1930
1973
  database: string | {
1931
1974
  $env: string;
1932
1975
  };
1933
- permission: "admin" | "query-only" | "read-write" | "data-admin";
1976
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
1934
1977
  timeout?: number | undefined;
1935
1978
  statementTimeout?: number | undefined;
1979
+ sqlTls?: {
1980
+ mode: "verify-full";
1981
+ caPath: string;
1982
+ } | undefined;
1936
1983
  envFile?: string | undefined;
1937
1984
  environment?: string | undefined;
1938
1985
  }, {
1939
- system: "postgresql" | "mysql" | "mariadb";
1940
1986
  host: string | {
1941
1987
  $env: string;
1942
1988
  };
1989
+ system: "postgresql" | "mysql" | "mariadb";
1943
1990
  port: number | {
1944
1991
  $env: string;
1945
1992
  };
@@ -1953,8 +2000,12 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
1953
2000
  $env: string;
1954
2001
  } | undefined;
1955
2002
  timeout?: number | undefined;
1956
- permission?: "admin" | "query-only" | "read-write" | "data-admin" | undefined;
1957
2003
  statementTimeout?: number | undefined;
2004
+ sqlTls?: {
2005
+ mode: "verify-full";
2006
+ caPath: string;
2007
+ } | undefined;
2008
+ permission?: "query-only" | "read-write" | "data-admin" | "admin" | undefined;
1958
2009
  envFile?: string | undefined;
1959
2010
  environment?: string | undefined;
1960
2011
  }>,
@@ -2039,10 +2090,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2039
2090
  password: string | {
2040
2091
  $env: string;
2041
2092
  };
2042
- system: "sqlite";
2043
2093
  host: string | {
2044
2094
  $env: string;
2045
2095
  };
2096
+ system: "sqlite";
2046
2097
  port: number | {
2047
2098
  $env: string;
2048
2099
  };
@@ -2055,7 +2106,7 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2055
2106
  file: string | {
2056
2107
  $env: string;
2057
2108
  };
2058
- permission: "admin" | "query-only" | "read-write" | "data-admin";
2109
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2059
2110
  timeout?: number | undefined;
2060
2111
  statementTimeout?: number | undefined;
2061
2112
  envFile?: string | undefined;
@@ -2081,8 +2132,8 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2081
2132
  $env: string;
2082
2133
  } | undefined;
2083
2134
  timeout?: number | undefined;
2084
- permission?: "admin" | "query-only" | "read-write" | "data-admin" | undefined;
2085
2135
  statementTimeout?: number | undefined;
2136
+ permission?: "query-only" | "read-write" | "data-admin" | "admin" | undefined;
2086
2137
  envFile?: string | undefined;
2087
2138
  environment?: string | undefined;
2088
2139
  }>,
@@ -2186,10 +2237,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2186
2237
  password: string | {
2187
2238
  $env: string;
2188
2239
  };
2189
- system: "mongodb";
2190
2240
  host: string | {
2191
2241
  $env: string;
2192
2242
  };
2243
+ system: "mongodb";
2193
2244
  port: number | {
2194
2245
  $env: string;
2195
2246
  };
@@ -2200,10 +2251,8 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2200
2251
  $env: string;
2201
2252
  };
2202
2253
  srv: boolean;
2203
- permission: "admin" | "query-only" | "read-write" | "data-admin";
2204
- uri?: string | {
2205
- $env: string;
2206
- } | undefined;
2254
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2255
+ options?: Record<string, string> | undefined;
2207
2256
  authSource?: string | {
2208
2257
  $env: string;
2209
2258
  } | undefined;
@@ -2211,7 +2260,9 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2211
2260
  $env: string;
2212
2261
  } | undefined;
2213
2262
  tls?: boolean | undefined;
2214
- options?: Record<string, string> | undefined;
2263
+ uri?: string | {
2264
+ $env: string;
2265
+ } | undefined;
2215
2266
  timeout?: number | undefined;
2216
2267
  statementTimeout?: number | undefined;
2217
2268
  envFile?: string | undefined;
@@ -2224,30 +2275,30 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2224
2275
  host?: string | {
2225
2276
  $env: string;
2226
2277
  } | undefined;
2227
- port?: number | {
2278
+ options?: Record<string, string> | undefined;
2279
+ authSource?: string | {
2228
2280
  $env: string;
2229
2281
  } | undefined;
2230
- user?: string | {
2282
+ replicaSet?: string | {
2231
2283
  $env: string;
2232
2284
  } | undefined;
2233
- database?: string | {
2285
+ tls?: boolean | undefined;
2286
+ uri?: string | {
2234
2287
  $env: string;
2235
2288
  } | undefined;
2236
- uri?: string | {
2289
+ port?: number | {
2237
2290
  $env: string;
2238
2291
  } | undefined;
2239
- authSource?: string | {
2292
+ user?: string | {
2240
2293
  $env: string;
2241
2294
  } | undefined;
2242
- replicaSet?: string | {
2295
+ database?: string | {
2243
2296
  $env: string;
2244
2297
  } | undefined;
2245
- tls?: boolean | undefined;
2246
- options?: Record<string, string> | undefined;
2247
2298
  srv?: boolean | undefined;
2248
2299
  timeout?: number | undefined;
2249
- permission?: "admin" | "query-only" | "read-write" | "data-admin" | undefined;
2250
2300
  statementTimeout?: number | undefined;
2301
+ permission?: "query-only" | "read-write" | "data-admin" | "admin" | undefined;
2251
2302
  envFile?: string | undefined;
2252
2303
  environment?: string | undefined;
2253
2304
  }>,
@@ -2318,10 +2369,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2318
2369
  password: string | {
2319
2370
  $env: string;
2320
2371
  };
2321
- system: "redis";
2322
2372
  host: string | {
2323
2373
  $env: string;
2324
2374
  };
2375
+ system: "redis";
2325
2376
  port: number | {
2326
2377
  $env: string;
2327
2378
  };
@@ -2331,16 +2382,16 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2331
2382
  database: string | {
2332
2383
  $env: string;
2333
2384
  };
2334
- permission: "admin" | "query-only" | "read-write" | "data-admin";
2385
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2335
2386
  timeout?: number | undefined;
2336
2387
  statementTimeout?: number | undefined;
2337
2388
  envFile?: string | undefined;
2338
2389
  environment?: string | undefined;
2339
2390
  }, {
2340
- system: "redis";
2341
2391
  host: string | {
2342
2392
  $env: string;
2343
2393
  };
2394
+ system: "redis";
2344
2395
  port: number | {
2345
2396
  $env: string;
2346
2397
  };
@@ -2354,8 +2405,8 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2354
2405
  $env: string;
2355
2406
  } | undefined;
2356
2407
  timeout?: number | undefined;
2357
- permission?: "admin" | "query-only" | "read-write" | "data-admin" | undefined;
2358
2408
  statementTimeout?: number | undefined;
2409
+ permission?: "query-only" | "read-write" | "data-admin" | "admin" | undefined;
2359
2410
  envFile?: string | undefined;
2360
2411
  environment?: string | undefined;
2361
2412
  }>,
@@ -2453,10 +2504,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2453
2504
  password: string | {
2454
2505
  $env: string;
2455
2506
  };
2456
- system: "elasticsearch";
2457
2507
  host: string | {
2458
2508
  $env: string;
2459
2509
  };
2510
+ system: "elasticsearch";
2460
2511
  port: number | {
2461
2512
  $env: string;
2462
2513
  };
@@ -2466,9 +2517,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2466
2517
  database: string | {
2467
2518
  $env: string;
2468
2519
  };
2469
- rejectUnauthorized: boolean;
2470
- permission: "admin" | "query-only" | "read-write" | "data-admin";
2471
2520
  protocol: "http" | "https";
2521
+ rejectUnauthorized: boolean;
2522
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2523
+ caPath?: string | undefined;
2472
2524
  timeout?: number | undefined;
2473
2525
  statementTimeout?: number | undefined;
2474
2526
  nodes?: string[] | undefined;
@@ -2478,7 +2530,6 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2478
2530
  apiKey?: string | {
2479
2531
  $env: string;
2480
2532
  } | undefined;
2481
- caPath?: string | undefined;
2482
2533
  envFile?: string | undefined;
2483
2534
  environment?: string | undefined;
2484
2535
  }, {
@@ -2489,6 +2540,7 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2489
2540
  host?: string | {
2490
2541
  $env: string;
2491
2542
  } | undefined;
2543
+ caPath?: string | undefined;
2492
2544
  port?: number | {
2493
2545
  $env: string;
2494
2546
  } | undefined;
@@ -2498,9 +2550,7 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2498
2550
  database?: string | {
2499
2551
  $env: string;
2500
2552
  } | undefined;
2501
- rejectUnauthorized?: boolean | undefined;
2502
2553
  timeout?: number | undefined;
2503
- permission?: "admin" | "query-only" | "read-write" | "data-admin" | undefined;
2504
2554
  statementTimeout?: number | undefined;
2505
2555
  protocol?: "http" | "https" | undefined;
2506
2556
  nodes?: string[] | undefined;
@@ -2510,7 +2560,8 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2510
2560
  apiKey?: string | {
2511
2561
  $env: string;
2512
2562
  } | undefined;
2513
- caPath?: string | undefined;
2563
+ rejectUnauthorized?: boolean | undefined;
2564
+ permission?: "query-only" | "read-write" | "data-admin" | "admin" | undefined;
2514
2565
  envFile?: string | undefined;
2515
2566
  environment?: string | undefined;
2516
2567
  }>
@@ -2518,10 +2569,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2518
2569
  password: string | {
2519
2570
  $env: string;
2520
2571
  };
2521
- system: "postgresql" | "mysql" | "mariadb";
2522
2572
  host: string | {
2523
2573
  $env: string;
2524
2574
  };
2575
+ system: "postgresql" | "mysql" | "mariadb";
2525
2576
  port: number | {
2526
2577
  $env: string;
2527
2578
  };
@@ -2531,19 +2582,23 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2531
2582
  database: string | {
2532
2583
  $env: string;
2533
2584
  };
2534
- permission: "admin" | "query-only" | "read-write" | "data-admin";
2585
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2535
2586
  timeout?: number | undefined;
2536
2587
  statementTimeout?: number | undefined;
2588
+ sqlTls?: {
2589
+ mode: "verify-full";
2590
+ caPath: string;
2591
+ } | undefined;
2537
2592
  envFile?: string | undefined;
2538
2593
  environment?: string | undefined;
2539
2594
  } | {
2540
2595
  password: string | {
2541
2596
  $env: string;
2542
2597
  };
2543
- system: "sqlite";
2544
2598
  host: string | {
2545
2599
  $env: string;
2546
2600
  };
2601
+ system: "sqlite";
2547
2602
  port: number | {
2548
2603
  $env: string;
2549
2604
  };
@@ -2556,7 +2611,7 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2556
2611
  file: string | {
2557
2612
  $env: string;
2558
2613
  };
2559
- permission: "admin" | "query-only" | "read-write" | "data-admin";
2614
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2560
2615
  timeout?: number | undefined;
2561
2616
  statementTimeout?: number | undefined;
2562
2617
  envFile?: string | undefined;
@@ -2565,10 +2620,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2565
2620
  password: string | {
2566
2621
  $env: string;
2567
2622
  };
2568
- system: "mongodb";
2569
2623
  host: string | {
2570
2624
  $env: string;
2571
2625
  };
2626
+ system: "mongodb";
2572
2627
  port: number | {
2573
2628
  $env: string;
2574
2629
  };
@@ -2579,10 +2634,8 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2579
2634
  $env: string;
2580
2635
  };
2581
2636
  srv: boolean;
2582
- permission: "admin" | "query-only" | "read-write" | "data-admin";
2583
- uri?: string | {
2584
- $env: string;
2585
- } | undefined;
2637
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2638
+ options?: Record<string, string> | undefined;
2586
2639
  authSource?: string | {
2587
2640
  $env: string;
2588
2641
  } | undefined;
@@ -2590,7 +2643,9 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2590
2643
  $env: string;
2591
2644
  } | undefined;
2592
2645
  tls?: boolean | undefined;
2593
- options?: Record<string, string> | undefined;
2646
+ uri?: string | {
2647
+ $env: string;
2648
+ } | undefined;
2594
2649
  timeout?: number | undefined;
2595
2650
  statementTimeout?: number | undefined;
2596
2651
  envFile?: string | undefined;
@@ -2599,10 +2654,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2599
2654
  password: string | {
2600
2655
  $env: string;
2601
2656
  };
2602
- system: "redis";
2603
2657
  host: string | {
2604
2658
  $env: string;
2605
2659
  };
2660
+ system: "redis";
2606
2661
  port: number | {
2607
2662
  $env: string;
2608
2663
  };
@@ -2612,7 +2667,7 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2612
2667
  database: string | {
2613
2668
  $env: string;
2614
2669
  };
2615
- permission: "admin" | "query-only" | "read-write" | "data-admin";
2670
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2616
2671
  timeout?: number | undefined;
2617
2672
  statementTimeout?: number | undefined;
2618
2673
  envFile?: string | undefined;
@@ -2621,10 +2676,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2621
2676
  password: string | {
2622
2677
  $env: string;
2623
2678
  };
2624
- system: "elasticsearch";
2625
2679
  host: string | {
2626
2680
  $env: string;
2627
2681
  };
2682
+ system: "elasticsearch";
2628
2683
  port: number | {
2629
2684
  $env: string;
2630
2685
  };
@@ -2634,9 +2689,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2634
2689
  database: string | {
2635
2690
  $env: string;
2636
2691
  };
2637
- rejectUnauthorized: boolean;
2638
- permission: "admin" | "query-only" | "read-write" | "data-admin";
2639
2692
  protocol: "http" | "https";
2693
+ rejectUnauthorized: boolean;
2694
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2695
+ caPath?: string | undefined;
2640
2696
  timeout?: number | undefined;
2641
2697
  statementTimeout?: number | undefined;
2642
2698
  nodes?: string[] | undefined;
@@ -2646,17 +2702,16 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2646
2702
  apiKey?: string | {
2647
2703
  $env: string;
2648
2704
  } | undefined;
2649
- caPath?: string | undefined;
2650
2705
  envFile?: string | undefined;
2651
2706
  environment?: string | undefined;
2652
2707
  }, unknown>>, Record<string, {
2653
2708
  password: string | {
2654
2709
  $env: string;
2655
2710
  };
2656
- system: "postgresql" | "mysql" | "mariadb";
2657
2711
  host: string | {
2658
2712
  $env: string;
2659
2713
  };
2714
+ system: "postgresql" | "mysql" | "mariadb";
2660
2715
  port: number | {
2661
2716
  $env: string;
2662
2717
  };
@@ -2666,19 +2721,23 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2666
2721
  database: string | {
2667
2722
  $env: string;
2668
2723
  };
2669
- permission: "admin" | "query-only" | "read-write" | "data-admin";
2724
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2670
2725
  timeout?: number | undefined;
2671
2726
  statementTimeout?: number | undefined;
2727
+ sqlTls?: {
2728
+ mode: "verify-full";
2729
+ caPath: string;
2730
+ } | undefined;
2672
2731
  envFile?: string | undefined;
2673
2732
  environment?: string | undefined;
2674
2733
  } | {
2675
2734
  password: string | {
2676
2735
  $env: string;
2677
2736
  };
2678
- system: "sqlite";
2679
2737
  host: string | {
2680
2738
  $env: string;
2681
2739
  };
2740
+ system: "sqlite";
2682
2741
  port: number | {
2683
2742
  $env: string;
2684
2743
  };
@@ -2691,7 +2750,7 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2691
2750
  file: string | {
2692
2751
  $env: string;
2693
2752
  };
2694
- permission: "admin" | "query-only" | "read-write" | "data-admin";
2753
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2695
2754
  timeout?: number | undefined;
2696
2755
  statementTimeout?: number | undefined;
2697
2756
  envFile?: string | undefined;
@@ -2700,10 +2759,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2700
2759
  password: string | {
2701
2760
  $env: string;
2702
2761
  };
2703
- system: "mongodb";
2704
2762
  host: string | {
2705
2763
  $env: string;
2706
2764
  };
2765
+ system: "mongodb";
2707
2766
  port: number | {
2708
2767
  $env: string;
2709
2768
  };
@@ -2714,10 +2773,8 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2714
2773
  $env: string;
2715
2774
  };
2716
2775
  srv: boolean;
2717
- permission: "admin" | "query-only" | "read-write" | "data-admin";
2718
- uri?: string | {
2719
- $env: string;
2720
- } | undefined;
2776
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2777
+ options?: Record<string, string> | undefined;
2721
2778
  authSource?: string | {
2722
2779
  $env: string;
2723
2780
  } | undefined;
@@ -2725,7 +2782,9 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2725
2782
  $env: string;
2726
2783
  } | undefined;
2727
2784
  tls?: boolean | undefined;
2728
- options?: Record<string, string> | undefined;
2785
+ uri?: string | {
2786
+ $env: string;
2787
+ } | undefined;
2729
2788
  timeout?: number | undefined;
2730
2789
  statementTimeout?: number | undefined;
2731
2790
  envFile?: string | undefined;
@@ -2734,10 +2793,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2734
2793
  password: string | {
2735
2794
  $env: string;
2736
2795
  };
2737
- system: "redis";
2738
2796
  host: string | {
2739
2797
  $env: string;
2740
2798
  };
2799
+ system: "redis";
2741
2800
  port: number | {
2742
2801
  $env: string;
2743
2802
  };
@@ -2747,7 +2806,7 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2747
2806
  database: string | {
2748
2807
  $env: string;
2749
2808
  };
2750
- permission: "admin" | "query-only" | "read-write" | "data-admin";
2809
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2751
2810
  timeout?: number | undefined;
2752
2811
  statementTimeout?: number | undefined;
2753
2812
  envFile?: string | undefined;
@@ -2756,10 +2815,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2756
2815
  password: string | {
2757
2816
  $env: string;
2758
2817
  };
2759
- system: "elasticsearch";
2760
2818
  host: string | {
2761
2819
  $env: string;
2762
2820
  };
2821
+ system: "elasticsearch";
2763
2822
  port: number | {
2764
2823
  $env: string;
2765
2824
  };
@@ -2769,9 +2828,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2769
2828
  database: string | {
2770
2829
  $env: string;
2771
2830
  };
2772
- rejectUnauthorized: boolean;
2773
- permission: "admin" | "query-only" | "read-write" | "data-admin";
2774
2831
  protocol: "http" | "https";
2832
+ rejectUnauthorized: boolean;
2833
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2834
+ caPath?: string | undefined;
2775
2835
  timeout?: number | undefined;
2776
2836
  statementTimeout?: number | undefined;
2777
2837
  nodes?: string[] | undefined;
@@ -2781,7 +2841,6 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2781
2841
  apiKey?: string | {
2782
2842
  $env: string;
2783
2843
  } | undefined;
2784
- caPath?: string | undefined;
2785
2844
  envFile?: string | undefined;
2786
2845
  environment?: string | undefined;
2787
2846
  }>, Record<string, unknown>>;
@@ -2930,10 +2989,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2930
2989
  password: string | {
2931
2990
  $env: string;
2932
2991
  };
2933
- system: "postgresql" | "mysql" | "mariadb";
2934
2992
  host: string | {
2935
2993
  $env: string;
2936
2994
  };
2995
+ system: "postgresql" | "mysql" | "mariadb";
2937
2996
  port: number | {
2938
2997
  $env: string;
2939
2998
  };
@@ -2943,19 +3002,23 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2943
3002
  database: string | {
2944
3003
  $env: string;
2945
3004
  };
2946
- permission: "admin" | "query-only" | "read-write" | "data-admin";
3005
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2947
3006
  timeout?: number | undefined;
2948
3007
  statementTimeout?: number | undefined;
3008
+ sqlTls?: {
3009
+ mode: "verify-full";
3010
+ caPath: string;
3011
+ } | undefined;
2949
3012
  envFile?: string | undefined;
2950
3013
  environment?: string | undefined;
2951
3014
  } | {
2952
3015
  password: string | {
2953
3016
  $env: string;
2954
3017
  };
2955
- system: "sqlite";
2956
3018
  host: string | {
2957
3019
  $env: string;
2958
3020
  };
3021
+ system: "sqlite";
2959
3022
  port: number | {
2960
3023
  $env: string;
2961
3024
  };
@@ -2968,7 +3031,7 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2968
3031
  file: string | {
2969
3032
  $env: string;
2970
3033
  };
2971
- permission: "admin" | "query-only" | "read-write" | "data-admin";
3034
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
2972
3035
  timeout?: number | undefined;
2973
3036
  statementTimeout?: number | undefined;
2974
3037
  envFile?: string | undefined;
@@ -2977,10 +3040,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2977
3040
  password: string | {
2978
3041
  $env: string;
2979
3042
  };
2980
- system: "mongodb";
2981
3043
  host: string | {
2982
3044
  $env: string;
2983
3045
  };
3046
+ system: "mongodb";
2984
3047
  port: number | {
2985
3048
  $env: string;
2986
3049
  };
@@ -2991,10 +3054,8 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
2991
3054
  $env: string;
2992
3055
  };
2993
3056
  srv: boolean;
2994
- permission: "admin" | "query-only" | "read-write" | "data-admin";
2995
- uri?: string | {
2996
- $env: string;
2997
- } | undefined;
3057
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
3058
+ options?: Record<string, string> | undefined;
2998
3059
  authSource?: string | {
2999
3060
  $env: string;
3000
3061
  } | undefined;
@@ -3002,7 +3063,9 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3002
3063
  $env: string;
3003
3064
  } | undefined;
3004
3065
  tls?: boolean | undefined;
3005
- options?: Record<string, string> | undefined;
3066
+ uri?: string | {
3067
+ $env: string;
3068
+ } | undefined;
3006
3069
  timeout?: number | undefined;
3007
3070
  statementTimeout?: number | undefined;
3008
3071
  envFile?: string | undefined;
@@ -3011,10 +3074,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3011
3074
  password: string | {
3012
3075
  $env: string;
3013
3076
  };
3014
- system: "redis";
3015
3077
  host: string | {
3016
3078
  $env: string;
3017
3079
  };
3080
+ system: "redis";
3018
3081
  port: number | {
3019
3082
  $env: string;
3020
3083
  };
@@ -3024,7 +3087,7 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3024
3087
  database: string | {
3025
3088
  $env: string;
3026
3089
  };
3027
- permission: "admin" | "query-only" | "read-write" | "data-admin";
3090
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
3028
3091
  timeout?: number | undefined;
3029
3092
  statementTimeout?: number | undefined;
3030
3093
  envFile?: string | undefined;
@@ -3033,10 +3096,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3033
3096
  password: string | {
3034
3097
  $env: string;
3035
3098
  };
3036
- system: "elasticsearch";
3037
3099
  host: string | {
3038
3100
  $env: string;
3039
3101
  };
3102
+ system: "elasticsearch";
3040
3103
  port: number | {
3041
3104
  $env: string;
3042
3105
  };
@@ -3046,9 +3109,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3046
3109
  database: string | {
3047
3110
  $env: string;
3048
3111
  };
3049
- rejectUnauthorized: boolean;
3050
- permission: "admin" | "query-only" | "read-write" | "data-admin";
3051
3112
  protocol: "http" | "https";
3113
+ rejectUnauthorized: boolean;
3114
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
3115
+ caPath?: string | undefined;
3052
3116
  timeout?: number | undefined;
3053
3117
  statementTimeout?: number | undefined;
3054
3118
  nodes?: string[] | undefined;
@@ -3058,7 +3122,6 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3058
3122
  apiKey?: string | {
3059
3123
  $env: string;
3060
3124
  } | undefined;
3061
- caPath?: string | undefined;
3062
3125
  envFile?: string | undefined;
3063
3126
  environment?: string | undefined;
3064
3127
  }>;
@@ -3125,10 +3188,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3125
3188
  password: string | {
3126
3189
  $env: string;
3127
3190
  };
3128
- system: "postgresql" | "mysql" | "mariadb";
3129
3191
  host: string | {
3130
3192
  $env: string;
3131
3193
  };
3194
+ system: "postgresql" | "mysql" | "mariadb";
3132
3195
  port: number | {
3133
3196
  $env: string;
3134
3197
  };
@@ -3138,19 +3201,23 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3138
3201
  database: string | {
3139
3202
  $env: string;
3140
3203
  };
3141
- permission: "admin" | "query-only" | "read-write" | "data-admin";
3204
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
3142
3205
  timeout?: number | undefined;
3143
3206
  statementTimeout?: number | undefined;
3207
+ sqlTls?: {
3208
+ mode: "verify-full";
3209
+ caPath: string;
3210
+ } | undefined;
3144
3211
  envFile?: string | undefined;
3145
3212
  environment?: string | undefined;
3146
3213
  } | {
3147
3214
  password: string | {
3148
3215
  $env: string;
3149
3216
  };
3150
- system: "sqlite";
3151
3217
  host: string | {
3152
3218
  $env: string;
3153
3219
  };
3220
+ system: "sqlite";
3154
3221
  port: number | {
3155
3222
  $env: string;
3156
3223
  };
@@ -3163,7 +3230,7 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3163
3230
  file: string | {
3164
3231
  $env: string;
3165
3232
  };
3166
- permission: "admin" | "query-only" | "read-write" | "data-admin";
3233
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
3167
3234
  timeout?: number | undefined;
3168
3235
  statementTimeout?: number | undefined;
3169
3236
  envFile?: string | undefined;
@@ -3172,10 +3239,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3172
3239
  password: string | {
3173
3240
  $env: string;
3174
3241
  };
3175
- system: "mongodb";
3176
3242
  host: string | {
3177
3243
  $env: string;
3178
3244
  };
3245
+ system: "mongodb";
3179
3246
  port: number | {
3180
3247
  $env: string;
3181
3248
  };
@@ -3186,10 +3253,8 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3186
3253
  $env: string;
3187
3254
  };
3188
3255
  srv: boolean;
3189
- permission: "admin" | "query-only" | "read-write" | "data-admin";
3190
- uri?: string | {
3191
- $env: string;
3192
- } | undefined;
3256
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
3257
+ options?: Record<string, string> | undefined;
3193
3258
  authSource?: string | {
3194
3259
  $env: string;
3195
3260
  } | undefined;
@@ -3197,7 +3262,9 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3197
3262
  $env: string;
3198
3263
  } | undefined;
3199
3264
  tls?: boolean | undefined;
3200
- options?: Record<string, string> | undefined;
3265
+ uri?: string | {
3266
+ $env: string;
3267
+ } | undefined;
3201
3268
  timeout?: number | undefined;
3202
3269
  statementTimeout?: number | undefined;
3203
3270
  envFile?: string | undefined;
@@ -3206,10 +3273,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3206
3273
  password: string | {
3207
3274
  $env: string;
3208
3275
  };
3209
- system: "redis";
3210
3276
  host: string | {
3211
3277
  $env: string;
3212
3278
  };
3279
+ system: "redis";
3213
3280
  port: number | {
3214
3281
  $env: string;
3215
3282
  };
@@ -3219,7 +3286,7 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3219
3286
  database: string | {
3220
3287
  $env: string;
3221
3288
  };
3222
- permission: "admin" | "query-only" | "read-write" | "data-admin";
3289
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
3223
3290
  timeout?: number | undefined;
3224
3291
  statementTimeout?: number | undefined;
3225
3292
  envFile?: string | undefined;
@@ -3228,10 +3295,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3228
3295
  password: string | {
3229
3296
  $env: string;
3230
3297
  };
3231
- system: "elasticsearch";
3232
3298
  host: string | {
3233
3299
  $env: string;
3234
3300
  };
3301
+ system: "elasticsearch";
3235
3302
  port: number | {
3236
3303
  $env: string;
3237
3304
  };
@@ -3241,9 +3308,10 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3241
3308
  database: string | {
3242
3309
  $env: string;
3243
3310
  };
3244
- rejectUnauthorized: boolean;
3245
- permission: "admin" | "query-only" | "read-write" | "data-admin";
3246
3311
  protocol: "http" | "https";
3312
+ rejectUnauthorized: boolean;
3313
+ permission: "query-only" | "read-write" | "data-admin" | "admin";
3314
+ caPath?: string | undefined;
3247
3315
  timeout?: number | undefined;
3248
3316
  statementTimeout?: number | undefined;
3249
3317
  nodes?: string[] | undefined;
@@ -3253,7 +3321,6 @@ declare const DbcliConfigV2Schema: z.ZodEffects<z.ZodObject<{
3253
3321
  apiKey?: string | {
3254
3322
  $env: string;
3255
3323
  } | undefined;
3256
- caPath?: string | undefined;
3257
3324
  envFile?: string | undefined;
3258
3325
  environment?: string | undefined;
3259
3326
  }>;