@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.
Files changed (191) hide show
  1. package/dist/cjs/src/bin/index.js +7 -87
  2. package/dist/cjs/src/dream/LeftJoinLoadBuilder.js +1 -1
  3. package/dist/cjs/src/dream/LoadBuilder.js +1 -1
  4. package/dist/cjs/src/dream/Query.js +46 -1417
  5. package/dist/cjs/src/dream/QueryDriver/Base.js +311 -0
  6. package/dist/cjs/src/dream/QueryDriver/Kysely.js +1771 -0
  7. package/dist/cjs/src/dream/QueryDriver/Postgres.js +6 -0
  8. package/dist/cjs/src/dream/internal/saveDream.js +4 -17
  9. package/dist/esm/src/bin/index.js +7 -87
  10. package/dist/esm/src/dream/LeftJoinLoadBuilder.js +1 -1
  11. package/dist/esm/src/dream/LoadBuilder.js +1 -1
  12. package/dist/esm/src/dream/Query.js +46 -1417
  13. package/dist/esm/src/dream/QueryDriver/Base.js +308 -0
  14. package/dist/esm/src/dream/QueryDriver/Kysely.js +1768 -0
  15. package/dist/esm/src/dream/QueryDriver/Postgres.js +3 -0
  16. package/dist/esm/src/dream/internal/saveDream.js +4 -17
  17. package/dist/types/src/bin/index.d.ts +0 -2
  18. package/dist/types/src/dream/Query.d.ts +27 -155
  19. package/dist/types/src/dream/QueryDriver/Base.d.ts +242 -0
  20. package/dist/types/src/dream/QueryDriver/Kysely.d.ts +354 -0
  21. package/dist/types/src/dream/QueryDriver/Postgres.d.ts +4 -0
  22. package/dist/types/src/dream/internal/executeDatabaseQuery.d.ts +2 -1
  23. package/docs/assets/search.js +1 -1
  24. package/docs/classes/Benchmark.html +2 -2
  25. package/docs/classes/CalendarDate.html +2 -2
  26. package/docs/classes/CreateOrFindByFailedToCreateAndFind.html +3 -3
  27. package/docs/classes/Decorators.html +19 -19
  28. package/docs/classes/Dream.html +131 -131
  29. package/docs/classes/DreamApp.html +4 -4
  30. package/docs/classes/DreamBin.html +3 -4
  31. package/docs/classes/DreamCLI.html +4 -4
  32. package/docs/classes/DreamImporter.html +2 -2
  33. package/docs/classes/DreamLogos.html +2 -2
  34. package/docs/classes/DreamMigrationHelpers.html +7 -7
  35. package/docs/classes/DreamSerializerBuilder.html +2 -2
  36. package/docs/classes/DreamTransaction.html +2 -2
  37. package/docs/classes/Encrypt.html +2 -2
  38. package/docs/classes/Env.html +2 -2
  39. package/docs/classes/GlobalNameNotSet.html +3 -3
  40. package/docs/classes/NonLoadedAssociation.html +3 -3
  41. package/docs/classes/ObjectSerializerBuilder.html +2 -2
  42. package/docs/classes/Query.html +86 -57
  43. package/docs/classes/Range.html +2 -2
  44. package/docs/classes/RecordNotFound.html +3 -3
  45. package/docs/classes/ValidationError.html +3 -3
  46. package/docs/functions/DreamSerializer.html +1 -1
  47. package/docs/functions/ObjectSerializer.html +1 -1
  48. package/docs/functions/ReplicaSafe.html +1 -1
  49. package/docs/functions/STI.html +1 -1
  50. package/docs/functions/SoftDelete.html +1 -1
  51. package/docs/functions/camelize.html +1 -1
  52. package/docs/functions/capitalize.html +1 -1
  53. package/docs/functions/cloneDeepSafe.html +1 -1
  54. package/docs/functions/closeAllDbConnections.html +1 -1
  55. package/docs/functions/compact.html +1 -1
  56. package/docs/functions/dreamDbConnections.html +1 -1
  57. package/docs/functions/dreamPath.html +1 -1
  58. package/docs/functions/expandStiClasses.html +1 -1
  59. package/docs/functions/generateDream.html +1 -1
  60. package/docs/functions/globalClassNameFromFullyQualifiedModelName.html +1 -1
  61. package/docs/functions/groupBy.html +1 -1
  62. package/docs/functions/hyphenize.html +1 -1
  63. package/docs/functions/inferSerializerFromDreamOrViewModel.html +1 -1
  64. package/docs/functions/inferSerializersFromDreamClassOrViewModelClass.html +1 -1
  65. package/docs/functions/intersection.html +1 -1
  66. package/docs/functions/isDreamSerializer.html +1 -1
  67. package/docs/functions/isEmpty.html +1 -1
  68. package/docs/functions/loadRepl.html +1 -1
  69. package/docs/functions/lookupClassByGlobalName.html +1 -1
  70. package/docs/functions/normalizeUnicode.html +1 -1
  71. package/docs/functions/pascalize.html +1 -1
  72. package/docs/functions/pgErrorType.html +1 -1
  73. package/docs/functions/range-1.html +1 -1
  74. package/docs/functions/relativeDreamPath.html +1 -1
  75. package/docs/functions/round.html +1 -1
  76. package/docs/functions/serializerNameFromFullyQualifiedModelName.html +1 -1
  77. package/docs/functions/sharedPathPrefix.html +1 -1
  78. package/docs/functions/snakeify.html +1 -1
  79. package/docs/functions/sort.html +1 -1
  80. package/docs/functions/sortBy.html +1 -1
  81. package/docs/functions/sortObjectByKey.html +1 -1
  82. package/docs/functions/sortObjectByValue.html +1 -1
  83. package/docs/functions/standardizeFullyQualifiedModelName.html +1 -1
  84. package/docs/functions/uncapitalize.html +1 -1
  85. package/docs/functions/uniq.html +1 -1
  86. package/docs/functions/untypedDb.html +1 -1
  87. package/docs/functions/validateColumn.html +1 -1
  88. package/docs/functions/validateTable.html +1 -1
  89. package/docs/interfaces/BelongsToStatement.html +2 -2
  90. package/docs/interfaces/DecoratorContext.html +2 -2
  91. package/docs/interfaces/DreamAppInitOptions.html +2 -2
  92. package/docs/interfaces/DreamAppOpts.html +2 -2
  93. package/docs/interfaces/EncryptOptions.html +2 -2
  94. package/docs/interfaces/InternalAnyTypedSerializerRendersMany.html +2 -2
  95. package/docs/interfaces/InternalAnyTypedSerializerRendersOne.html +2 -2
  96. package/docs/interfaces/OpenapiDescription.html +2 -2
  97. package/docs/interfaces/OpenapiSchemaProperties.html +1 -1
  98. package/docs/interfaces/OpenapiSchemaPropertiesShorthand.html +1 -1
  99. package/docs/interfaces/OpenapiTypeFieldObject.html +1 -1
  100. package/docs/interfaces/SerializerRendererOpts.html +2 -2
  101. package/docs/types/Camelized.html +1 -1
  102. package/docs/types/CommonOpenapiSchemaObjectFields.html +1 -1
  103. package/docs/types/DateTime.html +1 -1
  104. package/docs/types/DbConnectionType.html +1 -1
  105. package/docs/types/DbTypes.html +1 -1
  106. package/docs/types/DreamAssociationMetadata.html +1 -1
  107. package/docs/types/DreamAttributes.html +1 -1
  108. package/docs/types/DreamClassColumn.html +1 -1
  109. package/docs/types/DreamColumn.html +1 -1
  110. package/docs/types/DreamColumnNames.html +1 -1
  111. package/docs/types/DreamLogLevel.html +1 -1
  112. package/docs/types/DreamLogger.html +1 -1
  113. package/docs/types/DreamModelSerializerType.html +1 -1
  114. package/docs/types/DreamOrViewModelClassSerializerKey.html +1 -1
  115. package/docs/types/DreamOrViewModelSerializerKey.html +1 -1
  116. package/docs/types/DreamParamSafeAttributes.html +1 -1
  117. package/docs/types/DreamParamSafeColumnNames.html +1 -1
  118. package/docs/types/DreamSerializable.html +1 -1
  119. package/docs/types/DreamSerializableArray.html +1 -1
  120. package/docs/types/DreamSerializerKey.html +1 -1
  121. package/docs/types/DreamSerializers.html +1 -1
  122. package/docs/types/DreamTableSchema.html +1 -1
  123. package/docs/types/DreamVirtualColumns.html +1 -1
  124. package/docs/types/EncryptAlgorithm.html +1 -1
  125. package/docs/types/HasManyStatement.html +1 -1
  126. package/docs/types/HasOneStatement.html +1 -1
  127. package/docs/types/Hyphenized.html +1 -1
  128. package/docs/types/IdType.html +1 -1
  129. package/docs/types/OpenapiAllTypes.html +1 -1
  130. package/docs/types/OpenapiFormats.html +1 -1
  131. package/docs/types/OpenapiNumberFormats.html +1 -1
  132. package/docs/types/OpenapiPrimitiveBaseTypes.html +1 -1
  133. package/docs/types/OpenapiPrimitiveTypes.html +1 -1
  134. package/docs/types/OpenapiSchemaArray.html +1 -1
  135. package/docs/types/OpenapiSchemaArrayShorthand.html +1 -1
  136. package/docs/types/OpenapiSchemaBase.html +1 -1
  137. package/docs/types/OpenapiSchemaBody.html +1 -1
  138. package/docs/types/OpenapiSchemaBodyShorthand.html +1 -1
  139. package/docs/types/OpenapiSchemaCommonFields.html +1 -1
  140. package/docs/types/OpenapiSchemaExpressionAllOf.html +1 -1
  141. package/docs/types/OpenapiSchemaExpressionAnyOf.html +1 -1
  142. package/docs/types/OpenapiSchemaExpressionOneOf.html +1 -1
  143. package/docs/types/OpenapiSchemaExpressionRef.html +1 -1
  144. package/docs/types/OpenapiSchemaExpressionRefSchemaShorthand.html +1 -1
  145. package/docs/types/OpenapiSchemaInteger.html +1 -1
  146. package/docs/types/OpenapiSchemaNull.html +1 -1
  147. package/docs/types/OpenapiSchemaNumber.html +1 -1
  148. package/docs/types/OpenapiSchemaObject.html +1 -1
  149. package/docs/types/OpenapiSchemaObjectAllOf.html +1 -1
  150. package/docs/types/OpenapiSchemaObjectAllOfShorthand.html +1 -1
  151. package/docs/types/OpenapiSchemaObjectAnyOf.html +1 -1
  152. package/docs/types/OpenapiSchemaObjectAnyOfShorthand.html +1 -1
  153. package/docs/types/OpenapiSchemaObjectBase.html +1 -1
  154. package/docs/types/OpenapiSchemaObjectBaseShorthand.html +1 -1
  155. package/docs/types/OpenapiSchemaObjectOneOf.html +1 -1
  156. package/docs/types/OpenapiSchemaObjectOneOfShorthand.html +1 -1
  157. package/docs/types/OpenapiSchemaObjectShorthand.html +1 -1
  158. package/docs/types/OpenapiSchemaPrimitiveGeneric.html +1 -1
  159. package/docs/types/OpenapiSchemaShorthandExpressionAllOf.html +1 -1
  160. package/docs/types/OpenapiSchemaShorthandExpressionAnyOf.html +1 -1
  161. package/docs/types/OpenapiSchemaShorthandExpressionOneOf.html +1 -1
  162. package/docs/types/OpenapiSchemaShorthandExpressionSerializableRef.html +1 -1
  163. package/docs/types/OpenapiSchemaShorthandExpressionSerializerRef.html +1 -1
  164. package/docs/types/OpenapiSchemaShorthandPrimitiveGeneric.html +1 -1
  165. package/docs/types/OpenapiSchemaString.html +1 -1
  166. package/docs/types/OpenapiShorthandAllTypes.html +1 -1
  167. package/docs/types/OpenapiShorthandPrimitiveBaseTypes.html +1 -1
  168. package/docs/types/OpenapiShorthandPrimitiveTypes.html +1 -1
  169. package/docs/types/OpenapiTypeField.html +1 -1
  170. package/docs/types/Pascalized.html +1 -1
  171. package/docs/types/PrimaryKeyType.html +1 -1
  172. package/docs/types/RoundingPrecision.html +1 -1
  173. package/docs/types/SerializerCasing.html +1 -1
  174. package/docs/types/SimpleObjectSerializerType.html +1 -1
  175. package/docs/types/Snakeified.html +1 -1
  176. package/docs/types/Timestamp.html +1 -1
  177. package/docs/types/UpdateableAssociationProperties.html +1 -1
  178. package/docs/types/UpdateableProperties.html +1 -1
  179. package/docs/types/ValidationType.html +1 -1
  180. package/docs/types/ViewModel.html +1 -1
  181. package/docs/types/ViewModelClass.html +1 -1
  182. package/docs/types/WhereStatementForDream.html +1 -1
  183. package/docs/types/WhereStatementForDreamClass.html +1 -1
  184. package/docs/variables/DateTime-1.html +1 -1
  185. package/docs/variables/DreamConst.html +1 -1
  186. package/docs/variables/TRIGRAM_OPERATORS.html +1 -1
  187. package/docs/variables/openapiPrimitiveTypes-1.html +1 -1
  188. package/docs/variables/openapiShorthandPrimitiveTypes-1.html +1 -1
  189. package/docs/variables/ops.html +1 -1
  190. package/docs/variables/primaryKeyTypes.html +1 -1
  191. package/package.json +2 -2
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Kysely_js_1 = require("./Kysely.js");
4
+ class PostgresQueryDriver extends Kysely_js_1.default {
5
+ }
6
+ exports.default = PostgresQueryDriver;
@@ -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 executeDatabaseQuery_js_1 = require("./executeDatabaseQuery.js");
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 sqlifiedAttributes = (0, sqlAttributes_js_1.default)(dream);
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 || Object.keys(sqlifiedAttributes).length) {
47
- const data = await (0, executeDatabaseQuery_js_1.default)(query.returning([...dream.columns()]), 'executeTakeFirstOrThrow');
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 DreamApp from '../dream-app/index.js';
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
- DreamCLI.logger.logStartProgress('writing db schema...');
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
- const dreamApp = DreamApp.getOrFail();
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
- const dreamApp = DreamApp.getOrFail();
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
- const dreamApp = DreamApp.getOrFail();
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
- const dreamApp = DreamApp.getOrFail();
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({ migrationName, columnsWithTypes });
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
  }