@rvoh/dream 0.44.7 → 0.44.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.
- package/dist/cjs/src/bin/index.js +7 -87
- package/dist/cjs/src/dream/LeftJoinLoadBuilder.js +1 -1
- package/dist/cjs/src/dream/LoadBuilder.js +1 -1
- package/dist/cjs/src/dream/Query.js +46 -1417
- package/dist/cjs/src/dream/QueryDriver/Base.js +311 -0
- package/dist/cjs/src/dream/QueryDriver/Kysely.js +1771 -0
- package/dist/cjs/src/dream/QueryDriver/Postgres.js +6 -0
- package/dist/cjs/src/dream/internal/saveDream.js +4 -17
- package/dist/esm/src/bin/index.js +7 -87
- package/dist/esm/src/dream/LeftJoinLoadBuilder.js +1 -1
- package/dist/esm/src/dream/LoadBuilder.js +1 -1
- package/dist/esm/src/dream/Query.js +46 -1417
- package/dist/esm/src/dream/QueryDriver/Base.js +308 -0
- package/dist/esm/src/dream/QueryDriver/Kysely.js +1768 -0
- package/dist/esm/src/dream/QueryDriver/Postgres.js +3 -0
- package/dist/esm/src/dream/internal/saveDream.js +4 -17
- package/dist/types/src/bin/index.d.ts +0 -2
- package/dist/types/src/dream/Query.d.ts +27 -155
- package/dist/types/src/dream/QueryDriver/Base.d.ts +242 -0
- package/dist/types/src/dream/QueryDriver/Kysely.d.ts +354 -0
- package/dist/types/src/dream/QueryDriver/Postgres.d.ts +4 -0
- package/dist/types/src/dream/internal/executeDatabaseQuery.d.ts +2 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/Benchmark.html +2 -2
- package/docs/classes/CalendarDate.html +2 -2
- package/docs/classes/CreateOrFindByFailedToCreateAndFind.html +3 -3
- package/docs/classes/Decorators.html +19 -19
- package/docs/classes/Dream.html +131 -131
- package/docs/classes/DreamApp.html +4 -4
- package/docs/classes/DreamBin.html +3 -4
- package/docs/classes/DreamCLI.html +4 -4
- package/docs/classes/DreamImporter.html +2 -2
- package/docs/classes/DreamLogos.html +2 -2
- package/docs/classes/DreamMigrationHelpers.html +7 -7
- package/docs/classes/DreamSerializerBuilder.html +2 -2
- package/docs/classes/DreamTransaction.html +2 -2
- package/docs/classes/Encrypt.html +2 -2
- package/docs/classes/Env.html +2 -2
- package/docs/classes/GlobalNameNotSet.html +3 -3
- package/docs/classes/NonLoadedAssociation.html +3 -3
- package/docs/classes/ObjectSerializerBuilder.html +2 -2
- package/docs/classes/Query.html +86 -57
- package/docs/classes/Range.html +2 -2
- package/docs/classes/RecordNotFound.html +3 -3
- package/docs/classes/ValidationError.html +3 -3
- package/docs/functions/DreamSerializer.html +1 -1
- package/docs/functions/ObjectSerializer.html +1 -1
- package/docs/functions/ReplicaSafe.html +1 -1
- package/docs/functions/STI.html +1 -1
- package/docs/functions/SoftDelete.html +1 -1
- package/docs/functions/camelize.html +1 -1
- package/docs/functions/capitalize.html +1 -1
- package/docs/functions/cloneDeepSafe.html +1 -1
- package/docs/functions/closeAllDbConnections.html +1 -1
- package/docs/functions/compact.html +1 -1
- package/docs/functions/dreamDbConnections.html +1 -1
- package/docs/functions/dreamPath.html +1 -1
- package/docs/functions/expandStiClasses.html +1 -1
- package/docs/functions/generateDream.html +1 -1
- package/docs/functions/globalClassNameFromFullyQualifiedModelName.html +1 -1
- package/docs/functions/groupBy.html +1 -1
- package/docs/functions/hyphenize.html +1 -1
- package/docs/functions/inferSerializerFromDreamOrViewModel.html +1 -1
- package/docs/functions/inferSerializersFromDreamClassOrViewModelClass.html +1 -1
- package/docs/functions/intersection.html +1 -1
- package/docs/functions/isDreamSerializer.html +1 -1
- package/docs/functions/isEmpty.html +1 -1
- package/docs/functions/loadRepl.html +1 -1
- package/docs/functions/lookupClassByGlobalName.html +1 -1
- package/docs/functions/normalizeUnicode.html +1 -1
- package/docs/functions/pascalize.html +1 -1
- package/docs/functions/pgErrorType.html +1 -1
- package/docs/functions/range-1.html +1 -1
- package/docs/functions/relativeDreamPath.html +1 -1
- package/docs/functions/round.html +1 -1
- package/docs/functions/serializerNameFromFullyQualifiedModelName.html +1 -1
- package/docs/functions/sharedPathPrefix.html +1 -1
- package/docs/functions/snakeify.html +1 -1
- package/docs/functions/sort.html +1 -1
- package/docs/functions/sortBy.html +1 -1
- package/docs/functions/sortObjectByKey.html +1 -1
- package/docs/functions/sortObjectByValue.html +1 -1
- package/docs/functions/standardizeFullyQualifiedModelName.html +1 -1
- package/docs/functions/uncapitalize.html +1 -1
- package/docs/functions/uniq.html +1 -1
- package/docs/functions/untypedDb.html +1 -1
- package/docs/functions/validateColumn.html +1 -1
- package/docs/functions/validateTable.html +1 -1
- package/docs/interfaces/BelongsToStatement.html +2 -2
- package/docs/interfaces/DecoratorContext.html +2 -2
- package/docs/interfaces/DreamAppInitOptions.html +2 -2
- package/docs/interfaces/DreamAppOpts.html +2 -2
- package/docs/interfaces/EncryptOptions.html +2 -2
- package/docs/interfaces/InternalAnyTypedSerializerRendersMany.html +2 -2
- package/docs/interfaces/InternalAnyTypedSerializerRendersOne.html +2 -2
- package/docs/interfaces/OpenapiDescription.html +2 -2
- package/docs/interfaces/OpenapiSchemaProperties.html +1 -1
- package/docs/interfaces/OpenapiSchemaPropertiesShorthand.html +1 -1
- package/docs/interfaces/OpenapiTypeFieldObject.html +1 -1
- package/docs/interfaces/SerializerRendererOpts.html +2 -2
- package/docs/types/Camelized.html +1 -1
- package/docs/types/CommonOpenapiSchemaObjectFields.html +1 -1
- package/docs/types/DateTime.html +1 -1
- package/docs/types/DbConnectionType.html +1 -1
- package/docs/types/DbTypes.html +1 -1
- package/docs/types/DreamAssociationMetadata.html +1 -1
- package/docs/types/DreamAttributes.html +1 -1
- package/docs/types/DreamClassColumn.html +1 -1
- package/docs/types/DreamColumn.html +1 -1
- package/docs/types/DreamColumnNames.html +1 -1
- package/docs/types/DreamLogLevel.html +1 -1
- package/docs/types/DreamLogger.html +1 -1
- package/docs/types/DreamModelSerializerType.html +1 -1
- package/docs/types/DreamOrViewModelClassSerializerKey.html +1 -1
- package/docs/types/DreamOrViewModelSerializerKey.html +1 -1
- package/docs/types/DreamParamSafeAttributes.html +1 -1
- package/docs/types/DreamParamSafeColumnNames.html +1 -1
- package/docs/types/DreamSerializable.html +1 -1
- package/docs/types/DreamSerializableArray.html +1 -1
- package/docs/types/DreamSerializerKey.html +1 -1
- package/docs/types/DreamSerializers.html +1 -1
- package/docs/types/DreamTableSchema.html +1 -1
- package/docs/types/DreamVirtualColumns.html +1 -1
- package/docs/types/EncryptAlgorithm.html +1 -1
- package/docs/types/HasManyStatement.html +1 -1
- package/docs/types/HasOneStatement.html +1 -1
- package/docs/types/Hyphenized.html +1 -1
- package/docs/types/IdType.html +1 -1
- package/docs/types/OpenapiAllTypes.html +1 -1
- package/docs/types/OpenapiFormats.html +1 -1
- package/docs/types/OpenapiNumberFormats.html +1 -1
- package/docs/types/OpenapiPrimitiveBaseTypes.html +1 -1
- package/docs/types/OpenapiPrimitiveTypes.html +1 -1
- package/docs/types/OpenapiSchemaArray.html +1 -1
- package/docs/types/OpenapiSchemaArrayShorthand.html +1 -1
- package/docs/types/OpenapiSchemaBase.html +1 -1
- package/docs/types/OpenapiSchemaBody.html +1 -1
- package/docs/types/OpenapiSchemaBodyShorthand.html +1 -1
- package/docs/types/OpenapiSchemaCommonFields.html +1 -1
- package/docs/types/OpenapiSchemaExpressionAllOf.html +1 -1
- package/docs/types/OpenapiSchemaExpressionAnyOf.html +1 -1
- package/docs/types/OpenapiSchemaExpressionOneOf.html +1 -1
- package/docs/types/OpenapiSchemaExpressionRef.html +1 -1
- package/docs/types/OpenapiSchemaExpressionRefSchemaShorthand.html +1 -1
- package/docs/types/OpenapiSchemaInteger.html +1 -1
- package/docs/types/OpenapiSchemaNull.html +1 -1
- package/docs/types/OpenapiSchemaNumber.html +1 -1
- package/docs/types/OpenapiSchemaObject.html +1 -1
- package/docs/types/OpenapiSchemaObjectAllOf.html +1 -1
- package/docs/types/OpenapiSchemaObjectAllOfShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectAnyOf.html +1 -1
- package/docs/types/OpenapiSchemaObjectAnyOfShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectBase.html +1 -1
- package/docs/types/OpenapiSchemaObjectBaseShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectOneOf.html +1 -1
- package/docs/types/OpenapiSchemaObjectOneOfShorthand.html +1 -1
- package/docs/types/OpenapiSchemaObjectShorthand.html +1 -1
- package/docs/types/OpenapiSchemaPrimitiveGeneric.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionAllOf.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionAnyOf.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionOneOf.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionSerializableRef.html +1 -1
- package/docs/types/OpenapiSchemaShorthandExpressionSerializerRef.html +1 -1
- package/docs/types/OpenapiSchemaShorthandPrimitiveGeneric.html +1 -1
- package/docs/types/OpenapiSchemaString.html +1 -1
- package/docs/types/OpenapiShorthandAllTypes.html +1 -1
- package/docs/types/OpenapiShorthandPrimitiveBaseTypes.html +1 -1
- package/docs/types/OpenapiShorthandPrimitiveTypes.html +1 -1
- package/docs/types/OpenapiTypeField.html +1 -1
- package/docs/types/Pascalized.html +1 -1
- package/docs/types/PrimaryKeyType.html +1 -1
- package/docs/types/RoundingPrecision.html +1 -1
- package/docs/types/SerializerCasing.html +1 -1
- package/docs/types/SimpleObjectSerializerType.html +1 -1
- package/docs/types/Snakeified.html +1 -1
- package/docs/types/Timestamp.html +1 -1
- package/docs/types/UpdateableAssociationProperties.html +1 -1
- package/docs/types/UpdateableProperties.html +1 -1
- package/docs/types/ValidationType.html +1 -1
- package/docs/types/ViewModel.html +1 -1
- package/docs/types/ViewModelClass.html +1 -1
- package/docs/types/WhereStatementForDream.html +1 -1
- package/docs/types/WhereStatementForDreamClass.html +1 -1
- package/docs/variables/DateTime-1.html +1 -1
- package/docs/variables/DreamConst.html +1 -1
- package/docs/variables/TRIGRAM_OPERATORS.html +1 -1
- package/docs/variables/openapiPrimitiveTypes-1.html +1 -1
- package/docs/variables/openapiShorthandPrimitiveTypes-1.html +1 -1
- package/docs/variables/ops.html +1 -1
- package/docs/variables/primaryKeyTypes.html +1 -1
- package/package.json +2 -2
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = saveDream;
|
|
4
|
-
const index_js_1 = require("../../db/index.js");
|
|
5
4
|
const ValidationError_js_1 = require("../../errors/ValidationError.js");
|
|
6
5
|
const DateTime_js_1 = require("../../helpers/DateTime.js");
|
|
7
|
-
const namespaceColumn_js_1 = require("../../helpers/namespaceColumn.js");
|
|
8
6
|
const sqlAttributes_js_1 = require("../../helpers/sqlAttributes.js");
|
|
9
|
-
const
|
|
7
|
+
const Query_js_1 = require("../Query.js");
|
|
10
8
|
const runHooksFor_js_1 = require("./runHooksFor.js");
|
|
11
9
|
async function saveDream(dream, txn = null, { skipHooks = false } = {}) {
|
|
12
|
-
const db = txn?.kyselyTransaction ?? (0, index_js_1.default)('primary');
|
|
13
10
|
const alreadyPersisted = dream.isPersisted;
|
|
14
11
|
if (!skipHooks) {
|
|
15
12
|
if (alreadyPersisted)
|
|
@@ -25,26 +22,16 @@ async function saveDream(dream, txn = null, { skipHooks = false } = {}) {
|
|
|
25
22
|
throw new ValidationError_js_1.default(dream['sanitizedConstructorName'], dream.errors);
|
|
26
23
|
if (alreadyPersisted && !dream.isDirty)
|
|
27
24
|
return dream;
|
|
28
|
-
let query;
|
|
29
25
|
const now = DateTime_js_1.DateTime.now();
|
|
30
26
|
if (!alreadyPersisted && !dream.createdAt && dream.columns().has('createdAt'))
|
|
31
27
|
dream.createdAt = now;
|
|
32
28
|
if (!dream.dirtyAttributes().updatedAt && dream.columns().has('updatedAt'))
|
|
33
29
|
dream.updatedAt = now;
|
|
34
|
-
const
|
|
35
|
-
if (alreadyPersisted) {
|
|
36
|
-
query = db
|
|
37
|
-
.updateTable(dream.table)
|
|
38
|
-
.set(sqlifiedAttributes)
|
|
39
|
-
.where((0, namespaceColumn_js_1.default)(dream.primaryKey, dream.table), '=', dream.primaryKeyValue);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
query = db.insertInto(dream.table).values(sqlifiedAttributes);
|
|
43
|
-
}
|
|
30
|
+
const hasUnsavedData = !!Object.keys((0, sqlAttributes_js_1.default)(dream)).length;
|
|
44
31
|
// BeforeSave/Update actions may clear all the data that we intended to save, leaving us with
|
|
45
32
|
// an invalid update command. The Sortable decorator is an example of this.
|
|
46
|
-
if (!alreadyPersisted ||
|
|
47
|
-
const data = await
|
|
33
|
+
if (!alreadyPersisted || hasUnsavedData) {
|
|
34
|
+
const data = await Query_js_1.default.dbDriverClass().saveDream(dream, txn);
|
|
48
35
|
dream['isPersisted'] = true;
|
|
49
36
|
dream.setAttributes(data);
|
|
50
37
|
}
|
|
@@ -1,79 +1,22 @@
|
|
|
1
1
|
import DreamCLI from '../cli/index.js';
|
|
2
|
-
import
|
|
3
|
-
import EnvInternal from '../helpers/EnvInternal.js';
|
|
4
|
-
import SchemaBuilder from '../helpers/cli/SchemaBuilder.js';
|
|
2
|
+
import Query from '../dream/Query.js';
|
|
5
3
|
import generateDream from '../helpers/cli/generateDream.js';
|
|
6
|
-
import generateMigration from '../helpers/cli/generateMigration.js';
|
|
7
|
-
import createDb from '../helpers/db/createDb.js';
|
|
8
|
-
import _dropDb from '../helpers/db/dropDb.js';
|
|
9
|
-
import loadPgClient from '../helpers/db/loadPgClient.js';
|
|
10
|
-
import runMigration from '../helpers/db/runMigration.js';
|
|
11
4
|
import sspawn from '../helpers/sspawn.js';
|
|
12
|
-
import writeSyncFile from './helpers/sync.js';
|
|
13
5
|
export default class DreamBin {
|
|
14
6
|
static async sync(onSync) {
|
|
15
|
-
|
|
16
|
-
await writeSyncFile();
|
|
17
|
-
DreamCLI.logger.logEndProgress();
|
|
18
|
-
DreamCLI.logger.logStartProgress('building dream schema...');
|
|
19
|
-
await this.buildDreamSchema();
|
|
20
|
-
DreamCLI.logger.logEndProgress();
|
|
21
|
-
// intentionally leaving logs off here, since it allows other
|
|
22
|
-
// onSync handlers to determine their own independent logging approach
|
|
23
|
-
await onSync();
|
|
24
|
-
}
|
|
25
|
-
static async buildDreamSchema() {
|
|
26
|
-
await new SchemaBuilder().build();
|
|
7
|
+
await Query.dbDriverClass().sync(onSync);
|
|
27
8
|
}
|
|
28
9
|
static async dbCreate() {
|
|
29
|
-
|
|
30
|
-
const primaryDbConf = dreamApp.dbConnectionConfig('primary');
|
|
31
|
-
DreamCLI.logger.logStartProgress(`creating ${primaryDbConf.name}...`);
|
|
32
|
-
await createDb('primary');
|
|
33
|
-
DreamCLI.logger.logEndProgress();
|
|
34
|
-
// TODO: add support for creating replicas. Began doing it below, but it is very tricky,
|
|
35
|
-
// and we don't need it at the moment, so kicking off for future development when we have more time
|
|
36
|
-
// to flesh this out.
|
|
37
|
-
// if (connectionRetriever.hasReplicaConfig()) {
|
|
38
|
-
// const replicaDbConf = connectionRetriever.getConnectionConf('replica')
|
|
39
|
-
// console.log(`creating ${process.env[replicaDbConf.name]}`)
|
|
40
|
-
// await createDb('replica')
|
|
41
|
-
// }
|
|
10
|
+
await Query.dbDriverClass().dbCreate();
|
|
42
11
|
}
|
|
43
12
|
static async dbDrop() {
|
|
44
|
-
|
|
45
|
-
const primaryDbConf = dreamApp.dbConnectionConfig('primary');
|
|
46
|
-
DreamCLI.logger.logStartProgress(`dropping ${primaryDbConf.name}...`);
|
|
47
|
-
await _dropDb('primary');
|
|
48
|
-
DreamCLI.logger.logEndProgress();
|
|
49
|
-
// TODO: add support for dropping replicas. Began doing it below, but it is very tricky,
|
|
50
|
-
// and we don't need it at the moment, so kicking off for future development when we have more time
|
|
51
|
-
// to flesh this out.
|
|
52
|
-
// if (connectionRetriever.hasReplicaConfig()) {
|
|
53
|
-
// const replicaDbConf = connectionRetriever.getConnectionConf('replica')
|
|
54
|
-
// console.log(`dropping ${process.env[replicaDbConf.name]}`)
|
|
55
|
-
// await _dropDb('replica')
|
|
56
|
-
// }
|
|
13
|
+
await Query.dbDriverClass().dbDrop();
|
|
57
14
|
}
|
|
58
15
|
static async dbMigrate() {
|
|
59
|
-
|
|
60
|
-
const primaryDbConf = dreamApp.dbConnectionConfig('primary');
|
|
61
|
-
DreamCLI.logger.logStartProgress(`migrating ${primaryDbConf.name}...`);
|
|
62
|
-
await runMigration({ mode: 'migrate' });
|
|
63
|
-
DreamCLI.logger.logEndProgress();
|
|
64
|
-
await this.duplicateDatabase();
|
|
16
|
+
await Query.dbDriverClass().migrate();
|
|
65
17
|
}
|
|
66
18
|
static async dbRollback(opts) {
|
|
67
|
-
|
|
68
|
-
const primaryDbConf = dreamApp.dbConnectionConfig('primary');
|
|
69
|
-
DreamCLI.logger.logStartProgress(`rolling back ${primaryDbConf.name}...`);
|
|
70
|
-
let step = opts.steps;
|
|
71
|
-
while (step > 0) {
|
|
72
|
-
await runMigration({ mode: 'rollback' });
|
|
73
|
-
step -= 1;
|
|
74
|
-
}
|
|
75
|
-
DreamCLI.logger.logEndProgress();
|
|
76
|
-
await this.duplicateDatabase();
|
|
19
|
+
await Query.dbDriverClass().rollback(opts);
|
|
77
20
|
}
|
|
78
21
|
static async generateDream(fullyQualifiedModelName, columnsWithTypes, options) {
|
|
79
22
|
await generateDream({ fullyQualifiedModelName, columnsWithTypes, options });
|
|
@@ -87,7 +30,7 @@ export default class DreamBin {
|
|
|
87
30
|
});
|
|
88
31
|
}
|
|
89
32
|
static async generateMigration(migrationName, columnsWithTypes) {
|
|
90
|
-
await generateMigration(
|
|
33
|
+
await Query.dbDriverClass().generateMigration(migrationName, columnsWithTypes);
|
|
91
34
|
}
|
|
92
35
|
// though this is a private method, it is still used internally.
|
|
93
36
|
// It is only made private so that people don't mistakenly try
|
|
@@ -97,27 +40,4 @@ export default class DreamBin {
|
|
|
97
40
|
await sspawn('yarn typedoc src/index.ts --tsconfig ./tsconfig.esm.build.json --out docs');
|
|
98
41
|
DreamCLI.logger.logEndProgress();
|
|
99
42
|
}
|
|
100
|
-
static async duplicateDatabase() {
|
|
101
|
-
const dreamApp = DreamApp.getOrFail();
|
|
102
|
-
const parallelTests = dreamApp.parallelTests;
|
|
103
|
-
if (!parallelTests)
|
|
104
|
-
return;
|
|
105
|
-
DreamCLI.logger.logStartProgress(`duplicating db for parallel tests...`);
|
|
106
|
-
const dbConf = dreamApp.dbConnectionConfig('primary');
|
|
107
|
-
const client = await loadPgClient({ useSystemDb: true });
|
|
108
|
-
if (EnvInternal.boolean('DREAM_CORE_DEVELOPMENT')) {
|
|
109
|
-
const replicaTestWorkerDatabaseName = `replica_test_${dbConf.name}`;
|
|
110
|
-
DreamCLI.logger.logContinueProgress(`creating fake replica test database ${replicaTestWorkerDatabaseName}...`, { logPrefix: ' ├ [db]', logPrefixColor: 'cyan' });
|
|
111
|
-
await client.query(`DROP DATABASE IF EXISTS ${replicaTestWorkerDatabaseName};`);
|
|
112
|
-
await client.query(`CREATE DATABASE ${replicaTestWorkerDatabaseName} TEMPLATE ${dbConf.name};`);
|
|
113
|
-
}
|
|
114
|
-
for (let i = 2; i <= parallelTests; i++) {
|
|
115
|
-
const workerDatabaseName = `${dbConf.name}_${i}`;
|
|
116
|
-
DreamCLI.logger.logContinueProgress(`creating duplicate test database ${workerDatabaseName} for concurrent tests...`, { logPrefix: ' ├ [db]', logPrefixColor: 'cyan' });
|
|
117
|
-
await client.query(`DROP DATABASE IF EXISTS ${workerDatabaseName};`);
|
|
118
|
-
await client.query(`CREATE DATABASE ${workerDatabaseName} TEMPLATE ${dbConf.name};`);
|
|
119
|
-
}
|
|
120
|
-
await client.end();
|
|
121
|
-
DreamCLI.logger.logEndProgress();
|
|
122
|
-
}
|
|
123
43
|
}
|
|
@@ -65,7 +65,7 @@ export default class LeftJoinLoadBuilder {
|
|
|
65
65
|
const associationMetadata = this.dream['getAssociationMetadata'](associationName);
|
|
66
66
|
if (associationMetadata === undefined)
|
|
67
67
|
throw new UnexpectedUndefined();
|
|
68
|
-
this.query['hydrateAssociation']([this.dream], associationMetadata, this.associationToPreloadedDreamsAndWhatTheyPointTo({
|
|
68
|
+
this.query.dbDriverInstance()['hydrateAssociation']([this.dream], associationMetadata, this.associationToPreloadedDreamsAndWhatTheyPointTo({
|
|
69
69
|
pointsToPrimaryKey: this.dream.primaryKeyValue,
|
|
70
70
|
associatedModels: dreamWithLoadedAssociations[associationName],
|
|
71
71
|
}));
|
|
@@ -59,7 +59,7 @@ export default class LoadBuilder {
|
|
|
59
59
|
if (this.dreamTransaction) {
|
|
60
60
|
this.query = this.query.txn(this.dreamTransaction);
|
|
61
61
|
}
|
|
62
|
-
await this.query['hydratePreload'](this.dream);
|
|
62
|
+
await this.query.dbDriverInstance()['hydratePreload'](this.dream);
|
|
63
63
|
return this.dream;
|
|
64
64
|
}
|
|
65
65
|
}
|