@bernierllc/database-adapter-core 3.0.1 → 3.0.2

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.
Files changed (58) hide show
  1. package/package.json +3 -3
  2. package/dist/base/BaseDatabaseAdapter.d.ts +0 -34
  3. package/dist/base/BaseDatabaseAdapter.d.ts.map +0 -1
  4. package/dist/base/BaseDatabaseAdapter.js +0 -53
  5. package/dist/base/BaseMigrationManager.d.ts +0 -41
  6. package/dist/base/BaseMigrationManager.d.ts.map +0 -1
  7. package/dist/base/BaseMigrationManager.js +0 -115
  8. package/dist/base/BaseQueryBuilder.d.ts +0 -68
  9. package/dist/base/BaseQueryBuilder.d.ts.map +0 -1
  10. package/dist/base/BaseQueryBuilder.js +0 -103
  11. package/dist/base/BaseTransaction.d.ts +0 -13
  12. package/dist/base/BaseTransaction.d.ts.map +0 -1
  13. package/dist/base/BaseTransaction.js +0 -17
  14. package/dist/base/index.d.ts +0 -5
  15. package/dist/base/index.d.ts.map +0 -1
  16. package/dist/base/index.js +0 -27
  17. package/dist/errors.d.ts +0 -53
  18. package/dist/errors.d.ts.map +0 -1
  19. package/dist/errors.js +0 -58
  20. package/dist/index.d.ts +0 -11
  21. package/dist/index.d.ts.map +0 -1
  22. package/dist/index.js +0 -37
  23. package/dist/interfaces/IConnectionPool.d.ts +0 -41
  24. package/dist/interfaces/IConnectionPool.d.ts.map +0 -1
  25. package/dist/interfaces/IConnectionPool.js +0 -9
  26. package/dist/interfaces/IDatabaseAdapter.d.ts +0 -45
  27. package/dist/interfaces/IDatabaseAdapter.d.ts.map +0 -1
  28. package/dist/interfaces/IDatabaseAdapter.js +0 -9
  29. package/dist/interfaces/IDatabaseConfig.d.ts +0 -40
  30. package/dist/interfaces/IDatabaseConfig.d.ts.map +0 -1
  31. package/dist/interfaces/IDatabaseConfig.js +0 -9
  32. package/dist/interfaces/IDatabaseHealth.d.ts +0 -16
  33. package/dist/interfaces/IDatabaseHealth.d.ts.map +0 -1
  34. package/dist/interfaces/IDatabaseHealth.js +0 -9
  35. package/dist/interfaces/IMigration.d.ts +0 -54
  36. package/dist/interfaces/IMigration.d.ts.map +0 -1
  37. package/dist/interfaces/IMigration.js +0 -9
  38. package/dist/interfaces/IQueryBuilder.d.ts +0 -106
  39. package/dist/interfaces/IQueryBuilder.d.ts.map +0 -1
  40. package/dist/interfaces/IQueryBuilder.js +0 -9
  41. package/dist/interfaces/IQueryResult.d.ts +0 -28
  42. package/dist/interfaces/IQueryResult.d.ts.map +0 -1
  43. package/dist/interfaces/IQueryResult.js +0 -9
  44. package/dist/interfaces/IRLSContext.d.ts +0 -15
  45. package/dist/interfaces/IRLSContext.d.ts.map +0 -1
  46. package/dist/interfaces/IRLSContext.js +0 -9
  47. package/dist/interfaces/ITransaction.d.ts +0 -50
  48. package/dist/interfaces/ITransaction.d.ts.map +0 -1
  49. package/dist/interfaces/ITransaction.js +0 -9
  50. package/dist/interfaces/index.d.ts +0 -10
  51. package/dist/interfaces/index.d.ts.map +0 -1
  52. package/dist/interfaces/index.js +0 -32
  53. package/dist/rls/RLSContextManager.d.ts +0 -45
  54. package/dist/rls/RLSContextManager.d.ts.map +0 -1
  55. package/dist/rls/RLSContextManager.js +0 -86
  56. package/dist/rls/index.d.ts +0 -2
  57. package/dist/rls/index.d.ts.map +0 -1
  58. package/dist/rls/index.js +0 -24
package/dist/index.js DELETED
@@ -1,37 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
22
- };
23
- Object.defineProperty(exports, "__esModule", { value: true });
24
- /**
25
- * @bernierllc/database-adapter-core
26
- *
27
- * Abstract Database Interface for MECE Architecture
28
- * Provides database-agnostic interfaces and base implementations for all database operations
29
- */
30
- // Interfaces
31
- __exportStar(require("./interfaces"), exports);
32
- // Base classes
33
- __exportStar(require("./base"), exports);
34
- // RLS support
35
- __exportStar(require("./rls"), exports);
36
- // Errors
37
- __exportStar(require("./errors"), exports);
@@ -1,41 +0,0 @@
1
- import { IDatabaseAdapter } from './IDatabaseAdapter';
2
- /**
3
- * Connection pool statistics
4
- */
5
- export interface IPoolStats {
6
- /** Total number of connections in pool */
7
- totalConnections: number;
8
- /** Number of active (in-use) connections */
9
- activeConnections: number;
10
- /** Number of idle (available) connections */
11
- idleConnections: number;
12
- /** Number of requests waiting for a connection */
13
- waitingRequests: number;
14
- }
15
- /**
16
- * Connection pool interface
17
- * Manages database connection lifecycle
18
- */
19
- export interface IConnectionPool {
20
- /**
21
- * Acquire a connection from the pool
22
- * @returns Database adapter connection
23
- * @throws Error if pool is exhausted or timeout occurs
24
- */
25
- acquire(): Promise<IDatabaseAdapter>;
26
- /**
27
- * Return a connection to the pool
28
- * @param connection - Connection to release
29
- */
30
- release(connection: IDatabaseAdapter): Promise<void>;
31
- /**
32
- * Close all connections in the pool
33
- */
34
- closeAll(): Promise<void>;
35
- /**
36
- * Get pool statistics
37
- * @returns Current pool statistics
38
- */
39
- stats(): IPoolStats;
40
- }
41
- //# sourceMappingURL=IConnectionPool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IConnectionPool.d.ts","sourceRoot":"","sources":["../../src/interfaces/IConnectionPool.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,gBAAgB,EAAE,MAAM,CAAC;IAEzB,4CAA4C;IAC5C,iBAAiB,EAAE,MAAM,CAAC;IAE1B,6CAA6C;IAC7C,eAAe,EAAE,MAAM,CAAC;IAExB,kDAAkD;IAClD,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,OAAO,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAErC;;;OAGG;IACH,OAAO,CAAC,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErD;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;OAGG;IACH,KAAK,IAAI,UAAU,CAAC;CACrB"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,45 +0,0 @@
1
- import { ITransaction } from './ITransaction';
2
- import { IQueryResult } from './IQueryResult';
3
- import { IDatabaseHealth } from './IDatabaseHealth';
4
- /**
5
- * Abstract database adapter interface
6
- * All concrete database adapters MUST implement this interface
7
- */
8
- export interface IDatabaseAdapter {
9
- /**
10
- * Connect to database
11
- * @throws ConnectionError if connection fails
12
- */
13
- connect(): Promise<void>;
14
- /**
15
- * Disconnect from database
16
- * @throws Error if disconnection fails
17
- */
18
- disconnect(): Promise<void>;
19
- /**
20
- * Check if database is connected
21
- * @returns true if connected
22
- */
23
- isConnected(): boolean;
24
- /**
25
- * Begin a new transaction
26
- * @returns Transaction instance
27
- * @throws Error if not connected or transaction creation fails
28
- */
29
- beginTransaction(): Promise<ITransaction>;
30
- /**
31
- * Execute a query
32
- * @template T - Type of rows returned
33
- * @param sql - SQL query string
34
- * @param params - Query parameters
35
- * @returns Query result with rows and metadata
36
- * @throws QueryError if query fails
37
- */
38
- query<T = any>(sql: string, params?: any[]): Promise<IQueryResult<T>>;
39
- /**
40
- * Check database health
41
- * @returns Health status including connection state, latency, and version
42
- */
43
- healthCheck(): Promise<IDatabaseHealth>;
44
- }
45
- //# sourceMappingURL=IDatabaseAdapter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IDatabaseAdapter.d.ts","sourceRoot":"","sources":["../../src/interfaces/IDatabaseAdapter.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzB;;;OAGG;IACH,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5B;;;OAGG;IACH,WAAW,IAAI,OAAO,CAAC;IAEvB;;;;OAIG;IACH,gBAAgB,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IAE1C;;;;;;;OAOG;IACH,KAAK,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtE;;;OAGG;IACH,WAAW,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;CACzC"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,40 +0,0 @@
1
- /**
2
- * Database connection configuration
3
- */
4
- export interface IDatabaseConfig {
5
- /** Database type */
6
- type: 'postgresql' | 'mysql' | 'sqlite' | 'mssql';
7
- /** Host address (not required for SQLite) */
8
- host?: string;
9
- /** Port number (not required for SQLite) */
10
- port?: number;
11
- /** Database name or file path (for SQLite) */
12
- database: string;
13
- /** Username for authentication */
14
- username?: string;
15
- /** Password for authentication */
16
- password?: string;
17
- /** SSL configuration */
18
- ssl?: boolean | {
19
- /** CA certificate */
20
- ca?: string;
21
- /** Client certificate */
22
- cert?: string;
23
- /** Client key */
24
- key?: string;
25
- };
26
- /** Connection pooling configuration */
27
- pooling?: {
28
- /** Minimum number of connections in pool */
29
- min: number;
30
- /** Maximum number of connections in pool */
31
- max: number;
32
- /** Time in ms before idle connection is closed */
33
- idleTimeoutMs: number;
34
- };
35
- /** Connection timeout in milliseconds */
36
- connectionTimeoutMs?: number;
37
- /** Query timeout in milliseconds */
38
- queryTimeoutMs?: number;
39
- }
40
- //# sourceMappingURL=IDatabaseConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IDatabaseConfig.d.ts","sourceRoot":"","sources":["../../src/interfaces/IDatabaseConfig.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oBAAoB;IACpB,IAAI,EAAE,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAElD,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IAEjB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,wBAAwB;IACxB,GAAG,CAAC,EAAE,OAAO,GAAG;QACd,qBAAqB;QACrB,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,yBAAyB;QACzB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,iBAAiB;QACjB,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,uCAAuC;IACvC,OAAO,CAAC,EAAE;QACR,4CAA4C;QAC5C,GAAG,EAAE,MAAM,CAAC;QACZ,4CAA4C;QAC5C,GAAG,EAAE,MAAM,CAAC;QACZ,kDAAkD;QAClD,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;IAEF,yCAAyC;IACzC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,oCAAoC;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,16 +0,0 @@
1
- /**
2
- * Database health status information
3
- */
4
- export interface IDatabaseHealth {
5
- /** Whether database is connected */
6
- connected: boolean;
7
- /** Query latency in milliseconds */
8
- latencyMs: number;
9
- /** Database version string */
10
- version: string;
11
- /** Number of active connections (optional) */
12
- activeConnections?: number;
13
- /** Maximum allowed connections (optional) */
14
- maxConnections?: number;
15
- }
16
- //# sourceMappingURL=IDatabaseHealth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IDatabaseHealth.d.ts","sourceRoot":"","sources":["../../src/interfaces/IDatabaseHealth.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oCAAoC;IACpC,SAAS,EAAE,OAAO,CAAC;IAEnB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAElB,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAEhB,8CAA8C;IAC9C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,54 +0,0 @@
1
- import { IDatabaseAdapter } from './IDatabaseAdapter';
2
- /**
3
- * Database migration interface
4
- */
5
- export interface IMigration {
6
- /** Unique migration identifier */
7
- id: string;
8
- /** Human-readable migration name */
9
- name: string;
10
- /**
11
- * Apply migration (upgrade schema)
12
- * @param adapter - Database adapter to use
13
- */
14
- up(adapter: IDatabaseAdapter): Promise<void>;
15
- /**
16
- * Revert migration (downgrade schema)
17
- * @param adapter - Database adapter to use
18
- */
19
- down(adapter: IDatabaseAdapter): Promise<void>;
20
- }
21
- /**
22
- * Migration status information
23
- */
24
- export interface IMigrationStatus {
25
- /** Migration ID */
26
- id: string;
27
- /** Migration name */
28
- name: string;
29
- /** When migration was applied (null if not applied) */
30
- appliedAt: Date | null;
31
- /** Migration status */
32
- status: 'pending' | 'applied' | 'failed';
33
- }
34
- /**
35
- * Migration manager interface
36
- */
37
- export interface IMigrationManager {
38
- /**
39
- * Run all pending migrations
40
- * @throws Error if any migration fails
41
- */
42
- up(): Promise<void>;
43
- /**
44
- * Rollback last applied migration
45
- * @throws Error if no migrations to rollback or rollback fails
46
- */
47
- down(): Promise<void>;
48
- /**
49
- * Get status of all migrations
50
- * @returns Array of migration statuses
51
- */
52
- status(): Promise<IMigrationStatus[]>;
53
- }
54
- //# sourceMappingURL=IMigration.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IMigration.d.ts","sourceRoot":"","sources":["../../src/interfaces/IMigration.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IAEX,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,EAAE,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;;OAGG;IACH,IAAI,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mBAAmB;IACnB,EAAE,EAAE,MAAM,CAAC;IAEX,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IAEb,uDAAuD;IACvD,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAEvB,uBAAuB;IACvB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpB;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtB;;;OAGG;IACH,MAAM,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;CACvC"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,106 +0,0 @@
1
- import { IDatabaseAdapter } from './IDatabaseAdapter';
2
- import { IQueryResult } from './IQueryResult';
3
- /**
4
- * Abstract query builder interface
5
- * Enables type-safe SQL generation without string concatenation
6
- * @template T - Type of entity being queried
7
- */
8
- export interface IQueryBuilder<T = any> {
9
- /**
10
- * Select specific columns
11
- * @param columns - Column names to select
12
- * @returns Query builder for chaining
13
- */
14
- select(...columns: string[]): IQueryBuilder<T>;
15
- /**
16
- * Specify table to query from
17
- * @param table - Table name
18
- * @returns Query builder for chaining
19
- */
20
- from(table: string): IQueryBuilder<T>;
21
- /**
22
- * Add WHERE condition
23
- * @param condition - SQL condition string
24
- * @param params - Parameters for parameterized query
25
- * @returns Query builder for chaining
26
- */
27
- where(condition: string, params?: any[]): IQueryBuilder<T>;
28
- /**
29
- * Add WHERE IN condition
30
- * @param column - Column name
31
- * @param values - Array of values for IN clause
32
- * @returns Query builder for chaining
33
- */
34
- whereIn(column: string, values: any[]): IQueryBuilder<T>;
35
- /**
36
- * Add ORDER BY clause
37
- * @param column - Column to order by
38
- * @param direction - Sort direction (default: ASC)
39
- * @returns Query builder for chaining
40
- */
41
- orderBy(column: string, direction?: 'ASC' | 'DESC'): IQueryBuilder<T>;
42
- /**
43
- * Limit number of results
44
- * @param count - Maximum number of rows
45
- * @returns Query builder for chaining
46
- */
47
- limit(count: number): IQueryBuilder<T>;
48
- /**
49
- * Offset results (skip rows)
50
- * @param count - Number of rows to skip
51
- * @returns Query builder for chaining
52
- */
53
- offset(count: number): IQueryBuilder<T>;
54
- /**
55
- * Add INNER JOIN
56
- * @param table - Table to join
57
- * @param condition - Join condition
58
- * @returns Query builder for chaining
59
- */
60
- join(table: string, condition: string): IQueryBuilder<T>;
61
- /**
62
- * Add LEFT JOIN
63
- * @param table - Table to join
64
- * @param condition - Join condition
65
- * @returns Query builder for chaining
66
- */
67
- leftJoin(table: string, condition: string): IQueryBuilder<T>;
68
- /**
69
- * Insert single row
70
- * @param data - Data to insert
71
- * @returns Query builder for chaining
72
- */
73
- insert(data: Partial<T>): IQueryBuilder<T>;
74
- /**
75
- * Insert multiple rows
76
- * @param data - Array of data to insert
77
- * @returns Query builder for chaining
78
- */
79
- insertMany(data: Partial<T>[]): IQueryBuilder<T>;
80
- /**
81
- * Update rows
82
- * @param data - Data to update
83
- * @returns Query builder for chaining
84
- */
85
- update(data: Partial<T>): IQueryBuilder<T>;
86
- /**
87
- * Delete rows
88
- * @returns Query builder for chaining
89
- */
90
- delete(): IQueryBuilder<T>;
91
- /**
92
- * Build the query
93
- * @returns SQL string and parameters
94
- */
95
- build(): {
96
- sql: string;
97
- params: any[];
98
- };
99
- /**
100
- * Execute the query
101
- * @param adapter - Database adapter to use
102
- * @returns Query result
103
- */
104
- execute(adapter: IDatabaseAdapter): Promise<IQueryResult<T>>;
105
- }
106
- //# sourceMappingURL=IQueryBuilder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IQueryBuilder.d.ts","sourceRoot":"","sources":["../../src/interfaces/IQueryBuilder.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,GAAG;IACpC;;;;OAIG;IACH,MAAM,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAE/C;;;;OAIG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAE3D;;;;;OAKG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAEzD;;;;;OAKG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAEtE;;;;OAIG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAEvC;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAExC;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAEzD;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAE7D;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAE3C;;;;OAIG;IACH,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAEjD;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAE3C;;;OAGG;IACH,MAAM,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC;IAE3B;;;OAGG;IACH,KAAK,IAAI;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,GAAG,EAAE,CAAA;KAAE,CAAC;IAExC;;;;OAIG;IACH,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CAC9D"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,28 +0,0 @@
1
- /**
2
- * Field metadata information
3
- */
4
- export interface IFieldInfo {
5
- /** Field name */
6
- name: string;
7
- /** Database-specific type ID */
8
- dataTypeID: number;
9
- /** Human-readable type name (e.g., 'varchar', 'integer') */
10
- dataTypeName: string;
11
- /** Whether the field can contain null values */
12
- nullable: boolean;
13
- }
14
- /**
15
- * Query result with metadata
16
- * @template T - Type of rows returned
17
- */
18
- export interface IQueryResult<T = any> {
19
- /** Result rows */
20
- rows: T[];
21
- /** Number of rows returned */
22
- rowCount: number;
23
- /** Field metadata for each column */
24
- fields: IFieldInfo[];
25
- /** SQL command executed (e.g., SELECT, INSERT, UPDATE, DELETE) */
26
- command: string;
27
- }
28
- //# sourceMappingURL=IQueryResult.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IQueryResult.d.ts","sourceRoot":"","sources":["../../src/interfaces/IQueryResult.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG;IACnC,kBAAkB;IAClB,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,15 +0,0 @@
1
- /**
2
- * Row Level Security context
3
- * Used for multi-tenant security and user-based access control
4
- */
5
- export interface IRLSContext {
6
- /** User ID for RLS filtering */
7
- userId: string;
8
- /** User role (e.g., 'admin', 'user', 'guest') */
9
- userRole: string;
10
- /** Tenant ID for multi-tenant systems (optional) */
11
- tenantId?: string;
12
- /** Additional claims for fine-grained access control (optional) */
13
- claims?: Record<string, any>;
14
- }
15
- //# sourceMappingURL=IRLSContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IRLSContext.d.ts","sourceRoot":"","sources":["../../src/interfaces/IRLSContext.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IAEf,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IAEjB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,50 +0,0 @@
1
- import { IQueryResult } from './IQueryResult';
2
- /**
3
- * Transaction interface for ACID operations
4
- */
5
- export interface ITransaction {
6
- /** Unique transaction identifier */
7
- id: string;
8
- /**
9
- * Execute query within transaction
10
- * @template T - Type of rows returned
11
- * @param sql - SQL query string
12
- * @param params - Query parameters
13
- * @returns Query result
14
- */
15
- query<T = any>(sql: string, params?: any[]): Promise<IQueryResult<T>>;
16
- /**
17
- * Commit transaction changes
18
- * @throws Error if transaction is not active
19
- */
20
- commit(): Promise<void>;
21
- /**
22
- * Rollback transaction changes
23
- * @throws Error if transaction is not active
24
- */
25
- rollback(): Promise<void>;
26
- /**
27
- * Check if transaction is active
28
- * @returns true if transaction is active
29
- */
30
- isActive(): boolean;
31
- /**
32
- * Create a savepoint within the transaction
33
- * @param name - Savepoint name
34
- * @throws Error if transaction is not active
35
- */
36
- savepoint?(name: string): Promise<void>;
37
- /**
38
- * Rollback to a specific savepoint
39
- * @param name - Savepoint name
40
- * @throws Error if transaction is not active
41
- */
42
- rollbackToSavepoint?(name: string): Promise<void>;
43
- /**
44
- * Release a savepoint
45
- * @param name - Savepoint name
46
- * @throws Error if transaction is not active
47
- */
48
- releaseSavepoint?(name: string): Promise<void>;
49
- }
50
- //# sourceMappingURL=ITransaction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ITransaction.d.ts","sourceRoot":"","sources":["../../src/interfaces/ITransaction.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oCAAoC;IACpC,EAAE,EAAE,MAAM,CAAC;IAEX;;;;;;OAMG;IACH,KAAK,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtE;;;OAGG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC;IAEpB;;;;OAIG;IACH,SAAS,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExC;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;;;OAIG;IACH,gBAAgB,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +0,0 @@
1
- export * from './IDatabaseAdapter';
2
- export * from './ITransaction';
3
- export * from './IQueryResult';
4
- export * from './IDatabaseConfig';
5
- export * from './IDatabaseHealth';
6
- export * from './IRLSContext';
7
- export * from './IMigration';
8
- export * from './IConnectionPool';
9
- export * from './IQueryBuilder';
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAQA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- /*
3
- Copyright (c) 2025 Bernier LLC
4
-
5
- This file is licensed to the client under a limited-use license.
6
- The client may use and modify this code *only within the scope of the project it was delivered for*.
7
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
- */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
22
- };
23
- Object.defineProperty(exports, "__esModule", { value: true });
24
- __exportStar(require("./IDatabaseAdapter"), exports);
25
- __exportStar(require("./ITransaction"), exports);
26
- __exportStar(require("./IQueryResult"), exports);
27
- __exportStar(require("./IDatabaseConfig"), exports);
28
- __exportStar(require("./IDatabaseHealth"), exports);
29
- __exportStar(require("./IRLSContext"), exports);
30
- __exportStar(require("./IMigration"), exports);
31
- __exportStar(require("./IConnectionPool"), exports);
32
- __exportStar(require("./IQueryBuilder"), exports);