pg-manipulator 1.0.6 → 1.0.8
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.
|
@@ -55,7 +55,7 @@ class create_factory {
|
|
|
55
55
|
}
|
|
56
56
|
prepare() {
|
|
57
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
const schema = (yield Promise.resolve(`${
|
|
58
|
+
const schema = (yield Promise.resolve(`${`../../../mapping/${this.database}/${this.table}.js`}`).then(s => __importStar(require(s)))).default;
|
|
59
59
|
let data = {};
|
|
60
60
|
for (let index in schema.columns) {
|
|
61
61
|
let column = schema.columns[index];
|
|
@@ -59,7 +59,7 @@ class select_factory {
|
|
|
59
59
|
this.params.push(param);
|
|
60
60
|
return `$${this.params.length}`;
|
|
61
61
|
}) {
|
|
62
|
-
const schema = (yield Promise.resolve(`${
|
|
62
|
+
const schema = (yield Promise.resolve(`${`../../../mapping/${database}/${table}.js`}`).then(s => __importStar(require(s)))).default;
|
|
63
63
|
if (children_name) {
|
|
64
64
|
addQuery('(SELECT JSON_BUILD_OBJECT(');
|
|
65
65
|
}
|
|
@@ -120,7 +120,7 @@ class select_factory {
|
|
|
120
120
|
prepare() {
|
|
121
121
|
return __awaiter(this, void 0, void 0, function* () {
|
|
122
122
|
var _a;
|
|
123
|
-
this.schema = (yield Promise.resolve(`${
|
|
123
|
+
this.schema = (yield Promise.resolve(`${`../../../mapping/${this.database}/${this.table}.js`}`).then(s => __importStar(require(s)))).default;
|
|
124
124
|
this.params = [];
|
|
125
125
|
this.query += 'SELECT ';
|
|
126
126
|
let initial = true;
|
|
@@ -55,7 +55,7 @@ class update_factory {
|
|
|
55
55
|
}
|
|
56
56
|
prepare() {
|
|
57
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
const schema = (yield Promise.resolve(`${
|
|
58
|
+
const schema = (yield Promise.resolve(`${`../../../mapping/${this.database}/${this.table}.js`}`).then(s => __importStar(require(s)))).default;
|
|
59
59
|
if (!this.fields.where) {
|
|
60
60
|
throw 'Where field not provided';
|
|
61
61
|
}
|
|
@@ -50,7 +50,7 @@ function where(database_1, table_1, fields_1, index_1, addQuery_1, addParam_1) {
|
|
|
50
50
|
return __awaiter(this, arguments, void 0, function* (database, table, fields, index, addQuery, addParam, initialized_clausule = ' WHERE ') {
|
|
51
51
|
initialized = initialized_clausule === ' WHERE ' ? false : true;
|
|
52
52
|
position = index;
|
|
53
|
-
const schema = (yield Promise.resolve(`${
|
|
53
|
+
const schema = (yield Promise.resolve(`${`../../../mapping/${database}/${table}.js`}`).then(s => __importStar(require(s)))).default;
|
|
54
54
|
addQuery(initialized_clausule);
|
|
55
55
|
for (let colum of schema.columns) {
|
|
56
56
|
if (!fields || ['undefined', 'function'].indexOf(typeof fields[colum.name]) > -1) {
|