@rvoh/dream 2.35.0 → 2.36.0
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/README.md +2 -2
- package/dist/cjs/src/Dream.js +258 -55
- package/dist/cjs/src/bin/index.js +13 -0
- package/dist/cjs/src/cli/index.js +28 -17
- package/dist/cjs/src/db/migration-helpers/DreamMigrationHelpers.js +23 -21
- package/dist/cjs/src/decorators/Decorators.js +26 -4
- package/dist/cjs/src/decorators/field/Encrypted.js +30 -6
- package/dist/cjs/src/dream/DreamClassTransactionBuilder.js +6 -6
- package/dist/cjs/src/dream/DreamInstanceTransactionBuilder.js +63 -27
- package/dist/cjs/src/dream/LeftJoinLoadBuilder.js +3 -3
- package/dist/cjs/src/dream/LoadBuilder.js +1 -1
- package/dist/cjs/src/dream/Query.js +542 -167
- package/dist/cjs/src/dream/QueryDriver/Base.js +72 -0
- package/dist/cjs/src/dream/QueryDriver/Kysely.js +216 -50
- package/dist/cjs/src/dream/internal/associations/assertRecognizedAssociationConditionKeys.js +48 -0
- package/dist/cjs/src/dream/internal/associations/associationQuery.js +4 -0
- package/dist/cjs/src/dream/internal/reload.js +6 -1
- package/dist/cjs/src/dream/internal/saveDream.js +8 -2
- package/dist/cjs/src/dream/internal/sqlResultToDreamInstance.js +2 -0
- package/dist/cjs/src/dream/internal/undestroyDream.js +1 -1
- package/dist/cjs/src/dream-app/index.js +38 -0
- package/dist/cjs/src/encrypt/InternalEncrypt.js +49 -4
- package/dist/cjs/src/encrypt/defaultEncryptedColumnName.js +10 -0
- package/dist/cjs/src/encrypt/index.js +76 -9
- package/dist/cjs/src/errors/DoNotSetEncryptedFieldsDirectly.js +4 -0
- package/dist/cjs/src/errors/associations/UnrecognizedAssociationConditionKeys.js +25 -0
- package/dist/cjs/src/helpers/Env.js +28 -0
- package/dist/cjs/src/helpers/cli/generateDreamContent.js +2 -1
- package/dist/cjs/src/helpers/cli/generateFactoryContent.js +1 -1
- package/dist/cjs/src/helpers/cli/generateMigrationContent.js +9 -9
- package/dist/cjs/src/helpers/cli/generateSerializerContent.js +21 -8
- package/dist/cjs/src/serializer/SerializerRenderer.js +65 -13
- package/dist/cjs/src/serializer/builders/DreamSerializerBuilder.js +54 -38
- package/dist/cjs/src/serializer/builders/ObjectSerializerBuilder.js +34 -14
- package/dist/cjs/src/serializer/helpers/serializersForAssociatedClass.js +43 -0
- package/dist/esm/src/Dream.js +258 -55
- package/dist/esm/src/bin/index.js +13 -0
- package/dist/esm/src/cli/index.js +28 -17
- package/dist/esm/src/db/migration-helpers/DreamMigrationHelpers.js +23 -21
- package/dist/esm/src/decorators/Decorators.js +26 -4
- package/dist/esm/src/decorators/field/Encrypted.js +30 -6
- package/dist/esm/src/dream/DreamClassTransactionBuilder.js +6 -6
- package/dist/esm/src/dream/DreamInstanceTransactionBuilder.js +63 -27
- package/dist/esm/src/dream/LeftJoinLoadBuilder.js +3 -3
- package/dist/esm/src/dream/LoadBuilder.js +1 -1
- package/dist/esm/src/dream/Query.js +542 -167
- package/dist/esm/src/dream/QueryDriver/Base.js +72 -0
- package/dist/esm/src/dream/QueryDriver/Kysely.js +216 -50
- package/dist/esm/src/dream/internal/associations/assertRecognizedAssociationConditionKeys.js +48 -0
- package/dist/esm/src/dream/internal/associations/associationQuery.js +4 -0
- package/dist/esm/src/dream/internal/reload.js +6 -1
- package/dist/esm/src/dream/internal/saveDream.js +8 -2
- package/dist/esm/src/dream/internal/sqlResultToDreamInstance.js +2 -0
- package/dist/esm/src/dream/internal/undestroyDream.js +1 -1
- package/dist/esm/src/dream-app/index.js +38 -0
- package/dist/esm/src/encrypt/InternalEncrypt.js +49 -4
- package/dist/esm/src/encrypt/defaultEncryptedColumnName.js +10 -0
- package/dist/esm/src/encrypt/index.js +76 -9
- package/dist/esm/src/errors/DoNotSetEncryptedFieldsDirectly.js +4 -0
- package/dist/esm/src/errors/associations/UnrecognizedAssociationConditionKeys.js +25 -0
- package/dist/esm/src/helpers/Env.js +28 -0
- package/dist/esm/src/helpers/cli/generateDreamContent.js +2 -1
- package/dist/esm/src/helpers/cli/generateFactoryContent.js +1 -1
- package/dist/esm/src/helpers/cli/generateMigrationContent.js +9 -9
- package/dist/esm/src/helpers/cli/generateSerializerContent.js +21 -8
- package/dist/esm/src/serializer/SerializerRenderer.js +65 -13
- package/dist/esm/src/serializer/builders/DreamSerializerBuilder.js +54 -38
- package/dist/esm/src/serializer/builders/ObjectSerializerBuilder.js +34 -14
- package/dist/esm/src/serializer/helpers/serializersForAssociatedClass.js +43 -0
- package/dist/types/src/Dream.d.ts +206 -42
- package/dist/types/src/bin/index.d.ts +7 -1
- package/dist/types/src/cli/index.d.ts +13 -0
- package/dist/types/src/db/migration-helpers/DreamMigrationHelpers.d.ts +2 -2
- package/dist/types/src/decorators/Decorators.d.ts +26 -3
- package/dist/types/src/decorators/field/Encrypted.d.ts +6 -1
- package/dist/types/src/dream/DreamClassTransactionBuilder.d.ts +9 -9
- package/dist/types/src/dream/DreamInstanceTransactionBuilder.d.ts +52 -25
- package/dist/types/src/dream/LeftJoinLoadBuilder.d.ts +4 -4
- package/dist/types/src/dream/LoadBuilder.d.ts +1 -1
- package/dist/types/src/dream/Query.d.ts +272 -33
- package/dist/types/src/dream/QueryDriver/Base.d.ts +63 -1
- package/dist/types/src/dream/QueryDriver/Kysely.d.ts +85 -1
- package/dist/types/src/dream/internal/associations/assertRecognizedAssociationConditionKeys.d.ts +29 -0
- package/dist/types/src/dream-app/index.d.ts +56 -2
- package/dist/types/src/encrypt/InternalEncrypt.d.ts +20 -1
- package/dist/types/src/encrypt/defaultEncryptedColumnName.d.ts +7 -0
- package/dist/types/src/encrypt/index.d.ts +75 -6
- package/dist/types/src/errors/associations/UnrecognizedAssociationConditionKeys.d.ts +8 -0
- package/dist/types/src/helpers/Env.d.ts +28 -0
- package/dist/types/src/package-exports/openapi.d.ts +1 -1
- package/dist/types/src/package-exports/types.d.ts +2 -2
- package/dist/types/src/serializer/SerializerRenderer.d.ts +13 -0
- package/dist/types/src/serializer/builders/DreamSerializerBuilder.d.ts +59 -55
- package/dist/types/src/serializer/builders/ObjectSerializerBuilder.d.ts +40 -19
- package/dist/types/src/serializer/helpers/serializersForAssociatedClass.d.ts +17 -0
- package/dist/types/src/types/lifecycle.d.ts +6 -0
- package/dist/types/src/types/openapi.d.ts +52 -29
- package/dist/types/src/types/serializer.d.ts +43 -2
- package/dist/types/src/types/types/lifecycle.ts +6 -0
- package/dist/types/src/types/types/openapi.ts +51 -37
- package/dist/types/src/types/types/serializer.ts +62 -2
- package/dist/types/src/types/types/variadic.ts +99 -43
- package/dist/types/src/types/variadic.d.ts +29 -3
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/highlight.css +4 -11
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/db.DreamMigrationHelpers.html +13 -13
- package/docs/classes/db.KyselyQueryDriver.html +85 -46
- package/docs/classes/db.PostgresQueryDriver.html +86 -47
- package/docs/classes/db.QueryDriverBase.html +84 -45
- package/docs/classes/errors.CannotSaveMissingDream.html +2 -2
- package/docs/classes/errors.CheckConstraintViolation.html +3 -3
- package/docs/classes/errors.ColumnOverflow.html +3 -3
- package/docs/classes/errors.CreateOrFindByFailedToCreateAndFind.html +3 -3
- package/docs/classes/errors.DataIncompatibleWithDatabaseField.html +3 -3
- package/docs/classes/errors.DataTypeColumnTypeMismatch.html +3 -3
- package/docs/classes/errors.DecryptionError.html +2 -2
- package/docs/classes/errors.DecryptionParseError.html +2 -2
- package/docs/classes/errors.DecryptionRotationError.html +3 -3
- package/docs/classes/errors.GlobalNameNotSet.html +3 -3
- package/docs/classes/errors.InvalidCalendarDate.html +2 -2
- package/docs/classes/errors.InvalidClockTime.html +2 -2
- package/docs/classes/errors.InvalidClockTimeTz.html +2 -2
- package/docs/classes/errors.InvalidDateTime.html +2 -2
- package/docs/classes/errors.MissingSerializersDefinition.html +3 -3
- package/docs/classes/errors.NonLoadedAssociation.html +3 -3
- package/docs/classes/errors.NotNullViolation.html +3 -3
- package/docs/classes/errors.RecordNotFound.html +3 -3
- package/docs/classes/errors.SortableScopeDidNotStabilize.html +3 -3
- package/docs/classes/errors.SortableScopeLockWaitTimedOut.html +3 -3
- package/docs/classes/errors.ValidationError.html +3 -3
- package/docs/classes/index.CalendarDate.html +33 -33
- package/docs/classes/index.ClockTime.html +32 -32
- package/docs/classes/index.ClockTimeTz.html +35 -35
- package/docs/classes/index.DateTime.html +86 -86
- package/docs/classes/index.Decorators.html +37 -23
- package/docs/classes/index.Dream.html +270 -142
- package/docs/classes/index.DreamApp.html +40 -10
- package/docs/classes/index.DreamTransaction.html +3 -3
- package/docs/classes/index.Env.html +16 -2
- package/docs/classes/index.Query.html +331 -129
- package/docs/classes/system.CliFileWriter.html +4 -4
- package/docs/classes/system.DreamBin.html +6 -2
- package/docs/classes/system.DreamCLI.html +7 -7
- package/docs/classes/system.DreamImporter.html +2 -2
- package/docs/classes/system.DreamLogos.html +2 -2
- package/docs/classes/system.DreamSerializerBuilder.html +52 -34
- package/docs/classes/system.ObjectSerializerBuilder.html +41 -22
- package/docs/classes/system.PathHelpers.html +4 -4
- package/docs/classes/utils.Encrypt.html +54 -10
- package/docs/classes/utils.Range.html +2 -2
- package/docs/functions/db.closeAllDbConnections.html +1 -1
- package/docs/functions/db.dreamDbConnections.html +1 -1
- package/docs/functions/db.untypedDb.html +1 -1
- package/docs/functions/db.validateColumn.html +1 -1
- package/docs/functions/db.validateTable.html +1 -1
- package/docs/functions/errors.pgErrorType.html +1 -1
- package/docs/functions/index.DreamSerializer.html +1 -1
- package/docs/functions/index.ObjectSerializer.html +1 -1
- package/docs/functions/index.ReplicaSafe.html +1 -1
- package/docs/functions/index.STI.html +1 -1
- package/docs/functions/index.SoftDelete.html +1 -1
- package/docs/functions/utils.camelize.html +1 -1
- package/docs/functions/utils.capitalize.html +1 -1
- package/docs/functions/utils.cloneDeepSafe.html +1 -1
- package/docs/functions/utils.compact.html +1 -1
- package/docs/functions/utils.groupBy.html +1 -1
- package/docs/functions/utils.hyphenize.html +1 -1
- package/docs/functions/utils.intersection.html +1 -1
- package/docs/functions/utils.isEmpty.html +1 -1
- package/docs/functions/utils.normalizeUnicode.html +1 -1
- package/docs/functions/utils.pascalize.html +1 -1
- package/docs/functions/utils.percent.html +1 -1
- package/docs/functions/utils.range.html +1 -1
- package/docs/functions/utils.round.html +1 -1
- package/docs/functions/utils.sanitizeString.html +1 -1
- package/docs/functions/utils.snakeify.html +1 -1
- package/docs/functions/utils.sort.html +1 -1
- package/docs/functions/utils.sortBy.html +1 -1
- package/docs/functions/utils.sortObjectByKey.html +1 -1
- package/docs/functions/utils.sortObjectByValue.html +1 -1
- package/docs/functions/utils.uncapitalize.html +1 -1
- package/docs/functions/utils.uniq.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interfaces/openapi.OpenapiDescription.html +2 -2
- package/docs/interfaces/openapi.OpenapiSchemaProperties.html +1 -1
- package/docs/interfaces/openapi.OpenapiSchemaPropertiesShorthand.html +1 -1
- package/docs/interfaces/openapi.OpenapiTypeFieldObject.html +1 -1
- package/docs/interfaces/types.BelongsToStatement.html +2 -2
- package/docs/interfaces/types.DecoratorContext.html +2 -2
- package/docs/interfaces/types.DecryptCallbacks.html +6 -0
- package/docs/interfaces/types.DreamAppInitOptions.html +2 -2
- package/docs/interfaces/types.DreamAppOpts.html +2 -2
- package/docs/interfaces/types.DreamDbConfig.html +6 -6
- package/docs/interfaces/types.DurationObject.html +2 -2
- package/docs/interfaces/types.EncryptOptions.html +2 -2
- package/docs/interfaces/types.EncryptionLegacyKeyUsedEvent.html +10 -0
- package/docs/interfaces/types.InternalAnyTypedSerializerRendersMany.html +2 -2
- package/docs/interfaces/types.InternalAnyTypedSerializerRendersOne.html +2 -2
- package/docs/interfaces/types.SerializerRendererOpts.html +2 -2
- package/docs/modules/openapi.html +1 -1
- package/docs/modules/types.html +1 -1
- package/docs/types/openapi.CommonOpenapiSchemaObjectFields.html +1 -1
- package/docs/types/openapi.OpenapiAllTypes.html +1 -1
- package/docs/types/openapi.OpenapiFormats.html +1 -1
- package/docs/types/openapi.OpenapiNumberFormats.html +1 -1
- package/docs/types/openapi.OpenapiPrimitiveBaseTypes.html +1 -1
- package/docs/types/openapi.OpenapiPrimitiveTypes.html +1 -1
- package/docs/types/openapi.OpenapiSchemaArray.html +1 -1
- package/docs/types/openapi.OpenapiSchemaArrayShorthand.html +1 -1
- package/docs/types/openapi.OpenapiSchemaBase.html +1 -1
- package/docs/types/openapi.OpenapiSchemaBody.html +1 -1
- package/docs/types/openapi.OpenapiSchemaBodyShorthand.html +1 -1
- package/docs/types/openapi.OpenapiSchemaCombinatorFields.html +4 -0
- package/docs/types/openapi.OpenapiSchemaCommonFields.html +5 -1
- package/docs/types/openapi.OpenapiSchemaExpressionAllOf.html +1 -2
- package/docs/types/openapi.OpenapiSchemaExpressionAnyOf.html +1 -2
- package/docs/types/openapi.OpenapiSchemaExpressionOneOf.html +1 -2
- package/docs/types/openapi.OpenapiSchemaExpressionRef.html +2 -2
- package/docs/types/openapi.OpenapiSchemaExpressionRefSchemaShorthand.html +2 -2
- package/docs/types/openapi.OpenapiSchemaInteger.html +1 -1
- package/docs/types/openapi.OpenapiSchemaNull.html +4 -2
- package/docs/types/openapi.OpenapiSchemaNumber.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObject.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectAllOf.html +5 -1
- package/docs/types/openapi.OpenapiSchemaObjectAllOfShorthand.html +2 -1
- package/docs/types/openapi.OpenapiSchemaObjectBase.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectBaseShorthand.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectShorthand.html +1 -1
- package/docs/types/openapi.OpenapiSchemaPrimitiveGeneric.html +1 -1
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionAllOf.html +1 -2
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionAnyOf.html +1 -2
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionOneOf.html +1 -2
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionSerializableRef.html +2 -2
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionSerializerRef.html +2 -2
- package/docs/types/openapi.OpenapiSchemaShorthandPrimitiveGeneric.html +1 -1
- package/docs/types/openapi.OpenapiSchemaString.html +1 -1
- package/docs/types/openapi.OpenapiShorthandAllTypes.html +1 -1
- package/docs/types/openapi.OpenapiShorthandPrimitiveBaseTypes.html +1 -1
- package/docs/types/openapi.OpenapiShorthandPrimitiveTypes.html +1 -1
- package/docs/types/openapi.OpenapiTypeField.html +1 -1
- package/docs/types/system.DreamAppAllowedPackageManagersEnum.html +1 -1
- package/docs/types/types.CalendarDateDurationUnit.html +1 -1
- package/docs/types/types.CalendarDateObject.html +1 -1
- package/docs/types/types.Camelized.html +1 -1
- package/docs/types/types.ClockTimeObject.html +1 -1
- package/docs/types/types.DbConnectionType.html +1 -1
- package/docs/types/types.DbTypes.html +1 -1
- package/docs/types/types.DreamAssociationMetadata.html +1 -1
- package/docs/types/types.DreamAttributes.html +1 -1
- package/docs/types/types.DreamClassAssociationAndStatement.html +1 -1
- package/docs/types/types.DreamClassColumn.html +1 -1
- package/docs/types/types.DreamColumn.html +1 -1
- package/docs/types/types.DreamColumnNames.html +1 -1
- package/docs/types/types.DreamLogLevel.html +1 -1
- package/docs/types/types.DreamLogger.html +2 -2
- package/docs/types/types.DreamModelSerializerType.html +1 -1
- package/docs/types/types.DreamOrViewModelClassSerializerKey.html +1 -1
- package/docs/types/types.DreamOrViewModelSerializerKey.html +1 -1
- package/docs/types/types.DreamParamSafeAttributes.html +1 -1
- package/docs/types/types.DreamParamSafeColumnNames.html +1 -1
- package/docs/types/types.DreamSerializable.html +1 -1
- package/docs/types/types.DreamSerializableArray.html +1 -1
- package/docs/types/types.DreamSerializerKey.html +1 -1
- package/docs/types/types.DreamSerializers.html +1 -1
- package/docs/types/types.DreamVirtualColumns.html +1 -1
- package/docs/types/types.DurationUnit.html +1 -1
- package/docs/types/types.EncryptAlgorithm.html +1 -1
- package/docs/types/types.HasManyStatement.html +1 -1
- package/docs/types/types.HasOneStatement.html +1 -1
- package/docs/types/types.Hyphenized.html +1 -1
- package/docs/types/types.Pascalized.html +1 -1
- package/docs/types/types.PrimaryKeyType.html +1 -1
- package/docs/types/types.RoundingPrecision.html +1 -1
- package/docs/types/types.SerializerCasing.html +1 -1
- package/docs/types/types.SimpleObjectSerializerType.html +1 -1
- package/docs/types/types.Snakeified.html +1 -1
- package/docs/types/types.StrictInterface.html +1 -1
- package/docs/types/types.UpdateableAssociationProperties.html +1 -1
- package/docs/types/types.UpdateableProperties.html +1 -1
- package/docs/types/types.ValidationType.html +1 -1
- package/docs/types/types.ViewModel.html +2 -2
- package/docs/types/types.ViewModelClass.html +1 -1
- package/docs/types/types.WeekdayName.html +1 -1
- package/docs/types/types.WhereStatementForDream.html +1 -1
- package/docs/types/types.WhereStatementForDreamClass.html +1 -1
- package/docs/variables/index.DreamConst.html +1 -1
- package/docs/variables/index.ops.html +1 -1
- package/docs/variables/openapi.openapiPrimitiveTypes.html +1 -1
- package/docs/variables/openapi.openapiShorthandPrimitiveTypes.html +1 -1
- package/docs/variables/system.DreamAppAllowedPackageManagersEnumValues.html +1 -1
- package/docs/variables/system.primaryKeyTypes.html +1 -1
- package/package.json +1 -1
- package/dist/cjs/src/serializer/helpers/serializerForAssociatedClass.js +0 -37
- package/dist/esm/src/serializer/helpers/serializerForAssociatedClass.js +0 -37
- package/dist/types/src/serializer/helpers/serializerForAssociatedClass.d.ts +0 -9
- package/docs/types/openapi.OpenapiSchemaObjectAnyOf.html +0 -1
- package/docs/types/openapi.OpenapiSchemaObjectAnyOfShorthand.html +0 -1
- package/docs/types/openapi.OpenapiSchemaObjectOneOf.html +0 -1
- package/docs/types/openapi.OpenapiSchemaObjectOneOfShorthand.html +0 -1
|
@@ -6,6 +6,7 @@ import { DreamColumnNames, GlobalModelNameTableMap, SortableOptions } from '../t
|
|
|
6
6
|
import { AfterHookOpts, BeforeHookOpts } from '../types/lifecycle.js';
|
|
7
7
|
import { OpenapiSchemaBodyShorthand, OpenapiShorthandPrimitiveTypes } from '../types/openapi.js';
|
|
8
8
|
import { ValidationType } from '../types/validation.js';
|
|
9
|
+
import { EncryptedOptions } from './field/Encrypted.js';
|
|
9
10
|
export default class Decorators<TD extends typeof Dream, T extends Dream = InstanceType<TD>> {
|
|
10
11
|
BelongsTo<const AssociationGlobalNameOrNames extends keyof GlobalModelNameTableMap<T> | (keyof GlobalModelNameTableMap<T>)[]>(this: Decorators<TD>, globalAssociationNameOrNames: AssociationGlobalNameOrNames, options?: NonPolymorphicBelongsToOptions<T, AssociationGlobalNameOrNames>): any;
|
|
11
12
|
BelongsTo<const AssociationGlobalNameOrNames extends keyof GlobalModelNameTableMap<T> | (keyof GlobalModelNameTableMap<T>)[]>(this: Decorators<TD>, globalAssociationNameOrNames: AssociationGlobalNameOrNames, options?: PolymorphicBelongsToOptions<T, AssociationGlobalNameOrNames>): any;
|
|
@@ -29,15 +30,37 @@ export default class Decorators<TD extends typeof Dream, T extends Dream = Insta
|
|
|
29
30
|
*
|
|
30
31
|
* // automatically sets `myEncryptedPhone` to the encrypted value that
|
|
31
32
|
* // `phone` is set to new/create/update, e.g., `await user.update({ phone })`
|
|
32
|
-
* @deco.Encrypted('myEncryptedPhone)
|
|
33
|
+
* @deco.Encrypted('myEncryptedPhone')
|
|
33
34
|
* public phone: string
|
|
35
|
+
*
|
|
36
|
+
* // automatically sets `myEncryptedMfaSettings` to the encrypted value that
|
|
37
|
+
* // `mfaSettings` is set to in new/create/update, and declares the
|
|
38
|
+
* // value's OpenAPI shape, since it is not a string
|
|
39
|
+
* @deco.Encrypted({
|
|
40
|
+
* column: 'myEncryptedMfaSettings',
|
|
41
|
+
* openapi: { type: ['object', 'null'], properties: { token: 'string' } },
|
|
42
|
+
* })
|
|
43
|
+
* public mfaSettings: { token: string } | null
|
|
34
44
|
* }
|
|
35
45
|
* ```
|
|
36
46
|
*
|
|
37
|
-
*
|
|
47
|
+
* The decorated property may hold any JSON-serializable value. Its OpenAPI
|
|
48
|
+
* shape is what Psychic uses to cast the property in params and to render
|
|
49
|
+
* it in request body and serializer OpenAPI. Without an `openapi` option,
|
|
50
|
+
* that shape is `'string'`, or `['string', 'null']` when the backing column
|
|
51
|
+
* allows null. Pass `openapi` when the property holds a non-string value,
|
|
52
|
+
* such as an object, a number, or an array; it accepts any shape
|
|
53
|
+
* `@deco.Virtual` accepts. The declared shape is used exactly as given and
|
|
54
|
+
* replaces the nullability inferred from the backing column, so when the
|
|
55
|
+
* backing column allows null, include `'null'` in the shape, e.g.
|
|
56
|
+
* `type: ['object', 'null']`.
|
|
57
|
+
*
|
|
58
|
+
* @param columnOrOptions - Either the backing column's name, or an options object:
|
|
59
|
+
* - `column` — the backing column's name; if omitted, then 'encrypted' is prepended to the Pascal cased version of the decorated field
|
|
60
|
+
* - `openapi` — the OpenAPI shape of the decorated property's value; if omitted, the property's shape is a string (see above)
|
|
38
61
|
* @returns An Encrypted decorator
|
|
39
62
|
*/
|
|
40
|
-
Encrypted(this: Decorators<TD>,
|
|
63
|
+
Encrypted(this: Decorators<TD>, columnOrOptions?: DreamColumnNames<T> | EncryptedOptions<DreamColumnNames<T>>): any;
|
|
41
64
|
/**
|
|
42
65
|
* The Scope decorator decorates a static method that accepts
|
|
43
66
|
* and returns a Dream Query.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { OpenapiSchemaBodyShorthand, OpenapiShorthandPrimitiveTypes } from '../../types/openapi.js';
|
|
2
|
+
export default function Encrypted(columnOrOptions?: string | EncryptedOptions): any;
|
|
3
|
+
export interface EncryptedOptions<ColumnName extends string = string> {
|
|
4
|
+
column?: ColumnName;
|
|
5
|
+
openapi?: OpenapiShorthandPrimitiveTypes | OpenapiSchemaBodyShorthand;
|
|
6
|
+
}
|
|
2
7
|
export interface EncryptedAttributeStatement {
|
|
3
8
|
property: string;
|
|
4
9
|
encryptedColumnName: string;
|
|
@@ -453,15 +453,15 @@ export default class DreamClassTransactionBuilder<DreamClass extends typeof Drea
|
|
|
453
453
|
* 5. associations loading associations loading associations could result in exponential amounts of data; in those cases, `.preload(...).findEach(...)` avoids instantiating massive amounts of data at once
|
|
454
454
|
*
|
|
455
455
|
* ```ts
|
|
456
|
-
* const user = await User.txn(txn).leftJoinPreload('posts', 'comments', {
|
|
456
|
+
* const user = await User.txn(txn).leftJoinPreload('posts', 'comments', { and: { visibility: 'public' } }, 'replies').first()
|
|
457
457
|
* console.log(user.posts[0].comments[0].replies)
|
|
458
458
|
* // [Reply{id: 1}, Reply{id: 2}]
|
|
459
459
|
* ```
|
|
460
460
|
*
|
|
461
|
-
* @param args - A chain of association names and
|
|
461
|
+
* @param args - A chain of association names and and/andNot/andAny clauses
|
|
462
462
|
* @returns A query for this model with the include statement applied
|
|
463
463
|
*/
|
|
464
|
-
leftJoinPreload<I extends DreamClassTransactionBuilder<DreamClass, DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[], const LastArg extends VariadicLeftJoinLoadArgs<DreamInstance, DB, Schema, TableName, Arr>, const JoinedAssociationsCandidate = JoinedAssociationsTypeFromAssociations<DB, Schema, TableName, [
|
|
464
|
+
leftJoinPreload<I extends DreamClassTransactionBuilder<DreamClass, DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[], const LastArg extends VariadicLeftJoinLoadArgs<DreamInstance, DB, Schema, TableName, Arr, LastArg>, const JoinedAssociationsCandidate = JoinedAssociationsTypeFromAssociations<DB, Schema, TableName, [
|
|
465
465
|
...Arr,
|
|
466
466
|
LastArg
|
|
467
467
|
]>, const JoinedAssociations extends readonly JoinedAssociation[] = JoinedAssociationsCandidate extends readonly JoinedAssociation[] ? JoinedAssociationsCandidate : never, RetQuery = QueryWithJoinedAssociationsTypeAndNoPreload<Query<DreamInstance>, JoinedAssociations>>(this: I, ...args: [...Arr, LastArg]): RetQuery;
|
|
@@ -477,13 +477,13 @@ export default class DreamClassTransactionBuilder<DreamClass extends typeof Drea
|
|
|
477
477
|
*
|
|
478
478
|
* ```ts
|
|
479
479
|
* await ApplicationModel.transaction(async txn => {
|
|
480
|
-
* const user = await User.txn(txn).preload('posts', 'comments', {
|
|
480
|
+
* const user = await User.txn(txn).preload('posts', 'comments', { and: { visibility: 'public' } }, 'replies').first()
|
|
481
481
|
* console.log(user.posts[0].comments[0].replies)
|
|
482
482
|
* // [Reply{id: 1}, Reply{id: 2}]
|
|
483
483
|
* })
|
|
484
484
|
* ```
|
|
485
485
|
*
|
|
486
|
-
* @param args - A chain of association names and
|
|
486
|
+
* @param args - A chain of association names and and/andNot/andAny clauses
|
|
487
487
|
* @returns A query for this model with the preload statement applied
|
|
488
488
|
*/
|
|
489
489
|
preload<I extends DreamClassTransactionBuilder<DreamClass, DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[]>(this: I, ...args: [...Arr, VariadicLoadArgs<DreamInstance, DB, Schema, TableName, Arr>]): Query<DreamInstance, Readonly<{
|
|
@@ -561,10 +561,10 @@ export default class DreamClassTransactionBuilder<DreamClass extends typeof Drea
|
|
|
561
561
|
* })
|
|
562
562
|
* ```
|
|
563
563
|
*
|
|
564
|
-
* @param args - A chain of association names and
|
|
564
|
+
* @param args - A chain of association names and and/andNot/andAny clauses
|
|
565
565
|
* @returns A Query for this model with the inner join clause applied
|
|
566
566
|
*/
|
|
567
|
-
innerJoin<I extends DreamClassTransactionBuilder<DreamClass, DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[], const LastArg extends VariadicJoinsArgs<DreamInstance, DB, Schema, TableName, Arr>, const JoinedAssociationsCandidate = JoinedAssociationsTypeFromAssociations<DB, Schema, TableName, [
|
|
567
|
+
innerJoin<I extends DreamClassTransactionBuilder<DreamClass, DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[], const LastArg extends VariadicJoinsArgs<DreamInstance, DB, Schema, TableName, Arr, LastArg>, const JoinedAssociationsCandidate = JoinedAssociationsTypeFromAssociations<DB, Schema, TableName, [
|
|
568
568
|
...Arr,
|
|
569
569
|
LastArg
|
|
570
570
|
]>, const JoinedAssociations extends readonly JoinedAssociation[] = JoinedAssociationsCandidate extends readonly JoinedAssociation[] ? JoinedAssociationsCandidate : never, RetQuery = QueryWithJoinedAssociationsType<Query<DreamInstance>, JoinedAssociations>>(this: I, ...args: [...Arr, LastArg]): RetQuery;
|
|
@@ -578,10 +578,10 @@ export default class DreamClassTransactionBuilder<DreamClass extends typeof Drea
|
|
|
578
578
|
* })
|
|
579
579
|
* ```
|
|
580
580
|
*
|
|
581
|
-
* @param args - A chain of association names and
|
|
581
|
+
* @param args - A chain of association names and and/andNot/andAny clauses
|
|
582
582
|
* @returns A Query for this model with the left join clause applied
|
|
583
583
|
*/
|
|
584
|
-
leftJoin<I extends DreamClassTransactionBuilder<DreamClass, DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[], const LastArg extends VariadicJoinsArgs<DreamInstance, DB, Schema, TableName, Arr>, const JoinedAssociationsCandidate = JoinedAssociationsTypeFromAssociations<DB, Schema, TableName, [
|
|
584
|
+
leftJoin<I extends DreamClassTransactionBuilder<DreamClass, DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[], const LastArg extends VariadicJoinsArgs<DreamInstance, DB, Schema, TableName, Arr, LastArg>, const JoinedAssociationsCandidate = JoinedAssociationsTypeFromAssociations<DB, Schema, TableName, [
|
|
585
585
|
...Arr,
|
|
586
586
|
LastArg
|
|
587
587
|
]>, const JoinedAssociations extends readonly JoinedAssociation[] = JoinedAssociationsCandidate extends readonly JoinedAssociation[] ? JoinedAssociationsCandidate : never, RetQuery = QueryWithJoinedAssociationsType<Query<DreamInstance>, JoinedAssociations>>(this: I, ...args: [...Arr, LastArg]): RetQuery;
|
|
@@ -21,26 +21,29 @@ export default class DreamInstanceTransactionBuilder<DreamInstance extends Dream
|
|
|
21
21
|
/**
|
|
22
22
|
* Loads the requested associations upon execution
|
|
23
23
|
*
|
|
24
|
+
* **IMPORTANT:** `load().execute()` returns a **new clone** of the model with the
|
|
25
|
+
* associations loaded. It does NOT modify the original instance.
|
|
26
|
+
*
|
|
24
27
|
* NOTE: {@link Dream#preload} is often a preferrable way of achieving the
|
|
25
28
|
* same goal.
|
|
26
29
|
*
|
|
27
30
|
* ```ts
|
|
28
31
|
* await ApplicationModel.transaction(async txn => {
|
|
29
|
-
* await user
|
|
32
|
+
* const loadedUser = await user
|
|
30
33
|
* .txn(txn)
|
|
31
|
-
* .load('posts', { body: ops.ilike('%hello world%') }, 'comments', 'replies')
|
|
34
|
+
* .load('posts', { and: { body: ops.ilike('%hello world%') } }, 'comments', 'replies')
|
|
32
35
|
* .load('images')
|
|
33
36
|
* .execute()
|
|
34
37
|
*
|
|
35
|
-
*
|
|
38
|
+
* loadedUser.posts[0].comments[0].replies[0]
|
|
36
39
|
* // Reply{}
|
|
37
40
|
*
|
|
38
|
-
*
|
|
41
|
+
* loadedUser.images[0]
|
|
39
42
|
* // Image{}
|
|
40
43
|
* })
|
|
41
44
|
* ```
|
|
42
45
|
*
|
|
43
|
-
* @param args - A
|
|
46
|
+
* @param args - A chain of association names and and/andNot/andAny clauses
|
|
44
47
|
* @returns A chainable LoadBuilder instance
|
|
45
48
|
*/
|
|
46
49
|
load<I extends DreamInstanceTransactionBuilder<DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[]>(this: I, ...args: [...Arr, VariadicLoadArgs<DreamInstance, DB, Schema, TableName, Arr>]): LoadBuilder<DreamInstance>;
|
|
@@ -96,32 +99,34 @@ export default class DreamInstanceTransactionBuilder<DreamInstance extends Dream
|
|
|
96
99
|
* Load each specified association using a single SQL query.
|
|
97
100
|
* See {@link #load} for loading in separate queries.
|
|
98
101
|
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
102
|
+
* **IMPORTANT:** Like `load()`, `leftJoinLoad().execute()` returns a **new clone** of the
|
|
103
|
+
* model with associations loaded. It does NOT modify the original instance.
|
|
104
|
+
*
|
|
105
|
+
* Note: since leftJoinLoad loads via single query, it has
|
|
106
|
+
* some downsides that may be avoided using {@link #load}:
|
|
101
107
|
* 1. `limit` and `offset` will be automatically removed
|
|
102
108
|
* 2. `through` associations will bring additional namespaces into the query that can conflict with through associations from other associations, creating an invalid query
|
|
103
|
-
* 3. each nested association will result in an additional record which duplicates data from the outer record. E.g., given `.
|
|
109
|
+
* 3. each nested association will result in an additional record which duplicates data from the outer record. E.g., given `.leftJoinLoad('a', 'b', 'c')`, if each `a` has 10 `b` and each `b` has 10 `c`, then for one `a`, 100 records will be returned, each of which has all of the columns of `a`. `.load('a', 'b', 'c')` would perform three separate SQL queries, but the data for a single `a` would only be returned once.
|
|
104
110
|
* 4. the individual query becomes more complex the more associations are included
|
|
105
111
|
* 5. associations loading associations loading associations could result in exponential amounts of data; in those cases, `.load(...).findEach(...)` avoids instantiating massive amounts of data at once
|
|
106
|
-
* Loads the requested associations upon execution
|
|
107
|
-
*
|
|
108
|
-
* NOTE: {@link Dream#leftJoinPreload} is often a preferrable way of achieving the
|
|
109
|
-
* same goal.
|
|
110
112
|
*
|
|
111
113
|
* ```ts
|
|
112
|
-
* await
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
114
|
+
* await ApplicationModel.transaction(async txn => {
|
|
115
|
+
* const loadedUser = await user
|
|
116
|
+
* .txn(txn)
|
|
117
|
+
* .leftJoinLoad('posts', { and: { body: ops.ilike('%hello world%') } }, 'comments', 'replies')
|
|
118
|
+
* .leftJoinLoad('images')
|
|
119
|
+
* .execute()
|
|
116
120
|
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
121
|
+
* loadedUser.posts[0].comments[0].replies[0]
|
|
122
|
+
* // Reply{}
|
|
119
123
|
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
124
|
+
* loadedUser.images[0]
|
|
125
|
+
* // Image{}
|
|
126
|
+
* })
|
|
122
127
|
* ```
|
|
123
128
|
*
|
|
124
|
-
* @param args - A
|
|
129
|
+
* @param args - A chain of association names and and/andNot/andAny clauses
|
|
125
130
|
* @returns A chainable LeftJoinLoadBuilder instance
|
|
126
131
|
*/
|
|
127
132
|
leftJoinLoad<I extends DreamInstanceTransactionBuilder<DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[]>(this: I, ...args: [...Arr, VariadicLeftJoinLoadArgs<DreamInstance, DB, Schema, TableName, Arr>]): LeftJoinLoadBuilder<DreamInstance>;
|
|
@@ -135,10 +140,10 @@ export default class DreamInstanceTransactionBuilder<DreamInstance extends Dream
|
|
|
135
140
|
* })
|
|
136
141
|
* ```
|
|
137
142
|
*
|
|
138
|
-
* @param args - A chain of association names and
|
|
143
|
+
* @param args - A chain of association names and and/andNot/andAny clauses
|
|
139
144
|
* @returns A Query for this model with the inner join clause applied
|
|
140
145
|
*/
|
|
141
|
-
innerJoin<I extends DreamInstanceTransactionBuilder<DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[], const LastArg extends VariadicJoinsArgs<DreamInstance, DB, Schema, TableName, Arr>, const JoinedAssociationsCandidate = JoinedAssociationsTypeFromAssociations<DB, Schema, TableName, [
|
|
146
|
+
innerJoin<I extends DreamInstanceTransactionBuilder<DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[], const LastArg extends VariadicJoinsArgs<DreamInstance, DB, Schema, TableName, Arr, LastArg>, const JoinedAssociationsCandidate = JoinedAssociationsTypeFromAssociations<DB, Schema, TableName, [
|
|
142
147
|
...Arr,
|
|
143
148
|
LastArg
|
|
144
149
|
]>, const JoinedAssociations extends readonly JoinedAssociation[] = JoinedAssociationsCandidate extends readonly JoinedAssociation[] ? JoinedAssociationsCandidate : never, RetQuery = QueryWithJoinedAssociationsType<Query<DreamInstance>, JoinedAssociations>>(this: I, ...args: [...Arr, LastArg]): RetQuery;
|
|
@@ -152,10 +157,10 @@ export default class DreamInstanceTransactionBuilder<DreamInstance extends Dream
|
|
|
152
157
|
* })
|
|
153
158
|
* ```
|
|
154
159
|
*
|
|
155
|
-
* @param args - A chain of association names and
|
|
160
|
+
* @param args - A chain of association names and and/andNot/andAny clauses
|
|
156
161
|
* @returns A Query for this model with the left join clause applied
|
|
157
162
|
*/
|
|
158
|
-
leftJoin<I extends DreamInstanceTransactionBuilder<DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[], const LastArg extends VariadicJoinsArgs<DreamInstance, DB, Schema, TableName, Arr>, const JoinedAssociationsCandidate = JoinedAssociationsTypeFromAssociations<DB, Schema, TableName, [
|
|
163
|
+
leftJoin<I extends DreamInstanceTransactionBuilder<DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[], const LastArg extends VariadicJoinsArgs<DreamInstance, DB, Schema, TableName, Arr, LastArg>, const JoinedAssociationsCandidate = JoinedAssociationsTypeFromAssociations<DB, Schema, TableName, [
|
|
159
164
|
...Arr,
|
|
160
165
|
LastArg
|
|
161
166
|
]>, const JoinedAssociations extends readonly JoinedAssociation[] = JoinedAssociationsCandidate extends readonly JoinedAssociation[] ? JoinedAssociationsCandidate : never, RetQuery = QueryWithJoinedAssociationsType<Query<DreamInstance>, JoinedAssociations>>(this: I, ...args: [...Arr, LastArg]): RetQuery;
|
|
@@ -228,6 +233,12 @@ export default class DreamInstanceTransactionBuilder<DreamInstance extends Dream
|
|
|
228
233
|
* See {@link Dream.save | save} for details on
|
|
229
234
|
* the side effects of saving.
|
|
230
235
|
*
|
|
236
|
+
* A column whose value is still `undefined` after setters run is
|
|
237
|
+
* skipped, not written (see {@link Dream.save | save}), with two
|
|
238
|
+
* `@Encrypted` exceptions: `undefined` for an encrypted property (e.g.
|
|
239
|
+
* `secret`) is encrypted to `null`, so it clears the column, and
|
|
240
|
+
* `undefined` for its backing column (e.g. `encryptedSecret`) throws.
|
|
241
|
+
*
|
|
231
242
|
* NOTE:
|
|
232
243
|
* To bypass custom-defined setters, use {@link Dream.updateAttributes | updateAttributes} instead.
|
|
233
244
|
*
|
|
@@ -252,6 +263,18 @@ export default class DreamInstanceTransactionBuilder<DreamInstance extends Dream
|
|
|
252
263
|
* See {@link Dream.save | save} for details on
|
|
253
264
|
* the side effects of saving.
|
|
254
265
|
*
|
|
266
|
+
* An encrypted property (e.g. `secret`) is still encrypted. Its
|
|
267
|
+
* `@Encrypted` backing column (e.g. `encryptedSecret`) accepts only
|
|
268
|
+
* ciphertext that decrypts with this app's column encryption keys, or
|
|
269
|
+
* `null`; anything else throws before anything is saved (see
|
|
270
|
+
* {@link Dream.setAttribute | setAttribute}).
|
|
271
|
+
*
|
|
272
|
+
* A column whose value is still `undefined` after setters run is
|
|
273
|
+
* skipped, not written (see {@link Dream.save | save}), with two
|
|
274
|
+
* `@Encrypted` exceptions: `undefined` for an encrypted property (e.g.
|
|
275
|
+
* `secret`) is encrypted to `null`, so it clears the column, and
|
|
276
|
+
* `undefined` for its backing column (e.g. `encryptedSecret`) throws.
|
|
277
|
+
*
|
|
255
278
|
* NOTE:
|
|
256
279
|
* To update the values without bypassing any custom-defined
|
|
257
280
|
* setters, use {@link Dream.update | update} instead.
|
|
@@ -297,6 +320,10 @@ export default class DreamInstanceTransactionBuilder<DreamInstance extends Dream
|
|
|
297
320
|
* Upon updating an instance, the update timestamp (if defined)
|
|
298
321
|
* will be updated on the model.
|
|
299
322
|
*
|
|
323
|
+
* A column whose value is `undefined` is skipped, not written: a new
|
|
324
|
+
* record gets the column's database default, and a persisted record
|
|
325
|
+
* keeps the value stored for it. Set a column to `null` to clear it.
|
|
326
|
+
*
|
|
300
327
|
* ```ts
|
|
301
328
|
* const user = User.new({ email: 'how@yadoin' })
|
|
302
329
|
*
|
|
@@ -23,17 +23,17 @@ export default class LeftJoinLoadBuilder<DreamInstance extends Dream> {
|
|
|
23
23
|
constructor(dream: Dream, dreamTransaction?: (DreamTransaction<any> | null) | undefined);
|
|
24
24
|
passthrough<I extends LeftJoinLoadBuilder<DreamInstance>, PassthroughColumns extends PassthroughColumnNames<DreamInstance>>(this: I, passthroughWhereStatement: PassthroughOnClause<PassthroughColumns>): I;
|
|
25
25
|
/**
|
|
26
|
-
* Attaches a
|
|
26
|
+
* Attaches a leftJoinLoad statement to the load builder
|
|
27
27
|
*
|
|
28
28
|
* ```ts
|
|
29
29
|
* const user = await User.firstOrFail()
|
|
30
30
|
* await user
|
|
31
|
-
* .
|
|
32
|
-
* .
|
|
31
|
+
* .leftJoinLoad('settings')
|
|
32
|
+
* .leftJoinLoad('posts', 'comments', 'replies', ['image', 'localizedText'])
|
|
33
33
|
* .execute()
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
leftJoinLoad<I extends LeftJoinLoadBuilder<DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[], const LastArg extends VariadicLeftJoinLoadArgs<DreamInstance, DB, Schema, TableName, Arr>>(this: I, ...args: [...Arr, LastArg]): I;
|
|
36
|
+
leftJoinLoad<I extends LeftJoinLoadBuilder<DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[], const LastArg extends VariadicLeftJoinLoadArgs<DreamInstance, DB, Schema, TableName, Arr, LastArg>>(this: I, ...args: [...Arr, LastArg]): I;
|
|
37
37
|
/**
|
|
38
38
|
* Executes the left-join load query, returning a **clone** of the original model
|
|
39
39
|
* with all requested associations loaded. The original instance is not modified.
|
|
@@ -84,7 +84,7 @@ export default class LoadBuilder<DreamInstance extends Dream> {
|
|
|
84
84
|
* .execute()
|
|
85
85
|
* ```
|
|
86
86
|
*
|
|
87
|
-
* @param args - A
|
|
87
|
+
* @param args - A chain of association names and and/andNot/andAny clauses to load
|
|
88
88
|
* @returns A chainable LoadBuilder instance
|
|
89
89
|
*/
|
|
90
90
|
load<I extends LoadBuilder<DreamInstance>, DB extends DreamInstance['DB'], TableName extends DreamInstance['table'], Schema extends DreamInstance['schema'], const Arr extends readonly unknown[]>(this: I, ...args: [...Arr, VariadicLoadArgs<DreamInstance, DB, Schema, TableName, Arr>]): I;
|