@uql/core 3.1.0 → 3.1.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 (170) hide show
  1. package/CHANGELOG.md +134 -176
  2. package/README.md +413 -0
  3. package/package.json +31 -26
  4. package/dist/package.json +0 -131
  5. package/src/@types/index.d.ts +0 -1
  6. package/src/@types/jest.d.ts +0 -6
  7. package/src/browser/http/bus.spec.ts +0 -22
  8. package/src/browser/http/bus.ts +0 -17
  9. package/src/browser/http/http.spec.ts +0 -70
  10. package/src/browser/http/http.ts +0 -55
  11. package/src/browser/http/index.ts +0 -2
  12. package/src/browser/index.ts +0 -4
  13. package/src/browser/options.spec.ts +0 -37
  14. package/src/browser/options.ts +0 -18
  15. package/src/browser/querier/genericClientRepository.spec.ts +0 -105
  16. package/src/browser/querier/genericClientRepository.ts +0 -49
  17. package/src/browser/querier/httpQuerier.ts +0 -82
  18. package/src/browser/querier/index.ts +0 -3
  19. package/src/browser/querier/querier.util.spec.ts +0 -35
  20. package/src/browser/querier/querier.util.ts +0 -18
  21. package/src/browser/type/clientQuerier.ts +0 -45
  22. package/src/browser/type/clientQuerierPool.ts +0 -5
  23. package/src/browser/type/clientRepository.ts +0 -22
  24. package/src/browser/type/index.ts +0 -4
  25. package/src/browser/type/request.ts +0 -25
  26. package/src/dialect/abstractDialect.ts +0 -28
  27. package/src/dialect/abstractSqlDialect-spec.ts +0 -1309
  28. package/src/dialect/abstractSqlDialect.ts +0 -805
  29. package/src/dialect/index.ts +0 -3
  30. package/src/dialect/namingStrategy.spec.ts +0 -52
  31. package/src/dialect/queryContext.ts +0 -69
  32. package/src/entity/decorator/definition.spec.ts +0 -736
  33. package/src/entity/decorator/definition.ts +0 -265
  34. package/src/entity/decorator/entity.ts +0 -8
  35. package/src/entity/decorator/field.ts +0 -9
  36. package/src/entity/decorator/id.ts +0 -9
  37. package/src/entity/decorator/index.ts +0 -5
  38. package/src/entity/decorator/relation.spec.ts +0 -41
  39. package/src/entity/decorator/relation.ts +0 -34
  40. package/src/entity/index.ts +0 -1
  41. package/src/express/@types/express.d.ts +0 -8
  42. package/src/express/@types/index.d.ts +0 -1
  43. package/src/express/index.ts +0 -2
  44. package/src/express/querierMiddleware.ts +0 -217
  45. package/src/express/query.util.spec.ts +0 -40
  46. package/src/express/query.util.ts +0 -21
  47. package/src/index.ts +0 -9
  48. package/src/maria/index.ts +0 -3
  49. package/src/maria/mariaDialect.spec.ts +0 -207
  50. package/src/maria/mariaDialect.ts +0 -42
  51. package/src/maria/mariaQuerierPool.test.ts +0 -23
  52. package/src/maria/mariadbQuerier.test.ts +0 -23
  53. package/src/maria/mariadbQuerier.ts +0 -45
  54. package/src/maria/mariadbQuerierPool.ts +0 -21
  55. package/src/migrate/cli.ts +0 -301
  56. package/src/migrate/generator/index.ts +0 -4
  57. package/src/migrate/generator/mongoSchemaGenerator.spec.ts +0 -112
  58. package/src/migrate/generator/mongoSchemaGenerator.ts +0 -115
  59. package/src/migrate/generator/mysqlSchemaGenerator.spec.ts +0 -34
  60. package/src/migrate/generator/mysqlSchemaGenerator.ts +0 -92
  61. package/src/migrate/generator/postgresSchemaGenerator.spec.ts +0 -44
  62. package/src/migrate/generator/postgresSchemaGenerator.ts +0 -127
  63. package/src/migrate/generator/sqliteSchemaGenerator.spec.ts +0 -33
  64. package/src/migrate/generator/sqliteSchemaGenerator.ts +0 -81
  65. package/src/migrate/index.ts +0 -41
  66. package/src/migrate/introspection/index.ts +0 -4
  67. package/src/migrate/introspection/mongoIntrospector.spec.ts +0 -75
  68. package/src/migrate/introspection/mongoIntrospector.ts +0 -47
  69. package/src/migrate/introspection/mysqlIntrospector.spec.ts +0 -113
  70. package/src/migrate/introspection/mysqlIntrospector.ts +0 -278
  71. package/src/migrate/introspection/postgresIntrospector.spec.ts +0 -112
  72. package/src/migrate/introspection/postgresIntrospector.ts +0 -329
  73. package/src/migrate/introspection/sqliteIntrospector.spec.ts +0 -112
  74. package/src/migrate/introspection/sqliteIntrospector.ts +0 -296
  75. package/src/migrate/migrator-mongo.test.ts +0 -54
  76. package/src/migrate/migrator.spec.ts +0 -255
  77. package/src/migrate/migrator.test.ts +0 -94
  78. package/src/migrate/migrator.ts +0 -719
  79. package/src/migrate/namingStrategy.spec.ts +0 -22
  80. package/src/migrate/schemaGenerator-advanced.spec.ts +0 -138
  81. package/src/migrate/schemaGenerator.spec.ts +0 -190
  82. package/src/migrate/schemaGenerator.ts +0 -478
  83. package/src/migrate/storage/databaseStorage.spec.ts +0 -69
  84. package/src/migrate/storage/databaseStorage.ts +0 -100
  85. package/src/migrate/storage/index.ts +0 -2
  86. package/src/migrate/storage/jsonStorage.ts +0 -58
  87. package/src/migrate/type.ts +0 -1
  88. package/src/mongo/index.ts +0 -3
  89. package/src/mongo/mongoDialect.spec.ts +0 -251
  90. package/src/mongo/mongoDialect.ts +0 -238
  91. package/src/mongo/mongodbQuerier.test.ts +0 -45
  92. package/src/mongo/mongodbQuerier.ts +0 -256
  93. package/src/mongo/mongodbQuerierPool.test.ts +0 -25
  94. package/src/mongo/mongodbQuerierPool.ts +0 -24
  95. package/src/mysql/index.ts +0 -3
  96. package/src/mysql/mysql2Querier.test.ts +0 -20
  97. package/src/mysql/mysql2Querier.ts +0 -49
  98. package/src/mysql/mysql2QuerierPool.test.ts +0 -20
  99. package/src/mysql/mysql2QuerierPool.ts +0 -21
  100. package/src/mysql/mysqlDialect.spec.ts +0 -20
  101. package/src/mysql/mysqlDialect.ts +0 -16
  102. package/src/namingStrategy/defaultNamingStrategy.ts +0 -18
  103. package/src/namingStrategy/index.spec.ts +0 -36
  104. package/src/namingStrategy/index.ts +0 -2
  105. package/src/namingStrategy/snakeCaseNamingStrategy.ts +0 -15
  106. package/src/options.spec.ts +0 -41
  107. package/src/options.ts +0 -18
  108. package/src/postgres/index.ts +0 -3
  109. package/src/postgres/manual-types.d.ts +0 -4
  110. package/src/postgres/pgQuerier.test.ts +0 -25
  111. package/src/postgres/pgQuerier.ts +0 -45
  112. package/src/postgres/pgQuerierPool.test.ts +0 -28
  113. package/src/postgres/pgQuerierPool.ts +0 -21
  114. package/src/postgres/postgresDialect.spec.ts +0 -428
  115. package/src/postgres/postgresDialect.ts +0 -144
  116. package/src/querier/abstractQuerier-test.ts +0 -584
  117. package/src/querier/abstractQuerier.ts +0 -353
  118. package/src/querier/abstractQuerierPool-test.ts +0 -20
  119. package/src/querier/abstractQuerierPool.ts +0 -18
  120. package/src/querier/abstractSqlQuerier-spec.ts +0 -979
  121. package/src/querier/abstractSqlQuerier-test.ts +0 -21
  122. package/src/querier/abstractSqlQuerier.ts +0 -138
  123. package/src/querier/decorator/index.ts +0 -3
  124. package/src/querier/decorator/injectQuerier.spec.ts +0 -74
  125. package/src/querier/decorator/injectQuerier.ts +0 -45
  126. package/src/querier/decorator/serialized.spec.ts +0 -98
  127. package/src/querier/decorator/serialized.ts +0 -13
  128. package/src/querier/decorator/transactional.spec.ts +0 -240
  129. package/src/querier/decorator/transactional.ts +0 -56
  130. package/src/querier/index.ts +0 -4
  131. package/src/repository/genericRepository.spec.ts +0 -111
  132. package/src/repository/genericRepository.ts +0 -74
  133. package/src/repository/index.ts +0 -1
  134. package/src/sqlite/index.ts +0 -3
  135. package/src/sqlite/manual-types.d.ts +0 -4
  136. package/src/sqlite/sqliteDialect.spec.ts +0 -155
  137. package/src/sqlite/sqliteDialect.ts +0 -76
  138. package/src/sqlite/sqliteQuerier.spec.ts +0 -36
  139. package/src/sqlite/sqliteQuerier.test.ts +0 -21
  140. package/src/sqlite/sqliteQuerier.ts +0 -37
  141. package/src/sqlite/sqliteQuerierPool.test.ts +0 -12
  142. package/src/sqlite/sqliteQuerierPool.ts +0 -38
  143. package/src/test/entityMock.ts +0 -375
  144. package/src/test/index.ts +0 -3
  145. package/src/test/it.util.ts +0 -69
  146. package/src/test/spec.util.ts +0 -57
  147. package/src/type/entity.ts +0 -218
  148. package/src/type/index.ts +0 -9
  149. package/src/type/migration.ts +0 -241
  150. package/src/type/namingStrategy.ts +0 -17
  151. package/src/type/querier.ts +0 -143
  152. package/src/type/querierPool.ts +0 -26
  153. package/src/type/query.ts +0 -506
  154. package/src/type/repository.ts +0 -142
  155. package/src/type/universalQuerier.ts +0 -133
  156. package/src/type/utility.ts +0 -21
  157. package/src/util/dialect.util-extra.spec.ts +0 -96
  158. package/src/util/dialect.util.spec.ts +0 -23
  159. package/src/util/dialect.util.ts +0 -134
  160. package/src/util/index.ts +0 -5
  161. package/src/util/object.util.spec.ts +0 -29
  162. package/src/util/object.util.ts +0 -27
  163. package/src/util/raw.ts +0 -11
  164. package/src/util/sql.util-extra.spec.ts +0 -17
  165. package/src/util/sql.util.spec.ts +0 -208
  166. package/src/util/sql.util.ts +0 -104
  167. package/src/util/string.util.spec.ts +0 -46
  168. package/src/util/string.util.ts +0 -35
  169. package/tsconfig.build.json +0 -5
  170. package/tsconfig.json +0 -8
package/src/type/index.ts DELETED
@@ -1,9 +0,0 @@
1
- export * from './entity.js';
2
- export * from './migration.js';
3
- export * from './namingStrategy.js';
4
- export * from './querier.js';
5
- export * from './querierPool.js';
6
- export * from './query.js';
7
- export * from './repository.js';
8
- export * from './universalQuerier.js';
9
- export * from './utility.js';
@@ -1,241 +0,0 @@
1
- import type { Dialect, EntityMeta, FieldOptions, NamingStrategy, SqlQuerier, Type } from './index.js';
2
-
3
- /**
4
- * Defines a migration using a simple object literal
5
- */
6
- export interface MigrationDefinition {
7
- readonly name?: string;
8
- readonly up: (querier: SqlQuerier) => Promise<void>;
9
- readonly down: (querier: SqlQuerier) => Promise<void>;
10
- }
11
-
12
- /**
13
- * Represents a single database migration
14
- */
15
- export interface Migration extends MigrationDefinition {
16
- /**
17
- * Unique name/identifier for this migration (typically timestamp + description)
18
- */
19
- readonly name: string;
20
- }
21
-
22
- /**
23
- * Storage backend for tracking which migrations have been executed
24
- */
25
- export interface MigrationStorage {
26
- /**
27
- * Get list of already executed migration names
28
- */
29
- executed(): Promise<string[]>;
30
-
31
- /**
32
- * Mark a migration as executed (called within migration transaction)
33
- */
34
- logWithQuerier(querier: SqlQuerier, migrationName: string): Promise<void>;
35
-
36
- /**
37
- * Remove a migration from the executed list (called within migration transaction)
38
- */
39
- unlogWithQuerier(querier: SqlQuerier, migrationName: string): Promise<void>;
40
-
41
- /**
42
- * Ensure the storage is initialized (e.g., create migrations table)
43
- */
44
- ensureStorage(): Promise<void>;
45
- }
46
-
47
- /**
48
- * Configuration options for the Migrator
49
- */
50
- export interface MigratorOptions {
51
- /**
52
- * The database dialect. Defaults to 'postgres'.
53
- */
54
- readonly dialect?: Dialect;
55
-
56
- /**
57
- * Directory containing migration files. Defaults to './migrations'.
58
- */
59
- readonly migrationsPath?: string;
60
-
61
- /**
62
- * Custom storage implementation. Defaults to DatabaseMigrationStorage.
63
- */
64
- readonly storage?: MigrationStorage;
65
-
66
- /**
67
- * Table name for storing migration state. Defaults to 'uql_migrations'.
68
- */
69
- readonly tableName?: string;
70
-
71
- /**
72
- * Logger function for migration output
73
- */
74
- readonly logger?: (message: string) => void;
75
-
76
- /**
77
- * Entities to use for schema generation
78
- */
79
- readonly entities?: Type<unknown>[];
80
-
81
- /**
82
- * Naming strategy for database tables and columns
83
- */
84
- readonly namingStrategy?: NamingStrategy;
85
-
86
- /**
87
- * Custom schema generator for DDL operations.
88
- * If not provided, it will be inferred from the dialect.
89
- */
90
- readonly schemaGenerator?: SchemaGenerator;
91
- }
92
-
93
- /**
94
- * Result of a migration run
95
- */
96
- export interface MigrationResult {
97
- readonly name: string;
98
- readonly direction: 'up' | 'down';
99
- readonly duration: number;
100
- readonly success: boolean;
101
- readonly error?: Error;
102
- }
103
-
104
- /**
105
- * Represents a column in a database table schema
106
- */
107
- export interface ColumnSchema {
108
- readonly name: string;
109
- readonly type: string;
110
- readonly nullable: boolean;
111
- readonly defaultValue?: unknown;
112
- readonly isPrimaryKey: boolean;
113
- readonly isAutoIncrement: boolean;
114
- readonly isUnique: boolean;
115
- readonly length?: number;
116
- readonly precision?: number;
117
- readonly scale?: number;
118
- readonly comment?: string;
119
- }
120
-
121
- /**
122
- * Represents a database table schema
123
- */
124
- export interface TableSchema {
125
- readonly name: string;
126
- readonly columns: ColumnSchema[];
127
- readonly primaryKey?: string[];
128
- readonly indexes?: IndexSchema[];
129
- readonly foreignKeys?: ForeignKeySchema[];
130
- }
131
-
132
- /**
133
- * Represents an index in a database table
134
- */
135
- export interface IndexSchema {
136
- readonly name: string;
137
- readonly columns: string[];
138
- readonly unique: boolean;
139
- }
140
-
141
- /**
142
- * Represents a foreign key constraint
143
- */
144
- export interface ForeignKeySchema {
145
- readonly name: string;
146
- readonly columns: string[];
147
- readonly referencedTable: string;
148
- readonly referencedColumns: string[];
149
- readonly onDelete?: 'CASCADE' | 'SET NULL' | 'RESTRICT' | 'NO ACTION';
150
- readonly onUpdate?: 'CASCADE' | 'SET NULL' | 'RESTRICT' | 'NO ACTION';
151
- }
152
-
153
- /**
154
- * Represents a difference between current and desired schema
155
- */
156
- export interface SchemaDiff {
157
- readonly tableName: string;
158
- readonly type: 'create' | 'alter' | 'drop';
159
- readonly columnsToAdd?: ColumnSchema[];
160
- readonly columnsToAlter?: { from: ColumnSchema; to: ColumnSchema }[];
161
- readonly columnsToDrop?: string[];
162
- readonly indexesToAdd?: IndexSchema[];
163
- readonly indexesToDrop?: string[];
164
- readonly foreignKeysToAdd?: ForeignKeySchema[];
165
- readonly foreignKeysToDrop?: string[];
166
- }
167
-
168
- /**
169
- * Interface for generating DDL statements from entity metadata
170
- */
171
- export interface SchemaGenerator {
172
- /**
173
- * Generate CREATE TABLE statement for an entity
174
- */
175
- generateCreateTable<E>(entity: Type<E>, options?: { ifNotExists?: boolean }): string;
176
-
177
- /**
178
- * Generate DROP TABLE statement for an entity
179
- */
180
- generateDropTable<E>(entity: Type<E>): string;
181
-
182
- /**
183
- * Generate ALTER TABLE statements based on schema diff
184
- */
185
- generateAlterTable(diff: SchemaDiff): string[];
186
-
187
- /**
188
- * Generate rollback (down) statements for ALTER TABLE based on schema diff
189
- */
190
- generateAlterTableDown(diff: SchemaDiff): string[];
191
-
192
- /**
193
- * Generate CREATE INDEX statement
194
- */
195
- generateCreateIndex(tableName: string, index: IndexSchema): string;
196
-
197
- /**
198
- * Generate DROP INDEX statement
199
- */
200
- generateDropIndex(tableName: string, indexName: string): string;
201
-
202
- /**
203
- * Get the SQL type for a field based on its options
204
- */
205
- getSqlType(fieldOptions: FieldOptions, fieldType?: unknown): string;
206
-
207
- /**
208
- * Compare two schemas and return the differences
209
- */
210
- diffSchema<E>(entity: Type<E>, currentSchema: TableSchema | undefined): SchemaDiff | undefined;
211
-
212
- /**
213
- * Resolve table name using entity and naming strategy
214
- */
215
- resolveTableName<E>(entity: Type<E>, meta: EntityMeta<E>): string;
216
-
217
- /**
218
- * Resolve column name using field options and naming strategy
219
- */
220
- resolveColumnName(key: string, field: FieldOptions): string;
221
- }
222
-
223
- /**
224
- * Interface for introspecting the current database schema
225
- */
226
- export interface SchemaIntrospector {
227
- /**
228
- * Get the schema of a specific table
229
- */
230
- getTableSchema(tableName: string): Promise<TableSchema | undefined>;
231
-
232
- /**
233
- * Get all table names in the database
234
- */
235
- getTableNames(): Promise<string[]>;
236
-
237
- /**
238
- * Check if a table exists
239
- */
240
- tableExists(tableName: string): Promise<boolean>;
241
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * Defines the naming strategy for database tables and columns.
3
- */
4
- export interface NamingStrategy {
5
- /**
6
- * Translates entity name to table name.
7
- */
8
- tableName(entityName: string): string;
9
- /**
10
- * Translates property name to column name.
11
- */
12
- columnName(propertyName: string): string;
13
- /**
14
- * Translates entity names to join table name (many-to-many).
15
- */
16
- joinTableName(sourceEntityName: string, targetEntityName: string, propertyName?: string): string;
17
- }
@@ -1,143 +0,0 @@
1
- import type { Db } from 'mongodb';
2
- import type { IdValue } from './entity.js';
3
- import type { NamingStrategy } from './namingStrategy.js';
4
- import type {
5
- Query,
6
- QueryConflictPaths,
7
- QueryOne,
8
- QueryOptions,
9
- QuerySearch,
10
- QueryUpdateResult,
11
- SqlQueryDialect,
12
- } from './query.js';
13
- import type { Repository } from './repository.js';
14
- import type { UniversalQuerier } from './universalQuerier.js';
15
- import type { Type } from './utility.js';
16
-
17
- /**
18
- * Isolation levels for transactions.
19
- */
20
- export type IsolationLevel = 'read uncommitted' | 'read committed' | 'repeteable read' | 'serializable';
21
-
22
- /**
23
- * Supported SQL dialect identifiers.
24
- */
25
- export type SqlDialect = 'postgres' | 'mysql' | 'mariadb' | 'sqlite';
26
-
27
- export type Dialect = SqlDialect | 'mongodb';
28
-
29
- export interface Querier extends UniversalQuerier {
30
- findOneById<E>(entity: Type<E>, id: IdValue<E>, q?: QueryOne<E>): Promise<E>;
31
-
32
- findOne<E>(entity: Type<E>, q: QueryOne<E>): Promise<E>;
33
-
34
- findMany<E>(entity: Type<E>, q: Query<E>): Promise<E[]>;
35
-
36
- findManyAndCount<E>(entity: Type<E>, q: Query<E>): Promise<[E[], number]>;
37
-
38
- count<E>(entity: Type<E>, q: QuerySearch<E>): Promise<number>;
39
-
40
- insertOne<E>(entity: Type<E>, payload: E): Promise<IdValue<E>>;
41
-
42
- insertMany<E>(entity: Type<E>, payload: E[]): Promise<IdValue<E>[]>;
43
-
44
- updateOneById<E>(entity: Type<E>, id: IdValue<E>, payload: E): Promise<number>;
45
-
46
- updateMany<E>(entity: Type<E>, q: QuerySearch<E>, payload: E): Promise<number>;
47
-
48
- upsertOne<E>(entity: Type<E>, conflictPaths: QueryConflictPaths<E>, payload: E): Promise<QueryUpdateResult>;
49
-
50
- saveOne<E>(entity: Type<E>, payload: E): Promise<IdValue<E>>;
51
-
52
- saveMany<E>(entity: Type<E>, payload: E[]): Promise<IdValue<E>[]>;
53
-
54
- deleteOneById<E>(entity: Type<E>, id: IdValue<E>, opts?: QueryOptions): Promise<number>;
55
-
56
- deleteMany<E>(entity: Type<E>, q: QuerySearch<E>, opts?: QueryOptions): Promise<number>;
57
-
58
- getRepository<E>(entity: Type<E>): Repository<E>;
59
-
60
- /**
61
- * whether this querier is in a transaction or not.
62
- */
63
- readonly hasOpenTransaction: boolean;
64
-
65
- /**
66
- * run the given callback inside a transaction in this querier.
67
- */
68
- transaction<T>(callback: () => Promise<T>): Promise<T>;
69
-
70
- /**
71
- * starts a new transaction in this querier.
72
- */
73
- beginTransaction(): Promise<void>;
74
-
75
- /**
76
- * commits the currently active transaction in this querier.
77
- */
78
- commitTransaction(): Promise<void>;
79
-
80
- /**
81
- * aborts the currently active transaction in this querier.
82
- */
83
- rollbackTransaction(): Promise<void>;
84
-
85
- /**
86
- * release the querier to the pool.
87
- */
88
- release(): Promise<void>;
89
- }
90
-
91
- /**
92
- * Extended querier interface for raw SQL execution.
93
- * Implemented by AbstractSqlQuerier and all SQL-based queriers.
94
- */
95
- export interface SqlQuerier extends Querier {
96
- /**
97
- * The SQL dialect (provides escapeIdChar and other dialect-specific info)
98
- */
99
- readonly dialect: SqlQueryDialect;
100
-
101
- /**
102
- * Execute a raw SQL query and return results
103
- */
104
- all<T>(query: string, values?: unknown[]): Promise<T[]>;
105
-
106
- /**
107
- * Execute a raw SQL command (INSERT, UPDATE, DELETE, DDL)
108
- */
109
- run(query: string, values?: unknown[]): Promise<QueryUpdateResult>;
110
- }
111
-
112
- /**
113
- * Type guard to check if a querier supports raw SQL execution
114
- */
115
- export function isSqlQuerier(querier: Querier): querier is SqlQuerier {
116
- const q = querier as SqlQuerier;
117
- return (
118
- typeof q.all === 'function' &&
119
- typeof q.run === 'function' &&
120
- q.dialect !== undefined &&
121
- typeof q.dialect.escapeIdChar === 'string'
122
- );
123
- }
124
-
125
- /**
126
- * Extended querier interface for MongoDB execution.
127
- */
128
- export interface MongoQuerier extends Querier {
129
- /**
130
- * The MongoDB database instance.
131
- */
132
- readonly db: Db;
133
- }
134
-
135
- /**
136
- * logger function to debug queries.
137
- */
138
- export type Logger = (message: unknown, ...args: unknown[]) => unknown;
139
-
140
- export type ExtraOptions = {
141
- readonly logger?: Logger;
142
- readonly namingStrategy?: NamingStrategy;
143
- };
@@ -1,26 +0,0 @@
1
- import type { Dialect, ExtraOptions, Querier } from './querier.js';
2
-
3
- /**
4
- * querier pool.
5
- */
6
- export type QuerierPool<Q extends Querier = Querier> = {
7
- /**
8
- * the database dialect.
9
- */
10
- readonly dialect: Dialect;
11
-
12
- /**
13
- * extra options
14
- */
15
- readonly extra?: ExtraOptions;
16
-
17
- /**
18
- * get a querier from the pool.
19
- */
20
- getQuerier: () => Promise<Q>;
21
-
22
- /**
23
- * end the pool.
24
- */
25
- end(): Promise<void>;
26
- };