@travetto/model-postgres 5.0.17 → 5.0.19
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/LICENSE +1 -1
- package/package.json +7 -7
- package/src/connection.ts +2 -2
- package/support/service.postgresql.ts +1 -1
package/LICENSE
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model-postgres",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.19",
|
|
4
4
|
"description": "PostgreSQL backing for the travetto model module, with real-time modeling support for SQL schemas.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sql",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"directory": "module/model-postgres"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@travetto/cli": "^5.0.
|
|
31
|
-
"@travetto/config": "^5.0.
|
|
32
|
-
"@travetto/context": "^5.0.
|
|
33
|
-
"@travetto/model": "^5.0.
|
|
34
|
-
"@travetto/model-query": "^5.0.
|
|
35
|
-
"@travetto/model-sql": "^5.0.
|
|
30
|
+
"@travetto/cli": "^5.0.18",
|
|
31
|
+
"@travetto/config": "^5.0.15",
|
|
32
|
+
"@travetto/context": "^5.0.15",
|
|
33
|
+
"@travetto/model": "^5.0.16",
|
|
34
|
+
"@travetto/model-query": "^5.0.16",
|
|
35
|
+
"@travetto/model-sql": "^5.0.19",
|
|
36
36
|
"@types/pg": "^8.11.10",
|
|
37
37
|
"pg": "^8.13.1"
|
|
38
38
|
},
|
package/src/connection.ts
CHANGED
|
@@ -49,10 +49,10 @@ export class PostgreSQLConnection extends Connection<PoolClient> {
|
|
|
49
49
|
ShutdownManager.onGracefulShutdown(() => this.#pool.end(), this);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
async execute<T = unknown>(conn: PoolClient, query: string): Promise<{ count: number, records: T[] }> {
|
|
52
|
+
async execute<T = unknown>(conn: PoolClient, query: string, values?: unknown[]): Promise<{ count: number, records: T[] }> {
|
|
53
53
|
console.debug('Executing query', { query });
|
|
54
54
|
try {
|
|
55
|
-
const out = await conn.query(query);
|
|
55
|
+
const out = await conn.query(query, values);
|
|
56
56
|
const records: T[] = [...out.rows].map(v => ({ ...v }));
|
|
57
57
|
return { count: out.rowCount!, records };
|
|
58
58
|
} catch (err) {
|