@dascompany/database 4.0.3 → 4.0.4
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/Connection.d.ts +5 -5
- package/dist/Database.d.ts +2 -2
- package/dist/Database.js +2 -2
- package/package.json +1 -1
package/dist/Connection.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import pg from 'pg';
|
|
2
2
|
import Query from './query/Query';
|
|
3
3
|
export default class Connection {
|
|
4
4
|
private pgPool;
|
|
5
|
-
constructor(pgPool: Pool);
|
|
5
|
+
constructor(pgPool: pg.Pool);
|
|
6
6
|
createQuery(queryString: string): Query;
|
|
7
|
-
beginTransaction(): Promise<PoolClient>;
|
|
8
|
-
commitTransaction(client: PoolClient): Promise<void>;
|
|
9
|
-
rollBackTransaction(client: PoolClient): Promise<void>;
|
|
7
|
+
beginTransaction(): Promise<pg.PoolClient>;
|
|
8
|
+
commitTransaction(client: pg.PoolClient): Promise<void>;
|
|
9
|
+
rollBackTransaction(client: pg.PoolClient): Promise<void>;
|
|
10
10
|
end(): Promise<void>;
|
|
11
11
|
}
|
package/dist/Database.d.ts
CHANGED
package/dist/Database.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import pg from 'pg';
|
|
2
2
|
export default class Database {
|
|
3
3
|
static async connect(connectionConfig) {
|
|
4
4
|
try {
|
|
5
|
-
const pool = new Pool(connectionConfig);
|
|
5
|
+
const pool = new pg.Pool(connectionConfig);
|
|
6
6
|
await pool.query('SELECT 1');
|
|
7
7
|
return pool;
|
|
8
8
|
}
|