@tstdl/base 0.92.72 → 0.92.73
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/orm/server/database.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodePgDatabase } from 'drizzle-orm/node-postgres';
|
|
2
2
|
import { migrate } from 'drizzle-orm/node-postgres/migrator';
|
|
3
|
-
import {
|
|
3
|
+
import type { PoolConfig } from 'pg';
|
|
4
4
|
import type { Resolvable, resolveArgumentType } from '../../injector/interfaces.js';
|
|
5
5
|
export type DatabaseArgument = PoolConfig;
|
|
6
6
|
export declare class Database extends NodePgDatabase<any> implements Resolvable<DatabaseArgument> {
|
package/orm/server/database.js
CHANGED
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { drizzle, NodePgDatabase } from 'drizzle-orm/node-postgres';
|
|
8
8
|
import { migrate } from 'drizzle-orm/node-postgres/migrator';
|
|
9
|
-
import
|
|
9
|
+
import pg from 'pg';
|
|
10
10
|
import { inject, Injector, ReplaceClass } from '../../injector/index.js';
|
|
11
11
|
import { isUndefined } from '../../utils/type-guards.js';
|
|
12
12
|
import { DatabaseConfig } from './module.js';
|
|
@@ -22,7 +22,7 @@ Injector.registerSingleton(Database, {
|
|
|
22
22
|
if (isUndefined(connection)) {
|
|
23
23
|
throw new Error('Missing postgres connection. Provide it either via injection argument or provider.');
|
|
24
24
|
}
|
|
25
|
-
const pool = new Pool(connection);
|
|
25
|
+
const pool = new pg.Pool(connection);
|
|
26
26
|
context.addDisposeHandler(async () => pool.end());
|
|
27
27
|
return drizzle(pool);
|
|
28
28
|
}
|