@agentforge/tools 0.16.38 → 0.16.40
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/index.cjs +356 -419
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -162
- package/dist/index.d.ts +17 -162
- package/dist/index.js +356 -419
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -4984,20 +4984,8 @@ interface ReconnectionConfig {
|
|
|
4984
4984
|
maxDelayMs: number;
|
|
4985
4985
|
}
|
|
4986
4986
|
|
|
4987
|
-
/**
|
|
4988
|
-
* Connection manager for relational databases using Drizzle ORM
|
|
4989
|
-
* @module connection/connection-manager
|
|
4990
|
-
*/
|
|
4991
|
-
|
|
4992
|
-
/**
|
|
4993
|
-
* Connection lifecycle events
|
|
4994
|
-
*/
|
|
4995
4987
|
type ConnectionEvent = 'connected' | 'disconnected' | 'error' | 'reconnecting';
|
|
4996
4988
|
|
|
4997
|
-
/**
|
|
4998
|
-
* Connection manager that handles database connections for PostgreSQL, MySQL, and SQLite
|
|
4999
|
-
* using Drizzle ORM with lifecycle management and automatic reconnection
|
|
5000
|
-
*/
|
|
5001
4989
|
declare class ConnectionManager extends EventEmitter implements DatabaseConnection {
|
|
5002
4990
|
private vendor;
|
|
5003
4991
|
private db;
|
|
@@ -5009,139 +4997,26 @@ declare class ConnectionManager extends EventEmitter implements DatabaseConnecti
|
|
|
5009
4997
|
private reconnectionTimer;
|
|
5010
4998
|
private connectPromise;
|
|
5011
4999
|
private connectionGeneration;
|
|
5012
|
-
/**
|
|
5013
|
-
* Create a new ConnectionManager instance
|
|
5014
|
-
* @param config - Connection configuration
|
|
5015
|
-
* @param reconnectionConfig - Optional reconnection configuration
|
|
5016
|
-
*/
|
|
5017
5000
|
constructor(config: ConnectionConfig, reconnectionConfig?: Partial<ReconnectionConfig>);
|
|
5018
|
-
/**
|
|
5019
|
-
* Connect to the database
|
|
5020
|
-
* Initializes the connection and sets up automatic reconnection if configured
|
|
5021
|
-
* @throws {Error} If connection fails or configuration is invalid
|
|
5022
|
-
*/
|
|
5023
5001
|
connect(): Promise<void>;
|
|
5024
|
-
/**
|
|
5025
|
-
* Disconnect from the database
|
|
5026
|
-
* Closes the connection and cancels any pending reconnection attempts
|
|
5027
|
-
*
|
|
5028
|
-
* Note: Event listeners are NOT removed by this method. If you need to dispose
|
|
5029
|
-
* of the ConnectionManager instance entirely, call dispose() instead.
|
|
5030
|
-
*/
|
|
5031
5002
|
disconnect(): Promise<void>;
|
|
5032
|
-
/**
|
|
5033
|
-
* Dispose of the ConnectionManager instance
|
|
5034
|
-
* Disconnects and removes all event listeners
|
|
5035
|
-
* Call this when you're done with the ConnectionManager and won't reuse it
|
|
5036
|
-
*/
|
|
5037
5003
|
dispose(): Promise<void>;
|
|
5038
|
-
/**
|
|
5039
|
-
* Check if the connection is currently connected
|
|
5040
|
-
* @returns true if connected, false otherwise
|
|
5041
|
-
*/
|
|
5042
5004
|
isConnected(): boolean;
|
|
5043
|
-
/**
|
|
5044
|
-
* Get the current connection state
|
|
5045
|
-
* @returns Current connection state
|
|
5046
|
-
*/
|
|
5047
5005
|
getState(): ConnectionState;
|
|
5048
|
-
/**
|
|
5049
|
-
* Get the configured database vendor.
|
|
5050
|
-
*/
|
|
5051
5006
|
getVendor(): DatabaseVendor;
|
|
5052
|
-
/**
|
|
5053
|
-
* Initialize the database connection
|
|
5054
|
-
*
|
|
5055
|
-
* This method is public to maintain compatibility with the DatabaseConnection interface
|
|
5056
|
-
* and existing code (e.g., relational-query.ts). For new code, prefer using connect()
|
|
5057
|
-
* which provides lifecycle management and automatic reconnection.
|
|
5058
|
-
*
|
|
5059
|
-
* @throws {Error} If connection fails or configuration is invalid
|
|
5060
|
-
*/
|
|
5061
5007
|
initialize(): Promise<void>;
|
|
5062
|
-
/**
|
|
5063
|
-
* Set the connection state and log the change
|
|
5064
|
-
* @param newState - New connection state
|
|
5065
|
-
* @private
|
|
5066
|
-
*/
|
|
5067
5008
|
private setState;
|
|
5068
|
-
/**
|
|
5069
|
-
* Schedule a reconnection attempt with exponential backoff
|
|
5070
|
-
* @private
|
|
5071
|
-
*/
|
|
5072
5009
|
private scheduleReconnection;
|
|
5073
|
-
|
|
5074
|
-
* Determine whether an error thrown by drizzle-orm's better-sqlite3 adapter
|
|
5075
|
-
* `.all()` indicates the statement does not return data (i.e. it is DML/DDL,
|
|
5076
|
-
* not a SELECT).
|
|
5077
|
-
*
|
|
5078
|
-
* The adapter may surface this as either a native `SqliteError` or a
|
|
5079
|
-
* `TypeError` depending on the drizzle-orm / better-sqlite3 version, so we
|
|
5080
|
-
* accept both types while still requiring the distinctive message substring
|
|
5081
|
-
* to avoid false positives from unrelated errors.
|
|
5082
|
-
*/
|
|
5083
|
-
private isSqliteNonQueryError;
|
|
5084
|
-
/**
|
|
5085
|
-
* Execute a SQL query
|
|
5086
|
-
*
|
|
5087
|
-
* Executes a parameterized SQL query using Drizzle's SQL template objects.
|
|
5088
|
-
* This method provides safe parameter binding to prevent SQL injection.
|
|
5089
|
-
*
|
|
5090
|
-
* @param query - Drizzle SQL template object with parameter binding
|
|
5091
|
-
* @returns Query result
|
|
5092
|
-
*
|
|
5093
|
-
* @example
|
|
5094
|
-
* ```typescript
|
|
5095
|
-
* import { sql } from 'drizzle-orm';
|
|
5096
|
-
*
|
|
5097
|
-
* const result = await manager.execute(
|
|
5098
|
-
* sql`SELECT * FROM users WHERE id = ${userId}`
|
|
5099
|
-
* );
|
|
5100
|
-
* ```
|
|
5101
|
-
*/
|
|
5010
|
+
private createRuntimeAdapter;
|
|
5102
5011
|
execute(query: SQL): Promise<unknown>;
|
|
5103
|
-
/**
|
|
5104
|
-
* Execute a callback with a single dedicated database connection/session.
|
|
5105
|
-
*
|
|
5106
|
-
* This is required for multi-statement transactions so all statements run on
|
|
5107
|
-
* the same underlying connection.
|
|
5108
|
-
*/
|
|
5109
5012
|
executeInConnection<T>(callback: (execute: (query: SQL) => Promise<unknown>) => Promise<T>): Promise<T>;
|
|
5110
|
-
/**
|
|
5111
|
-
* Get connection pool metrics
|
|
5112
|
-
*
|
|
5113
|
-
* Returns information about the current state of the connection pool.
|
|
5114
|
-
* For SQLite, returns basic connection status since it uses a single connection.
|
|
5115
|
-
*
|
|
5116
|
-
* @returns Pool metrics including total, active, idle, and waiting connections
|
|
5117
|
-
*/
|
|
5118
5013
|
getPoolMetrics(): {
|
|
5119
5014
|
totalCount: number;
|
|
5120
5015
|
activeCount: number;
|
|
5121
5016
|
idleCount: number;
|
|
5122
5017
|
waitingCount: number;
|
|
5123
5018
|
};
|
|
5124
|
-
/**
|
|
5125
|
-
* Close the database connection
|
|
5126
|
-
*
|
|
5127
|
-
* This method is public to maintain compatibility with the DatabaseConnection interface
|
|
5128
|
-
* and existing code (e.g., relational-query.ts). For new code, prefer using disconnect()
|
|
5129
|
-
* for connection lifecycle management. Note that disconnect() does NOT clean up event
|
|
5130
|
-
* listeners; call dispose() if you need full cleanup including listener removal.
|
|
5131
|
-
*
|
|
5132
|
-
* Note: This method coordinates with in-flight connect()/initialize() operations
|
|
5133
|
-
* and cancels pending reconnection timers to prevent unexpected reconnections.
|
|
5134
|
-
*/
|
|
5135
5019
|
close(): Promise<void>;
|
|
5136
|
-
/**
|
|
5137
|
-
* Clean up resources when a connection is cancelled during initialization
|
|
5138
|
-
* This prevents connection leaks when disconnect() is called while initialize() is in-flight
|
|
5139
|
-
*/
|
|
5140
|
-
private cleanupCancelledConnection;
|
|
5141
|
-
/**
|
|
5142
|
-
* Check if the connection is healthy
|
|
5143
|
-
* @returns true if connection is healthy, false otherwise
|
|
5144
|
-
*/
|
|
5145
5020
|
isHealthy(): Promise<boolean>;
|
|
5146
5021
|
}
|
|
5147
5022
|
|
|
@@ -5230,11 +5105,6 @@ interface QueryExecutionContext {
|
|
|
5230
5105
|
*/
|
|
5231
5106
|
declare function executeQuery(manager: ConnectionManager, input: QueryInput, context?: QueryExecutionContext): Promise<QueryExecutionResult>;
|
|
5232
5107
|
|
|
5233
|
-
/**
|
|
5234
|
-
* Query builder helpers for relational CRUD operations.
|
|
5235
|
-
* @module query/query-builder
|
|
5236
|
-
*/
|
|
5237
|
-
|
|
5238
5108
|
/**
|
|
5239
5109
|
* Supported scalar values for INSERT payloads.
|
|
5240
5110
|
*/
|
|
@@ -5277,10 +5147,6 @@ interface BuiltInsertQuery {
|
|
|
5277
5147
|
idColumn: string;
|
|
5278
5148
|
supportsReturning: boolean;
|
|
5279
5149
|
}
|
|
5280
|
-
/**
|
|
5281
|
-
* Build a safe parameterized INSERT query from structured input.
|
|
5282
|
-
*/
|
|
5283
|
-
declare function buildInsertQuery(input: InsertQueryInput): BuiltInsertQuery;
|
|
5284
5150
|
/**
|
|
5285
5151
|
* Supported scalar values for UPDATE payloads.
|
|
5286
5152
|
*/
|
|
@@ -5290,17 +5156,19 @@ type UpdateValue = InsertValue;
|
|
|
5290
5156
|
*/
|
|
5291
5157
|
type UpdateData = Record<string, UpdateValue>;
|
|
5292
5158
|
/**
|
|
5293
|
-
* WHERE operator types
|
|
5159
|
+
* WHERE operator types shared by UPDATE/DELETE/SELECT conditions.
|
|
5294
5160
|
*/
|
|
5295
5161
|
type UpdateWhereOperator = 'eq' | 'ne' | 'gt' | 'lt' | 'gte' | 'lte' | 'like' | 'in' | 'notIn' | 'isNull' | 'isNotNull';
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
*/
|
|
5299
|
-
interface UpdateWhereCondition {
|
|
5162
|
+
type WhereConditionValue = string | number | boolean | null | Array<string | number>;
|
|
5163
|
+
interface BaseWhereCondition {
|
|
5300
5164
|
column: string;
|
|
5301
5165
|
operator: UpdateWhereOperator;
|
|
5302
|
-
value?:
|
|
5166
|
+
value?: WhereConditionValue;
|
|
5303
5167
|
}
|
|
5168
|
+
/**
|
|
5169
|
+
* WHERE condition for UPDATE queries.
|
|
5170
|
+
*/
|
|
5171
|
+
type UpdateWhereCondition = BaseWhereCondition;
|
|
5304
5172
|
/**
|
|
5305
5173
|
* Optional optimistic lock condition appended to WHERE.
|
|
5306
5174
|
*/
|
|
@@ -5330,11 +5198,7 @@ interface BuiltUpdateQuery {
|
|
|
5330
5198
|
/**
|
|
5331
5199
|
* WHERE condition for DELETE queries.
|
|
5332
5200
|
*/
|
|
5333
|
-
|
|
5334
|
-
column: string;
|
|
5335
|
-
operator: UpdateWhereOperator;
|
|
5336
|
-
value?: string | number | boolean | null | Array<string | number>;
|
|
5337
|
-
}
|
|
5201
|
+
type DeleteWhereCondition = BaseWhereCondition;
|
|
5338
5202
|
/**
|
|
5339
5203
|
* Soft-delete configuration.
|
|
5340
5204
|
*/
|
|
@@ -5361,14 +5225,6 @@ interface BuiltDeleteQuery {
|
|
|
5361
5225
|
usesSoftDelete: boolean;
|
|
5362
5226
|
softDeleteColumn?: string;
|
|
5363
5227
|
}
|
|
5364
|
-
/**
|
|
5365
|
-
* Build a safe parameterized UPDATE query from structured input.
|
|
5366
|
-
*/
|
|
5367
|
-
declare function buildUpdateQuery(input: UpdateQueryInput): BuiltUpdateQuery;
|
|
5368
|
-
/**
|
|
5369
|
-
* Build a safe parameterized DELETE query from structured input.
|
|
5370
|
-
*/
|
|
5371
|
-
declare function buildDeleteQuery(input: DeleteQueryInput): BuiltDeleteQuery;
|
|
5372
5228
|
/**
|
|
5373
5229
|
* ORDER BY direction for SELECT queries.
|
|
5374
5230
|
*/
|
|
@@ -5383,11 +5239,7 @@ interface SelectOrderBy {
|
|
|
5383
5239
|
/**
|
|
5384
5240
|
* WHERE condition for SELECT queries.
|
|
5385
5241
|
*/
|
|
5386
|
-
|
|
5387
|
-
column: string;
|
|
5388
|
-
operator: UpdateWhereOperator;
|
|
5389
|
-
value?: string | number | boolean | null | Array<string | number>;
|
|
5390
|
-
}
|
|
5242
|
+
type SelectWhereCondition = BaseWhereCondition;
|
|
5391
5243
|
/**
|
|
5392
5244
|
* Builder input for SELECT queries.
|
|
5393
5245
|
*/
|
|
@@ -5400,9 +5252,12 @@ interface SelectQueryInput {
|
|
|
5400
5252
|
offset?: number;
|
|
5401
5253
|
vendor: DatabaseVendor;
|
|
5402
5254
|
}
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5255
|
+
|
|
5256
|
+
declare function buildInsertQuery(input: InsertQueryInput): BuiltInsertQuery;
|
|
5257
|
+
|
|
5258
|
+
declare function buildUpdateQuery(input: UpdateQueryInput): BuiltUpdateQuery;
|
|
5259
|
+
declare function buildDeleteQuery(input: DeleteQueryInput): BuiltDeleteQuery;
|
|
5260
|
+
|
|
5406
5261
|
declare function buildSelectQuery(input: SelectQueryInput): SQL;
|
|
5407
5262
|
|
|
5408
5263
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -4984,20 +4984,8 @@ interface ReconnectionConfig {
|
|
|
4984
4984
|
maxDelayMs: number;
|
|
4985
4985
|
}
|
|
4986
4986
|
|
|
4987
|
-
/**
|
|
4988
|
-
* Connection manager for relational databases using Drizzle ORM
|
|
4989
|
-
* @module connection/connection-manager
|
|
4990
|
-
*/
|
|
4991
|
-
|
|
4992
|
-
/**
|
|
4993
|
-
* Connection lifecycle events
|
|
4994
|
-
*/
|
|
4995
4987
|
type ConnectionEvent = 'connected' | 'disconnected' | 'error' | 'reconnecting';
|
|
4996
4988
|
|
|
4997
|
-
/**
|
|
4998
|
-
* Connection manager that handles database connections for PostgreSQL, MySQL, and SQLite
|
|
4999
|
-
* using Drizzle ORM with lifecycle management and automatic reconnection
|
|
5000
|
-
*/
|
|
5001
4989
|
declare class ConnectionManager extends EventEmitter implements DatabaseConnection {
|
|
5002
4990
|
private vendor;
|
|
5003
4991
|
private db;
|
|
@@ -5009,139 +4997,26 @@ declare class ConnectionManager extends EventEmitter implements DatabaseConnecti
|
|
|
5009
4997
|
private reconnectionTimer;
|
|
5010
4998
|
private connectPromise;
|
|
5011
4999
|
private connectionGeneration;
|
|
5012
|
-
/**
|
|
5013
|
-
* Create a new ConnectionManager instance
|
|
5014
|
-
* @param config - Connection configuration
|
|
5015
|
-
* @param reconnectionConfig - Optional reconnection configuration
|
|
5016
|
-
*/
|
|
5017
5000
|
constructor(config: ConnectionConfig, reconnectionConfig?: Partial<ReconnectionConfig>);
|
|
5018
|
-
/**
|
|
5019
|
-
* Connect to the database
|
|
5020
|
-
* Initializes the connection and sets up automatic reconnection if configured
|
|
5021
|
-
* @throws {Error} If connection fails or configuration is invalid
|
|
5022
|
-
*/
|
|
5023
5001
|
connect(): Promise<void>;
|
|
5024
|
-
/**
|
|
5025
|
-
* Disconnect from the database
|
|
5026
|
-
* Closes the connection and cancels any pending reconnection attempts
|
|
5027
|
-
*
|
|
5028
|
-
* Note: Event listeners are NOT removed by this method. If you need to dispose
|
|
5029
|
-
* of the ConnectionManager instance entirely, call dispose() instead.
|
|
5030
|
-
*/
|
|
5031
5002
|
disconnect(): Promise<void>;
|
|
5032
|
-
/**
|
|
5033
|
-
* Dispose of the ConnectionManager instance
|
|
5034
|
-
* Disconnects and removes all event listeners
|
|
5035
|
-
* Call this when you're done with the ConnectionManager and won't reuse it
|
|
5036
|
-
*/
|
|
5037
5003
|
dispose(): Promise<void>;
|
|
5038
|
-
/**
|
|
5039
|
-
* Check if the connection is currently connected
|
|
5040
|
-
* @returns true if connected, false otherwise
|
|
5041
|
-
*/
|
|
5042
5004
|
isConnected(): boolean;
|
|
5043
|
-
/**
|
|
5044
|
-
* Get the current connection state
|
|
5045
|
-
* @returns Current connection state
|
|
5046
|
-
*/
|
|
5047
5005
|
getState(): ConnectionState;
|
|
5048
|
-
/**
|
|
5049
|
-
* Get the configured database vendor.
|
|
5050
|
-
*/
|
|
5051
5006
|
getVendor(): DatabaseVendor;
|
|
5052
|
-
/**
|
|
5053
|
-
* Initialize the database connection
|
|
5054
|
-
*
|
|
5055
|
-
* This method is public to maintain compatibility with the DatabaseConnection interface
|
|
5056
|
-
* and existing code (e.g., relational-query.ts). For new code, prefer using connect()
|
|
5057
|
-
* which provides lifecycle management and automatic reconnection.
|
|
5058
|
-
*
|
|
5059
|
-
* @throws {Error} If connection fails or configuration is invalid
|
|
5060
|
-
*/
|
|
5061
5007
|
initialize(): Promise<void>;
|
|
5062
|
-
/**
|
|
5063
|
-
* Set the connection state and log the change
|
|
5064
|
-
* @param newState - New connection state
|
|
5065
|
-
* @private
|
|
5066
|
-
*/
|
|
5067
5008
|
private setState;
|
|
5068
|
-
/**
|
|
5069
|
-
* Schedule a reconnection attempt with exponential backoff
|
|
5070
|
-
* @private
|
|
5071
|
-
*/
|
|
5072
5009
|
private scheduleReconnection;
|
|
5073
|
-
|
|
5074
|
-
* Determine whether an error thrown by drizzle-orm's better-sqlite3 adapter
|
|
5075
|
-
* `.all()` indicates the statement does not return data (i.e. it is DML/DDL,
|
|
5076
|
-
* not a SELECT).
|
|
5077
|
-
*
|
|
5078
|
-
* The adapter may surface this as either a native `SqliteError` or a
|
|
5079
|
-
* `TypeError` depending on the drizzle-orm / better-sqlite3 version, so we
|
|
5080
|
-
* accept both types while still requiring the distinctive message substring
|
|
5081
|
-
* to avoid false positives from unrelated errors.
|
|
5082
|
-
*/
|
|
5083
|
-
private isSqliteNonQueryError;
|
|
5084
|
-
/**
|
|
5085
|
-
* Execute a SQL query
|
|
5086
|
-
*
|
|
5087
|
-
* Executes a parameterized SQL query using Drizzle's SQL template objects.
|
|
5088
|
-
* This method provides safe parameter binding to prevent SQL injection.
|
|
5089
|
-
*
|
|
5090
|
-
* @param query - Drizzle SQL template object with parameter binding
|
|
5091
|
-
* @returns Query result
|
|
5092
|
-
*
|
|
5093
|
-
* @example
|
|
5094
|
-
* ```typescript
|
|
5095
|
-
* import { sql } from 'drizzle-orm';
|
|
5096
|
-
*
|
|
5097
|
-
* const result = await manager.execute(
|
|
5098
|
-
* sql`SELECT * FROM users WHERE id = ${userId}`
|
|
5099
|
-
* );
|
|
5100
|
-
* ```
|
|
5101
|
-
*/
|
|
5010
|
+
private createRuntimeAdapter;
|
|
5102
5011
|
execute(query: SQL): Promise<unknown>;
|
|
5103
|
-
/**
|
|
5104
|
-
* Execute a callback with a single dedicated database connection/session.
|
|
5105
|
-
*
|
|
5106
|
-
* This is required for multi-statement transactions so all statements run on
|
|
5107
|
-
* the same underlying connection.
|
|
5108
|
-
*/
|
|
5109
5012
|
executeInConnection<T>(callback: (execute: (query: SQL) => Promise<unknown>) => Promise<T>): Promise<T>;
|
|
5110
|
-
/**
|
|
5111
|
-
* Get connection pool metrics
|
|
5112
|
-
*
|
|
5113
|
-
* Returns information about the current state of the connection pool.
|
|
5114
|
-
* For SQLite, returns basic connection status since it uses a single connection.
|
|
5115
|
-
*
|
|
5116
|
-
* @returns Pool metrics including total, active, idle, and waiting connections
|
|
5117
|
-
*/
|
|
5118
5013
|
getPoolMetrics(): {
|
|
5119
5014
|
totalCount: number;
|
|
5120
5015
|
activeCount: number;
|
|
5121
5016
|
idleCount: number;
|
|
5122
5017
|
waitingCount: number;
|
|
5123
5018
|
};
|
|
5124
|
-
/**
|
|
5125
|
-
* Close the database connection
|
|
5126
|
-
*
|
|
5127
|
-
* This method is public to maintain compatibility with the DatabaseConnection interface
|
|
5128
|
-
* and existing code (e.g., relational-query.ts). For new code, prefer using disconnect()
|
|
5129
|
-
* for connection lifecycle management. Note that disconnect() does NOT clean up event
|
|
5130
|
-
* listeners; call dispose() if you need full cleanup including listener removal.
|
|
5131
|
-
*
|
|
5132
|
-
* Note: This method coordinates with in-flight connect()/initialize() operations
|
|
5133
|
-
* and cancels pending reconnection timers to prevent unexpected reconnections.
|
|
5134
|
-
*/
|
|
5135
5019
|
close(): Promise<void>;
|
|
5136
|
-
/**
|
|
5137
|
-
* Clean up resources when a connection is cancelled during initialization
|
|
5138
|
-
* This prevents connection leaks when disconnect() is called while initialize() is in-flight
|
|
5139
|
-
*/
|
|
5140
|
-
private cleanupCancelledConnection;
|
|
5141
|
-
/**
|
|
5142
|
-
* Check if the connection is healthy
|
|
5143
|
-
* @returns true if connection is healthy, false otherwise
|
|
5144
|
-
*/
|
|
5145
5020
|
isHealthy(): Promise<boolean>;
|
|
5146
5021
|
}
|
|
5147
5022
|
|
|
@@ -5230,11 +5105,6 @@ interface QueryExecutionContext {
|
|
|
5230
5105
|
*/
|
|
5231
5106
|
declare function executeQuery(manager: ConnectionManager, input: QueryInput, context?: QueryExecutionContext): Promise<QueryExecutionResult>;
|
|
5232
5107
|
|
|
5233
|
-
/**
|
|
5234
|
-
* Query builder helpers for relational CRUD operations.
|
|
5235
|
-
* @module query/query-builder
|
|
5236
|
-
*/
|
|
5237
|
-
|
|
5238
5108
|
/**
|
|
5239
5109
|
* Supported scalar values for INSERT payloads.
|
|
5240
5110
|
*/
|
|
@@ -5277,10 +5147,6 @@ interface BuiltInsertQuery {
|
|
|
5277
5147
|
idColumn: string;
|
|
5278
5148
|
supportsReturning: boolean;
|
|
5279
5149
|
}
|
|
5280
|
-
/**
|
|
5281
|
-
* Build a safe parameterized INSERT query from structured input.
|
|
5282
|
-
*/
|
|
5283
|
-
declare function buildInsertQuery(input: InsertQueryInput): BuiltInsertQuery;
|
|
5284
5150
|
/**
|
|
5285
5151
|
* Supported scalar values for UPDATE payloads.
|
|
5286
5152
|
*/
|
|
@@ -5290,17 +5156,19 @@ type UpdateValue = InsertValue;
|
|
|
5290
5156
|
*/
|
|
5291
5157
|
type UpdateData = Record<string, UpdateValue>;
|
|
5292
5158
|
/**
|
|
5293
|
-
* WHERE operator types
|
|
5159
|
+
* WHERE operator types shared by UPDATE/DELETE/SELECT conditions.
|
|
5294
5160
|
*/
|
|
5295
5161
|
type UpdateWhereOperator = 'eq' | 'ne' | 'gt' | 'lt' | 'gte' | 'lte' | 'like' | 'in' | 'notIn' | 'isNull' | 'isNotNull';
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
*/
|
|
5299
|
-
interface UpdateWhereCondition {
|
|
5162
|
+
type WhereConditionValue = string | number | boolean | null | Array<string | number>;
|
|
5163
|
+
interface BaseWhereCondition {
|
|
5300
5164
|
column: string;
|
|
5301
5165
|
operator: UpdateWhereOperator;
|
|
5302
|
-
value?:
|
|
5166
|
+
value?: WhereConditionValue;
|
|
5303
5167
|
}
|
|
5168
|
+
/**
|
|
5169
|
+
* WHERE condition for UPDATE queries.
|
|
5170
|
+
*/
|
|
5171
|
+
type UpdateWhereCondition = BaseWhereCondition;
|
|
5304
5172
|
/**
|
|
5305
5173
|
* Optional optimistic lock condition appended to WHERE.
|
|
5306
5174
|
*/
|
|
@@ -5330,11 +5198,7 @@ interface BuiltUpdateQuery {
|
|
|
5330
5198
|
/**
|
|
5331
5199
|
* WHERE condition for DELETE queries.
|
|
5332
5200
|
*/
|
|
5333
|
-
|
|
5334
|
-
column: string;
|
|
5335
|
-
operator: UpdateWhereOperator;
|
|
5336
|
-
value?: string | number | boolean | null | Array<string | number>;
|
|
5337
|
-
}
|
|
5201
|
+
type DeleteWhereCondition = BaseWhereCondition;
|
|
5338
5202
|
/**
|
|
5339
5203
|
* Soft-delete configuration.
|
|
5340
5204
|
*/
|
|
@@ -5361,14 +5225,6 @@ interface BuiltDeleteQuery {
|
|
|
5361
5225
|
usesSoftDelete: boolean;
|
|
5362
5226
|
softDeleteColumn?: string;
|
|
5363
5227
|
}
|
|
5364
|
-
/**
|
|
5365
|
-
* Build a safe parameterized UPDATE query from structured input.
|
|
5366
|
-
*/
|
|
5367
|
-
declare function buildUpdateQuery(input: UpdateQueryInput): BuiltUpdateQuery;
|
|
5368
|
-
/**
|
|
5369
|
-
* Build a safe parameterized DELETE query from structured input.
|
|
5370
|
-
*/
|
|
5371
|
-
declare function buildDeleteQuery(input: DeleteQueryInput): BuiltDeleteQuery;
|
|
5372
5228
|
/**
|
|
5373
5229
|
* ORDER BY direction for SELECT queries.
|
|
5374
5230
|
*/
|
|
@@ -5383,11 +5239,7 @@ interface SelectOrderBy {
|
|
|
5383
5239
|
/**
|
|
5384
5240
|
* WHERE condition for SELECT queries.
|
|
5385
5241
|
*/
|
|
5386
|
-
|
|
5387
|
-
column: string;
|
|
5388
|
-
operator: UpdateWhereOperator;
|
|
5389
|
-
value?: string | number | boolean | null | Array<string | number>;
|
|
5390
|
-
}
|
|
5242
|
+
type SelectWhereCondition = BaseWhereCondition;
|
|
5391
5243
|
/**
|
|
5392
5244
|
* Builder input for SELECT queries.
|
|
5393
5245
|
*/
|
|
@@ -5400,9 +5252,12 @@ interface SelectQueryInput {
|
|
|
5400
5252
|
offset?: number;
|
|
5401
5253
|
vendor: DatabaseVendor;
|
|
5402
5254
|
}
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5255
|
+
|
|
5256
|
+
declare function buildInsertQuery(input: InsertQueryInput): BuiltInsertQuery;
|
|
5257
|
+
|
|
5258
|
+
declare function buildUpdateQuery(input: UpdateQueryInput): BuiltUpdateQuery;
|
|
5259
|
+
declare function buildDeleteQuery(input: DeleteQueryInput): BuiltDeleteQuery;
|
|
5260
|
+
|
|
5406
5261
|
declare function buildSelectQuery(input: SelectQueryInput): SQL;
|
|
5407
5262
|
|
|
5408
5263
|
/**
|