murmuration-postgresql 1.1.1 → 1.1.3
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/bin/statement.js +5 -15
- package/package.json +2 -2
package/bin/statement.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { Statement: BaseStatement, caseUtilities } = require("murmuration");
|
|
4
4
|
|
|
5
|
-
const {
|
|
6
|
-
{ camelCaseToSnakeCase, snakeCaseToCamelCase } = caseUtilities;
|
|
5
|
+
const { camelCaseToSnakeCase, snakeCaseToCamelCase } = caseUtilities;
|
|
7
6
|
|
|
8
7
|
class Statement extends BaseStatement {
|
|
9
8
|
constructor(connection, sql, query, parameters, oneHandler, noneHandler, manyHandler, elseHandler, firstHandler, errorHandler, successHandler, placeholderIndex) {
|
|
@@ -41,11 +40,12 @@ class Statement extends BaseStatement {
|
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
selectFrom(relation) {
|
|
44
|
-
const sql = `SELECT * FROM "${relation}"
|
|
43
|
+
const sql = `SELECT * FROM "${relation}"`,
|
|
44
|
+
query = true;
|
|
45
45
|
|
|
46
46
|
this.setSQL(sql);
|
|
47
47
|
|
|
48
|
-
this.query
|
|
48
|
+
this.setQuery(query;
|
|
49
49
|
|
|
50
50
|
return this;
|
|
51
51
|
}
|
|
@@ -70,16 +70,6 @@ class Statement extends BaseStatement {
|
|
|
70
70
|
return key;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
execute() {
|
|
74
|
-
const sql = this.getSQL(),
|
|
75
|
-
parameters = this.getParameters(),
|
|
76
|
-
connection = this.getConnection();
|
|
77
|
-
|
|
78
|
-
this.query ?
|
|
79
|
-
query(connection, sql, ...parameters, this.queryHandler) :
|
|
80
|
-
command(connection, sql, ...parameters, this.commandHandler);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
73
|
static fromConnection(Class, connection) {
|
|
84
74
|
if (connection === undefined) {
|
|
85
75
|
connection = Class; ///
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "murmuration-postgresql",
|
|
3
3
|
"author": "James Smith",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.3",
|
|
5
5
|
"license": "MIT, Anti-996",
|
|
6
6
|
"homepage": "https://github.com/djalbat/murmuration-postgresql",
|
|
7
7
|
"description": "Connections, transactions and migrations for PostgreSQL.",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"url": "https://github.com/djalbat/murmuration-postgresql"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"murmuration": "^1.1.
|
|
13
|
+
"murmuration": "^1.1.3",
|
|
14
14
|
"pg": "^8.3.3"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {},
|