mythix-orm-sql-base 1.1.1 → 1.1.2
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.
|
@@ -426,7 +426,7 @@ class SQLConnectionBase extends ConnectionBase {
|
|
|
426
426
|
// Operation handler
|
|
427
427
|
async (Model, preparedModels, options, queryGenerator) => {
|
|
428
428
|
let sqlStr = queryGenerator.generateInsertStatement(Model, preparedModels, options);
|
|
429
|
-
let results = await this.query(sqlStr,
|
|
429
|
+
let results = await this.query(sqlStr, options);
|
|
430
430
|
|
|
431
431
|
this.updateModelsFromResults(Model, preparedModels.models, results);
|
|
432
432
|
},
|
|
@@ -439,7 +439,7 @@ class SQLConnectionBase extends ConnectionBase {
|
|
|
439
439
|
for (let dirtyModel of dirtyModels) {
|
|
440
440
|
let Model = dirtyModel.getModel();
|
|
441
441
|
let sqlStr = queryGenerator.generateUpdateStatement(Model, dirtyModel, null, options);
|
|
442
|
-
let results = await this.query(sqlStr,
|
|
442
|
+
let results = await this.query(sqlStr, options);
|
|
443
443
|
|
|
444
444
|
this.updateModelsFromResults(Model, [ dirtyModel ], results);
|
|
445
445
|
}
|
|
@@ -484,7 +484,7 @@ class SQLConnectionBase extends ConnectionBase {
|
|
|
484
484
|
if (!sqlStr)
|
|
485
485
|
continue;
|
|
486
486
|
|
|
487
|
-
let results = await this.query(sqlStr,
|
|
487
|
+
let results = await this.query(sqlStr, options);
|
|
488
488
|
this.updateModelsFromResults(Model, [ model ], results);
|
|
489
489
|
}
|
|
490
490
|
},
|
|
@@ -510,7 +510,7 @@ class SQLConnectionBase extends ConnectionBase {
|
|
|
510
510
|
|
|
511
511
|
// TODO: Use "RETURNING" to return pks of of updated rows
|
|
512
512
|
|
|
513
|
-
return await this.query(sqlStr,
|
|
513
|
+
return await this.query(sqlStr, options);
|
|
514
514
|
}
|
|
515
515
|
|
|
516
516
|
async destroyModels(Model, _models, _options) {
|
|
@@ -522,7 +522,7 @@ class SQLConnectionBase extends ConnectionBase {
|
|
|
522
522
|
let queryGenerator = this.getQueryGenerator();
|
|
523
523
|
let sqlStr = queryGenerator.generateDeleteStatement(Model, Model.where.unscoped(), options);
|
|
524
524
|
|
|
525
|
-
return await this.query(sqlStr,
|
|
525
|
+
return await this.query(sqlStr, options);
|
|
526
526
|
}
|
|
527
527
|
|
|
528
528
|
let models = Nife.toArray(_models).filter(Boolean);
|
|
@@ -560,7 +560,7 @@ class SQLConnectionBase extends ConnectionBase {
|
|
|
560
560
|
if (!sqlStr)
|
|
561
561
|
return;
|
|
562
562
|
|
|
563
|
-
await this.query(sqlStr,
|
|
563
|
+
await this.query(sqlStr, options);
|
|
564
564
|
},
|
|
565
565
|
);
|
|
566
566
|
}
|
|
@@ -588,7 +588,7 @@ class SQLConnectionBase extends ConnectionBase {
|
|
|
588
588
|
let options = modelsOrOptions || {};
|
|
589
589
|
let queryGenerator = this.getQueryGenerator();
|
|
590
590
|
let sqlStr = queryGenerator.generateDeleteStatement(rootModel, queryEngine, options);
|
|
591
|
-
return await this.query(sqlStr,
|
|
591
|
+
return await this.query(sqlStr, options);
|
|
592
592
|
}
|
|
593
593
|
|
|
594
594
|
async *select(_queryEngine, _options) {
|
|
@@ -612,7 +612,7 @@ class SQLConnectionBase extends ConnectionBase {
|
|
|
612
612
|
while (true) {
|
|
613
613
|
let query = queryEngine.clone().LIMIT(batchSize).OFFSET(startIndex);
|
|
614
614
|
let sqlStatement = queryGenerator.generateSelectStatement(query, options);
|
|
615
|
-
let result = await this.query(sqlStatement,
|
|
615
|
+
let result = await this.query(sqlStatement, options);
|
|
616
616
|
|
|
617
617
|
if (!result.rows || result.rows.length === 0)
|
|
618
618
|
break;
|