@dangao/bun-server 2.0.8 → 2.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.
Files changed (89) hide show
  1. package/README.md +4 -0
  2. package/dist/controller/controller.d.ts.map +1 -1
  3. package/dist/core/application.d.ts +6 -1
  4. package/dist/core/application.d.ts.map +1 -1
  5. package/dist/core/server.d.ts +5 -0
  6. package/dist/core/server.d.ts.map +1 -1
  7. package/dist/database/database-context.d.ts +25 -0
  8. package/dist/database/database-context.d.ts.map +1 -0
  9. package/dist/database/database-extension.d.ts +8 -9
  10. package/dist/database/database-extension.d.ts.map +1 -1
  11. package/dist/database/database-module.d.ts +7 -1
  12. package/dist/database/database-module.d.ts.map +1 -1
  13. package/dist/database/db-proxy.d.ts +12 -0
  14. package/dist/database/db-proxy.d.ts.map +1 -0
  15. package/dist/database/index.d.ts +6 -1
  16. package/dist/database/index.d.ts.map +1 -1
  17. package/dist/database/orm/transaction-interceptor.d.ts +0 -16
  18. package/dist/database/orm/transaction-interceptor.d.ts.map +1 -1
  19. package/dist/database/orm/transaction-manager.d.ts +10 -61
  20. package/dist/database/orm/transaction-manager.d.ts.map +1 -1
  21. package/dist/database/service.d.ts.map +1 -1
  22. package/dist/database/sql-manager.d.ts +14 -0
  23. package/dist/database/sql-manager.d.ts.map +1 -0
  24. package/dist/database/sqlite-adapter.d.ts +32 -0
  25. package/dist/database/sqlite-adapter.d.ts.map +1 -0
  26. package/dist/database/strategy-decorator.d.ts +8 -0
  27. package/dist/database/strategy-decorator.d.ts.map +1 -0
  28. package/dist/database/types.d.ts +122 -1
  29. package/dist/database/types.d.ts.map +1 -1
  30. package/dist/di/module-registry.d.ts.map +1 -1
  31. package/dist/index.d.ts +3 -3
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +3115 -2586
  34. package/dist/microservice/service-registry/service-registry-module.d.ts +16 -0
  35. package/dist/microservice/service-registry/service-registry-module.d.ts.map +1 -1
  36. package/dist/router/index.d.ts +1 -0
  37. package/dist/router/index.d.ts.map +1 -1
  38. package/dist/router/registry.d.ts +1 -1
  39. package/dist/router/registry.d.ts.map +1 -1
  40. package/dist/router/route.d.ts +2 -1
  41. package/dist/router/route.d.ts.map +1 -1
  42. package/dist/router/router.d.ts +1 -1
  43. package/dist/router/router.d.ts.map +1 -1
  44. package/dist/router/timeout-decorator.d.ts +6 -0
  45. package/dist/router/timeout-decorator.d.ts.map +1 -0
  46. package/docs/database.md +48 -15
  47. package/docs/idle-timeout.md +42 -0
  48. package/docs/lifecycle.md +6 -0
  49. package/docs/microservice-nacos.md +1 -0
  50. package/docs/microservice-service-registry.md +7 -0
  51. package/docs/zh/database.md +48 -15
  52. package/docs/zh/idle-timeout.md +41 -0
  53. package/docs/zh/lifecycle.md +5 -0
  54. package/docs/zh/microservice-nacos.md +1 -0
  55. package/docs/zh/microservice-service-registry.md +6 -0
  56. package/package.json +1 -1
  57. package/src/controller/controller.ts +11 -1
  58. package/src/core/application.ts +60 -1
  59. package/src/core/server.ts +10 -0
  60. package/src/database/database-context.ts +43 -0
  61. package/src/database/database-extension.ts +12 -45
  62. package/src/database/database-module.ts +254 -11
  63. package/src/database/db-proxy.ts +75 -0
  64. package/src/database/index.ts +29 -0
  65. package/src/database/orm/transaction-interceptor.ts +12 -149
  66. package/src/database/orm/transaction-manager.ts +143 -210
  67. package/src/database/service.ts +28 -2
  68. package/src/database/sql-manager.ts +62 -0
  69. package/src/database/sqlite-adapter.ts +121 -0
  70. package/src/database/strategy-decorator.ts +42 -0
  71. package/src/database/types.ts +133 -1
  72. package/src/di/module-registry.ts +20 -4
  73. package/src/index.ts +27 -1
  74. package/src/microservice/service-registry/service-registry-module.ts +25 -1
  75. package/src/router/index.ts +1 -0
  76. package/src/router/registry.ts +10 -1
  77. package/src/router/route.ts +31 -3
  78. package/src/router/router.ts +10 -1
  79. package/src/router/timeout-decorator.ts +35 -0
  80. package/tests/core/application.test.ts +10 -0
  81. package/tests/database/database-module.test.ts +91 -430
  82. package/tests/database/db-proxy.test.ts +93 -0
  83. package/tests/database/sql-manager.test.ts +43 -0
  84. package/tests/database/sqlite-adapter.test.ts +45 -0
  85. package/tests/database/strategy-decorator.test.ts +29 -0
  86. package/tests/database/transaction.test.ts +84 -222
  87. package/tests/di/lifecycle.test.ts +37 -0
  88. package/tests/microservice/service-registry.test.ts +15 -0
  89. package/tests/router/timeout-decorator.test.ts +48 -0
@@ -7,14 +7,19 @@ import {
7
7
 
8
8
  import { TransactionInterceptor } from './orm/transaction-interceptor';
9
9
  import { TRANSACTION_METADATA_KEY } from './orm/transaction-decorator';
10
- import { DATABASE_SERVICE_TOKEN } from './types';
11
- import type { DatabaseService } from './service';
10
+ import type { BunSQLManager } from './sql-manager';
11
+ import type { SqliteManager } from './sqlite-adapter';
12
12
 
13
13
  /**
14
14
  * 数据库扩展
15
- * 在应用启动时自动初始化数据库连接
15
+ * 注册事务拦截器,并在应用关闭时释放数据库资源
16
16
  */
17
17
  export class DatabaseExtension implements ApplicationExtension {
18
+ public constructor(
19
+ private readonly sqlManager?: BunSQLManager,
20
+ private readonly sqliteManager?: SqliteManager,
21
+ ) {}
22
+
18
23
  public register(container: Container): void {
19
24
  // 注册事务拦截器到拦截器注册表
20
25
  try {
@@ -36,48 +41,10 @@ export class DatabaseExtension implements ApplicationExtension {
36
41
  }
37
42
 
38
43
  /**
39
- * 初始化数据库连接
40
- * 应该在应用启动时调用
44
+ * 关闭数据库资源
41
45
  */
42
- public async initialize(container: Container): Promise<void> {
43
- try {
44
- const databaseService = container.resolve<DatabaseService>(
45
- DATABASE_SERVICE_TOKEN,
46
- );
47
- await databaseService.initialize();
48
- } catch (error) {
49
- // 如果 DatabaseService 未注册,忽略错误
50
- // 这意味着用户可能没有使用 DatabaseModule
51
- if (
52
- error instanceof Error &&
53
- error.message.includes('Provider not found')
54
- ) {
55
- return;
56
- }
57
- throw error;
58
- }
59
- }
60
-
61
- /**
62
- * 关闭数据库连接
63
- * 应该在应用停止时调用
64
- */
65
- public async close(container: Container): Promise<void> {
66
- try {
67
- const databaseService = container.resolve<DatabaseService>(
68
- DATABASE_SERVICE_TOKEN,
69
- );
70
- // 关闭连接池(关闭所有连接)
71
- await databaseService.closePool();
72
- } catch (error) {
73
- // 如果 DatabaseService 未注册,忽略错误
74
- if (
75
- error instanceof Error &&
76
- error.message.includes('Provider not found')
77
- ) {
78
- return;
79
- }
80
- throw error;
81
- }
46
+ public async close(_container: Container): Promise<void> {
47
+ await this.sqlManager?.destroyAll(10);
48
+ this.sqliteManager?.destroyAll();
82
49
  }
83
50
  }
@@ -1,30 +1,207 @@
1
1
  import { Module, MODULE_METADATA_KEY, type ModuleProvider } from '../di/module';
2
- import type { ApplicationExtension } from '../extensions/types';
3
- import {
4
- InterceptorRegistry,
5
- INTERCEPTOR_REGISTRY_TOKEN,
6
- } from '../interceptor';
7
2
  import { type AsyncModuleOptions, registerAsyncProviders } from '../di/async-module';
3
+ import type { Constructor } from '@/core/types';
4
+ import type { Middleware } from '../middleware';
8
5
 
9
6
  import { DatabaseExtension } from './database-extension';
10
7
  import { DatabaseHealthIndicator } from './health-indicator';
11
8
  import { OrmService } from './orm/service';
12
9
  import { TransactionManager } from './orm/transaction-manager';
13
- import { TransactionInterceptor } from './orm/transaction-interceptor';
14
10
  import { TRANSACTION_METADATA_KEY } from './orm/transaction-decorator';
15
11
  import { DatabaseService } from './service';
16
12
  import {
13
+ BUN_SQL_MANAGER_TOKEN,
14
+ DB_TOKEN,
17
15
  DATABASE_OPTIONS_TOKEN,
18
16
  DATABASE_SERVICE_TOKEN,
17
+ SQLITE_MANAGER_TOKEN,
18
+ type BunSQLConfig,
19
19
  type DatabaseModuleOptions,
20
+ type SqliteV2Config,
20
21
  } from './types';
21
22
  import { ORM_SERVICE_TOKEN } from './orm/types';
22
23
  import { TRANSACTION_SERVICE_TOKEN } from './orm/transaction-types';
24
+ import { BunSQLManager } from './sql-manager';
25
+ import { SqliteManager } from './sqlite-adapter';
26
+ import { db, initDbProxy } from './db-proxy';
27
+ import { getDbStrategy } from './strategy-decorator';
28
+ import { runWithSession, type DatabaseSession } from './database-context';
23
29
 
24
30
  @Module({
25
31
  providers: [],
26
32
  })
27
33
  export class DatabaseModule {
34
+ private static isBunSqlType(
35
+ type: DatabaseModuleOptions['type'] | undefined,
36
+ ): type is 'postgres' | 'mysql' {
37
+ return type === 'postgres' || type === 'mysql';
38
+ }
39
+
40
+ public static normalizeConfig(
41
+ options: DatabaseModuleOptions,
42
+ ): Array<{ tenantId: string; config: BunSQLConfig | SqliteV2Config }> {
43
+ if (options.tenants && options.tenants.length > 0) {
44
+ return options.tenants.map((tenant) => ({
45
+ tenantId: tenant.id,
46
+ config: tenant.config,
47
+ }));
48
+ }
49
+
50
+ if (options.database?.type === 'sqlite') {
51
+ if (options.pool) {
52
+ console.warn('[DatabaseModule] pool options are ignored for SQLite');
53
+ }
54
+ return [
55
+ {
56
+ tenantId: options.defaultTenant ?? 'default',
57
+ config: {
58
+ type: 'sqlite',
59
+ database: options.database.config.path,
60
+ wal: options.wal ?? true,
61
+ maxWriteConcurrency: options.maxWriteConcurrency ?? 1,
62
+ },
63
+ },
64
+ ];
65
+ }
66
+
67
+ if (options.database?.type === 'postgres' || options.database?.type === 'mysql') {
68
+ const db = options.database;
69
+ const protocol = db.type === 'mysql' ? 'mysql' : 'postgres';
70
+ const url =
71
+ `${protocol}://${db.config.user}:${db.config.password}@${db.config.host}:${db.config.port}/${db.config.database}`;
72
+ return [
73
+ {
74
+ tenantId: options.defaultTenant ?? 'default',
75
+ config: {
76
+ type: db.type,
77
+ url,
78
+ pool: options.bunSqlPool,
79
+ },
80
+ },
81
+ ];
82
+ }
83
+
84
+ if (options.type === 'sqlite') {
85
+ return [
86
+ {
87
+ tenantId: options.defaultTenant ?? 'default',
88
+ config: {
89
+ type: 'sqlite',
90
+ database: options.databasePath ?? ':memory:',
91
+ wal: options.wal ?? true,
92
+ maxWriteConcurrency: options.maxWriteConcurrency ?? 1,
93
+ },
94
+ },
95
+ ];
96
+ }
97
+
98
+ if (options.url && DatabaseModule.isBunSqlType(options.type)) {
99
+ return [
100
+ {
101
+ tenantId: options.defaultTenant ?? 'default',
102
+ config: {
103
+ type: options.type,
104
+ url: options.url,
105
+ pool: options.bunSqlPool,
106
+ },
107
+ },
108
+ ];
109
+ }
110
+
111
+ if (options.host && DatabaseModule.isBunSqlType(options.type)) {
112
+ const protocol = options.type === 'mysql' ? 'mysql' : 'postgres';
113
+ const url =
114
+ `${protocol}://${options.username}:${options.password}@${options.host}:${options.port ?? 5432}/${options.databasePath ?? ''}`;
115
+ return [
116
+ {
117
+ tenantId: options.defaultTenant ?? 'default',
118
+ config: {
119
+ type: options.type,
120
+ url,
121
+ pool: options.bunSqlPool,
122
+ },
123
+ },
124
+ ];
125
+ }
126
+
127
+ throw new Error(
128
+ '[DatabaseModule] invalid configuration: specify tenants or single tenant connection options',
129
+ );
130
+ }
131
+
132
+ private static createDatabaseMiddleware(
133
+ options: DatabaseModuleOptions,
134
+ normalized: Array<{ tenantId: string; config: BunSQLConfig | SqliteV2Config }>,
135
+ sqlManager: BunSQLManager,
136
+ sqliteManager: SqliteManager,
137
+ ): Middleware {
138
+ const defaultStrategy = options.defaultStrategy ?? 'pool';
139
+ const defaultTenant = options.defaultTenant ?? normalized[0]?.tenantId ?? 'default';
140
+
141
+ return async (context, next) => {
142
+ const routeHandler = (context as any).routeHandler as
143
+ | { controller: Constructor<unknown>; method: string }
144
+ | undefined;
145
+
146
+ let strategy: 'pool' | 'session' = defaultStrategy;
147
+ if (routeHandler) {
148
+ const routeStrategy = getDbStrategy(
149
+ routeHandler.controller,
150
+ routeHandler.method,
151
+ );
152
+ const hasTx = Boolean(
153
+ Reflect.getMetadata(
154
+ TRANSACTION_METADATA_KEY,
155
+ routeHandler.controller.prototype,
156
+ routeHandler.method,
157
+ ),
158
+ );
159
+ strategy = routeStrategy ?? (hasTx ? 'session' : defaultStrategy);
160
+ }
161
+
162
+ if (strategy !== 'session') {
163
+ return await next();
164
+ }
165
+
166
+ const selected = normalized.find((item) => item.tenantId === defaultTenant) ?? normalized[0];
167
+ if (!selected) {
168
+ return await next();
169
+ }
170
+
171
+ if (selected.config.type === 'sqlite') {
172
+ const sqlite = sqliteManager.getAdapter(selected.tenantId);
173
+ return await runWithSession(
174
+ {
175
+ tenantId: selected.tenantId,
176
+ sqlite,
177
+ },
178
+ async () => await next(),
179
+ );
180
+ }
181
+
182
+ const sql = sqlManager.getOrCreate(selected.tenantId, selected.config);
183
+ let reserved: any;
184
+ const session: DatabaseSession = {
185
+ tenantId: selected.tenantId,
186
+ lazyReserve: async () => {
187
+ if (!reserved) {
188
+ reserved = await sql.reserve();
189
+ session.reserved = reserved;
190
+ }
191
+ return reserved;
192
+ },
193
+ };
194
+
195
+ try {
196
+ return await runWithSession(session, async () => await next());
197
+ } finally {
198
+ if (reserved) {
199
+ await reserved.release().catch(() => undefined);
200
+ }
201
+ }
202
+ };
203
+ }
204
+
28
205
  /**
29
206
  * 创建数据库模块
30
207
  * @param options - 模块配置
@@ -33,8 +210,47 @@ export class DatabaseModule {
33
210
  options: DatabaseModuleOptions,
34
211
  ): typeof DatabaseModule {
35
212
  const providers: ModuleProvider[] = [];
213
+ const normalized = DatabaseModule.normalizeConfig(options);
214
+ const sqlManager = new BunSQLManager();
215
+ const sqliteManager = new SqliteManager();
216
+
217
+ for (const item of normalized) {
218
+ if (item.config.type === 'sqlite') {
219
+ sqliteManager.getOrCreate(item.tenantId, item.config);
220
+ } else {
221
+ sqlManager.getOrCreate(item.tenantId, item.config);
222
+ }
223
+ }
224
+ sqlManager.setDefaultTenant(options.defaultTenant ?? normalized[0]?.tenantId ?? 'default');
225
+ sqliteManager.setDefaultTenant(options.defaultTenant ?? normalized[0]?.tenantId ?? 'default');
226
+
227
+ const legacyOptions: DatabaseModuleOptions = options.database
228
+ ? options
229
+ : {
230
+ ...options,
231
+ database:
232
+ normalized[0]?.config.type === 'sqlite'
233
+ ? {
234
+ type: 'sqlite',
235
+ config: {
236
+ path: (normalized[0].config as SqliteV2Config).database,
237
+ },
238
+ }
239
+ : {
240
+ type: (normalized[0]?.config.type ?? 'postgres') as 'postgres' | 'mysql',
241
+ config: {
242
+ host: options.host ?? 'localhost',
243
+ port: options.port ?? (normalized[0]?.config.type === 'mysql' ? 3306 : 5432),
244
+ database: options.databasePath ?? 'default',
245
+ user: options.username ?? 'root',
246
+ password: options.password ?? '',
247
+ },
248
+ },
249
+ };
36
250
 
37
- const service = new DatabaseService(options);
251
+ const service = new DatabaseService(legacyOptions);
252
+ const transactionManager = new TransactionManager(sqlManager);
253
+ initDbProxy(sqlManager, transactionManager);
38
254
 
39
255
  providers.push(
40
256
  {
@@ -45,7 +261,22 @@ export class DatabaseModule {
45
261
  provide: DATABASE_OPTIONS_TOKEN,
46
262
  useValue: options,
47
263
  },
48
- DatabaseService,
264
+ {
265
+ provide: DatabaseService,
266
+ useValue: service,
267
+ },
268
+ {
269
+ provide: BUN_SQL_MANAGER_TOKEN,
270
+ useValue: sqlManager,
271
+ },
272
+ {
273
+ provide: SQLITE_MANAGER_TOKEN,
274
+ useValue: sqliteManager,
275
+ },
276
+ {
277
+ provide: DB_TOKEN,
278
+ useValue: db,
279
+ },
49
280
  );
50
281
 
51
282
  // 如果启用了 ORM,注册 ORM 服务
@@ -65,13 +296,15 @@ export class DatabaseModule {
65
296
  }
66
297
 
67
298
  // 注册事务管理器(总是注册,即使 ORM 未启用)
68
- const transactionManager = new TransactionManager(service);
69
299
  providers.push(
70
300
  {
71
301
  provide: TRANSACTION_SERVICE_TOKEN,
72
302
  useValue: transactionManager,
73
303
  },
74
- TransactionManager,
304
+ {
305
+ provide: TransactionManager,
306
+ useValue: transactionManager,
307
+ },
75
308
  );
76
309
 
77
310
  // 数据库健康检查指示器可以通过 DatabaseModule.createHealthIndicator() 方法获取
@@ -82,7 +315,13 @@ export class DatabaseModule {
82
315
  Reflect.getMetadata(MODULE_METADATA_KEY, DatabaseModule) || {};
83
316
 
84
317
  // 创建数据库扩展,用于在应用启动时初始化连接
85
- const databaseExtension = new DatabaseExtension();
318
+ const databaseExtension = new DatabaseExtension(sqlManager, sqliteManager);
319
+ const middleware = DatabaseModule.createDatabaseMiddleware(
320
+ options,
321
+ normalized,
322
+ sqlManager,
323
+ sqliteManager,
324
+ );
86
325
 
87
326
  const metadata = {
88
327
  ...existingMetadata,
@@ -102,6 +341,10 @@ export class DatabaseModule {
102
341
  ...(existingMetadata.extensions || []),
103
342
  databaseExtension,
104
343
  ],
344
+ middlewares: [
345
+ ...(existingMetadata.middlewares || []),
346
+ middleware,
347
+ ],
105
348
  };
106
349
  Reflect.defineMetadata(MODULE_METADATA_KEY, metadata, DatabaseModule);
107
350
 
@@ -0,0 +1,75 @@
1
+ import type { BunSQLManager } from './sql-manager';
2
+ import { getCurrentSession } from './database-context';
3
+ import type { TransactionManager } from './orm/transaction-manager';
4
+
5
+ type DbResult = Promise<unknown>;
6
+
7
+ export interface DbProxy {
8
+ (strings: TemplateStringsArray, ...values: unknown[]): DbResult;
9
+ transaction<T>(fn: () => Promise<T>): Promise<T>;
10
+ tenant(tenantId: string): DbProxy;
11
+ }
12
+
13
+ let sqlManagerRef: BunSQLManager | undefined;
14
+ let txManagerRef: TransactionManager | undefined;
15
+
16
+ export function initDbProxy(
17
+ sqlManager: BunSQLManager,
18
+ txManager: TransactionManager,
19
+ ): void {
20
+ sqlManagerRef = sqlManager;
21
+ txManagerRef = txManager;
22
+ }
23
+
24
+ function ensureReady(): { sqlManager: BunSQLManager; txManager: TransactionManager } {
25
+ if (!sqlManagerRef || !txManagerRef) {
26
+ throw new Error(
27
+ '[db] proxy is not initialized. Ensure DatabaseModule.forRoot() is called before using db.',
28
+ );
29
+ }
30
+ return { sqlManager: sqlManagerRef, txManager: txManagerRef };
31
+ }
32
+
33
+ const baseDb = async (
34
+ tenantId: string | undefined,
35
+ strings: TemplateStringsArray,
36
+ ...values: unknown[]
37
+ ): DbResult => {
38
+ const session = getCurrentSession();
39
+ if (session?.reserved) {
40
+ return await session.reserved(strings, ...values);
41
+ }
42
+
43
+ if (session?.lazyReserve) {
44
+ const reserved = await session.lazyReserve();
45
+ return await reserved(strings, ...values);
46
+ }
47
+
48
+ const { sqlManager } = ensureReady();
49
+ if (tenantId) {
50
+ const tenantSql = sqlManager.get(tenantId);
51
+ if (tenantSql) {
52
+ return await tenantSql(strings, ...values);
53
+ }
54
+ }
55
+ return await sqlManager.getDefault()(strings, ...values);
56
+ };
57
+
58
+ function createDb(tenantId?: string): DbProxy {
59
+ const fn = (async (
60
+ strings: TemplateStringsArray,
61
+ ...values: unknown[]
62
+ ) => baseDb(tenantId, strings, ...values)) as DbProxy;
63
+
64
+ fn.transaction = async <T>(txFn: () => Promise<T>): Promise<T> => {
65
+ const { txManager } = ensureReady();
66
+ return await txManager.runInTransaction(txFn);
67
+ };
68
+
69
+ fn.tenant = (id: string): DbProxy => createDb(id);
70
+
71
+ return fn;
72
+ }
73
+
74
+ export const db: DbProxy = createDb();
75
+
@@ -4,9 +4,36 @@ export { DatabaseConnectionManager } from './connection-manager';
4
4
  export { ConnectionPool } from './connection-pool';
5
5
  export { DatabaseHealthIndicator } from './health-indicator';
6
6
  export { DatabaseExtension } from './database-extension';
7
+ export { BunSQLManager } from './sql-manager';
8
+ export { SqliteAdapter, SqliteManager, Semaphore } from './sqlite-adapter';
7
9
  export {
10
+ db,
11
+ initDbProxy,
12
+ type DbProxy,
13
+ } from './db-proxy';
14
+ export {
15
+ DbStrategy,
16
+ Session as DbSession,
17
+ DB_STRATEGY_KEY,
18
+ getDbStrategy,
19
+ type DbStrategyType,
20
+ } from './strategy-decorator';
21
+ export {
22
+ databaseSessionStore,
23
+ getCurrentSession,
24
+ runWithSession,
25
+ type DatabaseSession,
26
+ type TransactionState,
27
+ type ReservedSqlSession,
28
+ } from './database-context';
29
+ export {
30
+ BUN_SQL_MANAGER_TOKEN,
31
+ DB_TOKEN,
8
32
  DATABASE_OPTIONS_TOKEN,
9
33
  DATABASE_SERVICE_TOKEN,
34
+ SQLITE_MANAGER_TOKEN,
35
+ type BunSQLConfig,
36
+ type BunSQLPoolOptions,
10
37
  type ConnectionInfo,
11
38
  type ConnectionPoolOptions,
12
39
  type DatabaseConfig,
@@ -14,7 +41,9 @@ export {
14
41
  type DatabaseType,
15
42
  type MysqlConfig,
16
43
  type PostgresConfig,
44
+ type SqliteV2Config,
17
45
  type SqliteConfig,
46
+ type TenantConfig,
18
47
  } from './types';
19
48
  // ORM 导出
20
49
  export {