@rvoh/dream 2.34.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 +270 -69
- 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 +270 -69
- 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 +217 -55
- 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 +281 -155
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Query | @rvoh/dream</title><meta name="description" content="Documentation for @rvoh/dream"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@rvoh/dream</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/index.html">index</a></li><li><a href="" aria-current="page">Query</a></li></ul><h1>Class Query<DreamInstance, QueryTypeOpts></h1></div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="dreaminstance"><span class="tsd-kind-type-parameter">DreamInstance</span> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a></span></li><li><span id="querytypeopts"><span class="tsd-kind-type-parameter">QueryTypeOpts</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">QueryTypeOptions</span><span class="tsd-signature-symbol">></span> = <span class="tsd-signature-type">DefaultQueryTypeOptions</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></span></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Query | @rvoh/dream</title><meta name="description" content="Documentation for @rvoh/dream"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@rvoh/dream</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/index.html">index</a></li><li><a href="" aria-current="page">Query</a></li></ul><h1>Class Query<DreamInstance, QueryTypeOpts></h1></div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="dreaminstance"><span class="tsd-kind-type-parameter">DreamInstance</span> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a></span></li><li><span id="querytypeopts"><span class="tsd-kind-type-parameter">QueryTypeOpts</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">QueryTypeOptions</span><span class="tsd-signature-symbol">></span> = <span class="tsd-signature-type">DefaultQueryTypeOptions</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></span></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L122">src/dream/Query.ts:122</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
|
2
2
|
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="#connectionoverride" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>connection<wbr/>Override</span></a>
|
|
3
3
|
<a href="#dreamclass" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dream<wbr/>Class</span></a>
|
|
4
4
|
<a href="#dreaminstance-1" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dream<wbr/>Instance</span></a>
|
|
@@ -64,16 +64,16 @@
|
|
|
64
64
|
<a href="#whereany" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where<wbr/>Any</span></a>
|
|
65
65
|
<a href="#wherenot" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where<wbr/>Not</span></a>
|
|
66
66
|
<a href="#dbdriverclass" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>db<wbr/>Driver<wbr/>Class</span></a>
|
|
67
|
-
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Constructors</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="constructor"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="constructorquery"><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">Query</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#constructorquerydreaminstance">DreamInstance</a> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#constructorqueryquerytypeopts">QueryTypeOpts</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">QueryTypeOptions</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">dreamInstance</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">QueryOpts</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#constructorquery" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="constructorquerydreaminstance"><span class="tsd-kind-type-parameter">DreamInstance</span> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a></span></li><li><span id="constructorqueryquerytypeopts"><span class="tsd-kind-type-parameter">QueryTypeOpts</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">QueryTypeOptions</span><span class="tsd-signature-symbol">></span> = <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dreamInstance</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a></span></li><li><span><span class="tsd-kind-parameter">opts</span>: <span class="tsd-signature-type">QueryOpts</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> = {}</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ca5a693d77d580b63e885f3eaf29598becd0a1a8/src/dream/Query.ts#L378">src/dream/Query.ts:378</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Properties</h2></summary><section><section class="tsd-panel tsd-member tsd-is-protected"><h3 class="tsd-anchor-link" id="connectionoverride"><code class="tsd-tag">Protected</code><span>connection<wbr/>Override</span><a href="#connectionoverride" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">connectionOverride</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.DbConnectionType.html" class="tsd-signature-type tsd-kind-type-alias">DbConnectionType</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ca5a693d77d580b63e885f3eaf29598becd0a1a8/src/dream/Query.ts#L369">src/dream/Query.ts:369</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-protected"><h3 class="tsd-anchor-link" id="dreamclass"><code class="tsd-tag">Protected</code> <code class="tsd-tag">Readonly</code><span>dream<wbr/>Class</span><a href="#dreamclass" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">dreamClass</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">DreamConstructorType</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ca5a693d77d580b63e885f3eaf29598becd0a1a8/src/dream/Query.ts#L367">src/dream/Query.ts:367</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="dreaminstance-1"><code class="tsd-tag">Readonly</code><span>dream<wbr/>Instance</span><a href="#dreaminstance-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">dreamInstance</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ca5a693d77d580b63e885f3eaf29598becd0a1a8/src/dream/Query.ts#L368">src/dream/Query.ts:368</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="dreamtransaction"><code class="tsd-tag">Internal</code><span>dream<wbr/>Transaction</span><a href="#dreamtransaction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">dreamTransaction</span><span class="tsd-signature-symbol">:</span> <a href="index.DreamTransaction.html" class="tsd-signature-type tsd-kind-class">DreamTransaction</a><span class="tsd-signature-symbol"><</span><a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> = null</span></div><div class="tsd-comment tsd-typography"><p>stores the dream transaction applied to the
|
|
67
|
+
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Constructors</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="constructor"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="constructorquery"><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">Query</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#constructorquerydreaminstance">DreamInstance</a> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#constructorqueryquerytypeopts">QueryTypeOpts</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">QueryTypeOptions</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">dreamInstance</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">QueryOpts</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#constructorquery" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="constructorquerydreaminstance"><span class="tsd-kind-type-parameter">DreamInstance</span> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a></span></li><li><span id="constructorqueryquerytypeopts"><span class="tsd-kind-type-parameter">QueryTypeOpts</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">QueryTypeOptions</span><span class="tsd-signature-symbol">></span> = <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dreamInstance</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a></span></li><li><span><span class="tsd-kind-parameter">opts</span>: <span class="tsd-signature-type">QueryOpts</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> = {}</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L394">src/dream/Query.ts:394</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Properties</h2></summary><section><section class="tsd-panel tsd-member tsd-is-protected"><h3 class="tsd-anchor-link" id="connectionoverride"><code class="tsd-tag">Protected</code><span>connection<wbr/>Override</span><a href="#connectionoverride" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">connectionOverride</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.DbConnectionType.html" class="tsd-signature-type tsd-kind-type-alias">DbConnectionType</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L385">src/dream/Query.ts:385</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-protected"><h3 class="tsd-anchor-link" id="dreamclass"><code class="tsd-tag">Protected</code> <code class="tsd-tag">Readonly</code><span>dream<wbr/>Class</span><a href="#dreamclass" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">dreamClass</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">DreamConstructorType</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L383">src/dream/Query.ts:383</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="dreaminstance-1"><code class="tsd-tag">Readonly</code><span>dream<wbr/>Instance</span><a href="#dreaminstance-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">dreamInstance</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L384">src/dream/Query.ts:384</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="dreamtransaction"><code class="tsd-tag">Internal</code><span>dream<wbr/>Transaction</span><a href="#dreamtransaction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">dreamTransaction</span><span class="tsd-signature-symbol">:</span> <a href="index.DreamTransaction.html" class="tsd-signature-type tsd-kind-class">DreamTransaction</a><span class="tsd-signature-symbol"><</span><a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> = null</span></div><div class="tsd-comment tsd-typography"><p>stores the dream transaction applied to the
|
|
68
68
|
current Query instance</p>
|
|
69
|
-
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
70
|
-
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
71
|
-
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
69
|
+
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L156">src/dream/Query.ts:156</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-protected"><h3 class="tsd-anchor-link" id="innerjoindreamclasses"><code class="tsd-tag">Protected</code> <code class="tsd-tag">Readonly</code> <code class="tsd-tag">Internal</code><span>inner<wbr/>Join<wbr/>Dream<wbr/>Classes</span><a href="#innerjoindreamclasses" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">innerJoinDreamClasses</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-keyword">typeof</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = ...</span></div><div class="tsd-comment tsd-typography"><p>stores the Dream models joined in this Query instance</p>
|
|
70
|
+
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L392">src/dream/Query.ts:392</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="querytypeopts-1"><code class="tsd-tag">Internal</code><span>query<wbr/>Type<wbr/>Opts</span><a href="#querytypeopts-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">queryTypeOpts</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a></div><div class="tsd-comment tsd-typography"><p>purely for typing</p>
|
|
71
|
+
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L148">src/dream/Query.ts:148</a></li></ul></aside></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="batch_sizes"><code class="tsd-tag">Static</code> <code class="tsd-tag">Readonly</code> <code class="tsd-tag">Internal</code><span>BATCH_<wbr/>SIZES</span><a href="#batch_sizes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">BATCH_SIZES</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">FIND_EACH</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">LOCKED_DESTROY</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">LOCKED_UPDATE</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">PLUCK_EACH</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">PLUCK_EACH_THROUGH</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = ...</span></div><div class="tsd-comment tsd-typography"><p>stores the default batch sizes for various
|
|
72
72
|
provided batching methods</p>
|
|
73
|
-
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
73
|
+
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L132">src/dream/Query.ts:132</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Accessors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Accessors</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="connectionname"><span>connection<wbr/>Name</span><a href="#connectionname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li><div class="tsd-signature" id="connectionnameconnectionname"><span class="tsd-signature-keyword">get</span> <span class="tsd-kind-get-signature">connectionName</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2396">src/dream/Query.ts:2396</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="isdreamquery"><span>is<wbr/>Dream<wbr/>Query</span><a href="#isdreamquery" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li><div class="tsd-signature" id="isdreamqueryisdreamquery"><span class="tsd-signature-keyword">get</span> <span class="tsd-kind-get-signature">isDreamQuery</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns true. Useful for distinguishing Query instances
|
|
74
74
|
from other objects.</p>
|
|
75
75
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p>true</p>
|
|
76
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
76
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L437">src/dream/Query.ts:437</a></li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Methods</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="all"><span>all</span><a href="#all" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="all-1"><span class="tsd-kind-call-signature">all</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">columns</span><span class="tsd-signature-symbol">?:</span> (<br/> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span><br/> )<span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span><a href="#all-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves an array containing all records matching the Query.
|
|
77
77
|
Be careful using this, since it will attempt to pull every
|
|
78
78
|
record into memory at once. When querying might return a large
|
|
79
79
|
number of records, consider using <code>.findEach</code>, which will pull
|
|
@@ -84,14 +84,14 @@ the records in batches.</p>
|
|
|
84
84
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">columns</span><span class="tsd-signature-symbol">?:</span> (<br/> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span><br/> )<span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = {}</span></span><div class="tsd-comment tsd-typography"><p>Query options</p>
|
|
85
85
|
</div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">columns</span><span class="tsd-signature-symbol">?: </span>(<br/> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span><br/>)<span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><p>Array of column names to select. The primary key is always included automatically.</p>
|
|
86
86
|
</div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4><p>an array of dreams</p>
|
|
87
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
87
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2378">src/dream/Query.ts:2378</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="avg"><span>avg</span><a href="#avg" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="avg-1"><span class="tsd-kind-call-signature">avg</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgdb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgcolumnname">ColumnName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgreturntype">ReturnType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">columnName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgcolumnname">ColumnName</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#avgreturntype">ReturnType</a><span class="tsd-signature-symbol">></span><a href="#avg-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the average value of the specified column
|
|
88
88
|
for this Query</p>
|
|
89
89
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">Game</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">avg</span><span class="hl-1">(</span><span class="hl-6">'score'</span><span class="hl-1">)</span><br/><span class="hl-7">// 1</span>
|
|
90
90
|
</code><button type="button">Copy</button></pre>
|
|
91
91
|
|
|
92
92
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="avgq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span id="avgdb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="avgcolumnname"><span class="tsd-kind-type-parameter">ColumnName</span></span></li><li><span id="avgreturntype"><span class="tsd-kind-type-parameter">ReturnType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">columnName</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgcolumnname">ColumnName</a></span><div class="tsd-comment tsd-typography"><p>a column name on the model</p>
|
|
93
93
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#avgreturntype">ReturnType</a><span class="tsd-signature-symbol">></span></h4><p>the average of the values of the specified column for this Query</p>
|
|
94
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
94
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2142">src/dream/Query.ts:2142</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="avgby"><span>avg<wbr/>By</span><a href="#avgby" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="avgby-1"><span class="tsd-kind-call-signature">avgBy</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgbyq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgbydb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgbygroupcolumnname">GroupColumnName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgbyaggregatedcolumnname">AggregatedColumnName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgbygroupkey">GroupKey</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgbyaggregatedtype">AggregatedType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">groupColumn</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgbygroupcolumnname">GroupColumnName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">aggregatedColumn</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgbyaggregatedcolumnname">AggregatedColumnName</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#avgbygroupkey">GroupKey</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgbyaggregatedtype">AggregatedType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#avgby-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the average of the specified column within each group, keyed by
|
|
95
95
|
the value of the provided group column (a SQL <code>GROUP BY</code>).</p>
|
|
96
96
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">CompositionAsset</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">avgBy</span><span class="hl-1">(</span><span class="hl-6">'name'</span><span class="hl-1">, </span><span class="hl-6">'score'</span><span class="hl-1">)</span><br/><span class="hl-7">// Map(2) { 'primary' => 5, 'secondary' => 4 }</span>
|
|
97
97
|
</code><button type="button">Copy</button></pre>
|
|
@@ -107,23 +107,23 @@ are grouped under a real <code>null</code> key; a group whose aggregated values
|
|
|
107
107
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="avgbyq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span id="avgbydb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="avgbygroupcolumnname"><span class="tsd-kind-type-parameter">GroupColumnName</span></span></li><li><span id="avgbyaggregatedcolumnname"><span class="tsd-kind-type-parameter">AggregatedColumnName</span></span></li><li><span id="avgbygroupkey"><span class="tsd-kind-type-parameter">GroupKey</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="avgbyaggregatedtype"><span class="tsd-kind-type-parameter">AggregatedType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">groupColumn</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgbygroupcolumnname">GroupColumnName</a></span><div class="tsd-comment tsd-typography"><p>the column to group by (base or joined-association-namespaced)</p>
|
|
108
108
|
</div></li><li><span><span class="tsd-kind-parameter">aggregatedColumn</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgbyaggregatedcolumnname">AggregatedColumnName</a></span><div class="tsd-comment tsd-typography"><p>the column to average within each group</p>
|
|
109
109
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#avgbygroupkey">GroupKey</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#avgbyaggregatedtype">AggregatedType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><p>A Map from each present group value to the average of the aggregated column in that group</p>
|
|
110
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
110
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2179">src/dream/Query.ts:2179</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="clone"><span>clone</span><a href="#clone" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="clone-1"><span class="tsd-kind-call-signature">clone</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#cloneq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">this</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#cloneq">Q</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">QueryOpts</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#cloneq">Q</a><a href="#clone-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><code class="tsd-tag">Internal</code><div class="tsd-comment tsd-typography"><p>Returns a cloned version of the Query</p>
|
|
111
111
|
<pre><code class="ts"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">clonedQuery</span><span class="hl-1"> = </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">clone</span><span class="hl-1">()</span>
|
|
112
112
|
</code><button type="button">Copy</button></pre>
|
|
113
113
|
|
|
114
114
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="cloneq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#cloneq">Q</a></span></li><li><span><span class="tsd-kind-parameter">opts</span>: <span class="tsd-signature-type">QueryOpts</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> = {}</span></span><div class="tsd-comment tsd-typography"><p>Statements to override when cloning the Query</p>
|
|
115
115
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="#cloneq">Q</a></h4><p>A cloned Query with the provided overrides clause applied</p>
|
|
116
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
116
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L453">src/dream/Query.ts:453</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="connection"><span>connection</span><a href="#connection" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="connection-1"><span class="tsd-kind-call-signature">connection</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">connection</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.DbConnectionType.html" class="tsd-signature-type tsd-kind-type-alias">DbConnectionType</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#connection-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Forces use of a database connection (e.g. 'primary') during the query.</p>
|
|
117
117
|
<p>NOTE: all queries within a transaction always use the 'primary' replica, so
|
|
118
118
|
explicitly setting connection within a transaction has no effect.</p>
|
|
119
119
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">connection</span>: <a href="../types/types.DbConnectionType.html" class="tsd-signature-type tsd-kind-type-alias">DbConnectionType</a></span><div class="tsd-comment tsd-typography"><p>The connection you wish to access ('primary' or 'replica')</p>
|
|
120
120
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A Query with the requested connection</p>
|
|
121
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
121
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2834">src/dream/Query.ts:2834</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="count"><span>count</span><a href="#count" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="count-1"><span class="tsd-kind-call-signature">count</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#count-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the number of records matching the Query</p>
|
|
122
122
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">count</span><span class="hl-1">()</span><br/><span class="hl-7">// 42</span><br/><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">where</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-4">ops</span><span class="hl-1">.</span><span class="hl-5">ilike</span><span class="hl-1">(</span><span class="hl-6">'%gmail.com'</span><span class="hl-1">) }).</span><span class="hl-5">count</span><span class="hl-1">()</span><br/><span class="hl-7">// 15</span>
|
|
123
123
|
</code><button type="button">Copy</button></pre>
|
|
124
124
|
|
|
125
125
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4><p>The number of records matching the Query</p>
|
|
126
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
126
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1818">src/dream/Query.ts:1818</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="countby"><span>count<wbr/>By</span><a href="#countby" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="countby-1"><span class="tsd-kind-call-signature">countBy</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#countbyq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#countbydb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#countbygroupcolumnname">GroupColumnName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#countbygroupkey">GroupKey</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">groupColumn</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#countbygroupcolumnname">GroupColumnName</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#countbygroupkey">GroupKey</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#countby-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the number of records in each group, keyed by the
|
|
127
127
|
value of the provided group column (a SQL <code>GROUP BY</code>).</p>
|
|
128
128
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">countBy</span><span class="hl-1">(</span><span class="hl-6">'name'</span><span class="hl-1">)</span><br/><span class="hl-7">// Map(2) { 'fred' => 2, 'zed' => 1 }</span><br/><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">where</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-4">ops</span><span class="hl-1">.</span><span class="hl-5">ilike</span><span class="hl-1">(</span><span class="hl-6">'%gmail.com'</span><span class="hl-1">) }).</span><span class="hl-5">countBy</span><span class="hl-1">(</span><span class="hl-6">'name'</span><span class="hl-1">)</span><br/><span class="hl-7">// Map(1) { 'fred' => 3 }</span>
|
|
129
129
|
</code><button type="button">Copy</button></pre>
|
|
@@ -141,19 +141,55 @@ group column is nullable, records with a <code>null</code> value are grouped und
|
|
|
141
141
|
|
|
142
142
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="countbyq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span id="countbydb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="countbygroupcolumnname"><span class="tsd-kind-type-parameter">GroupColumnName</span></span></li><li><span id="countbygroupkey"><span class="tsd-kind-type-parameter">GroupKey</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">groupColumn</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#countbygroupcolumnname">GroupColumnName</a></span><div class="tsd-comment tsd-typography"><p>the column to group by (base or joined-association-namespaced)</p>
|
|
143
143
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#countbygroupkey">GroupKey</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><p>A Map from each present group value to the number of records in that group</p>
|
|
144
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
144
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1852">src/dream/Query.ts:1852</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="cursorpaginate"><span>cursor<wbr/>Paginate</span><a href="#cursorpaginate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="cursorpaginate-1"><span class="tsd-kind-call-signature">cursorPaginate</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#cursorpaginateq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#cursorpaginateincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">this</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#cursorpaginateq">Q</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#cursorpaginateincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">"scrollPaginate is incompatible with limit, offset, and leftJoinPreload"</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CursorPaginatedDreamQueryOptions</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">CursorPaginatedDreamQueryResult</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#cursorpaginate-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Paginates the results of your query using cursor-based pagination,
|
|
145
145
|
accepting a pageSize and cursor argument. This method
|
|
146
146
|
provides better performance for large datasets by using cursor-based
|
|
147
147
|
pagination instead of offset-based pagination.</p>
|
|
148
|
-
<p>
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
<p>Pages follow the Query's <code>order</code>, preceded by the <code>order</code> declared on any
|
|
149
|
+
association the Query is built on or joins (so an <code>associationQuery</code> of
|
|
150
|
+
an ordered association pages in that association's order), with
|
|
151
|
+
descending primary key as the final tiebreaker; with neither, pages run
|
|
152
|
+
in descending primary key order. If those orders already include the
|
|
153
|
+
primary key (e.g.: <code>id: 'asc'</code>), the implicit primary key ordering is
|
|
154
|
+
omitted.</p>
|
|
155
|
+
<p>A Query that joins a HasOne or HasMany association (directly, through an
|
|
156
|
+
association it joins, or as the association an <code>associationQuery</code> goes
|
|
157
|
+
through) returns a record once for each row the join matches, as
|
|
158
|
+
<a href="#all" class="tsd-kind-method">Query.all</a> does, and the pages return each of those rows once,
|
|
159
|
+
sorting the rows of one record by the joined rows' primary keys after the
|
|
160
|
+
primary key. The cursor of such a Query is an opaque string that names
|
|
161
|
+
its last row by primary keys, the record's and the joined rows' (readable
|
|
162
|
+
by whoever holds it; it is not encrypted), and the next page starts after
|
|
163
|
+
that row, or, if the row is gone, after the record's first row. Any other
|
|
164
|
+
Query's cursor is its last record's primary key. A record's primary key
|
|
165
|
+
is always accepted as a cursor: the next page starts after that record's
|
|
166
|
+
first row. A cursor carries no other value its row sorts by: those are
|
|
167
|
+
read from the database when the next page is.</p>
|
|
168
|
+
<p>A Query that calls <code>distinct</code> on its primary key (as <code>distinct()</code> does,
|
|
169
|
+
e.g.: <code>User.innerJoin('posts').distinct()</code>) returns each record once, as
|
|
170
|
+
<a href="#all" class="tsd-kind-method">Query.all</a> does, and so do its pages, whose cursor is the last
|
|
171
|
+
record's primary key. A Query that calls <code>distinct</code> on another column has
|
|
172
|
+
to be ordered by that column first (e.g.:
|
|
173
|
+
<code>Post.distinct('category').order({ category: 'asc', createdAt: 'desc' })</code>),
|
|
174
|
+
or the database rejects its pages. Its pages return the records
|
|
175
|
+
<a href="#all" class="tsd-kind-method">Query.all</a> returns, the one its order keeps for each value of that
|
|
176
|
+
column (the newest post of each category), and its cursor is also the
|
|
177
|
+
last record's primary key. Over an association that declares <code>distinct</code>
|
|
178
|
+
and an <code>order</code> led by its distinct column (an <code>associationQuery</code> of it, or
|
|
179
|
+
a Query that joins it), the pages return the rows <a href="#all" class="tsd-kind-method">Query.all</a>
|
|
180
|
+
returns: the row the association's <code>order</code> keeps for each value of its
|
|
181
|
+
distinct column.</p>
|
|
182
|
+
<p>A similarity condition (<code>ops.similarity</code>, <code>ops.wordSimilarity</code>,
|
|
183
|
+
<code>ops.strictWordSimilarity</code>) still decides which records match, but its
|
|
184
|
+
relevance ranking does not order the pages: a cursor can only resume from
|
|
185
|
+
values it compares, and the rank is not one of them. For best-match-first
|
|
186
|
+
pages, use <a href="#paginate" class="tsd-kind-method">Query.paginate</a>.</p>
|
|
151
187
|
<pre><code class="ts"><span class="hl-7">// First page (using undefined to start from beginning)</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">firstPage</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">order</span><span class="hl-1">(</span><span class="hl-6">'email'</span><span class="hl-1">).</span><span class="hl-5">cursorPaginate</span><span class="hl-1">({ </span><span class="hl-4">pageSize:</span><span class="hl-1"> </span><span class="hl-8">100</span><span class="hl-1">, </span><span class="hl-4">cursor:</span><span class="hl-1"> </span><span class="hl-0">undefined</span><span class="hl-1"> })</span><br/><span class="hl-4">firstPage</span><span class="hl-1">.</span><span class="hl-4">results</span><br/><span class="hl-7">// [ { User{id: 777}, User{id: 776}, ...}]</span><br/><br/><span class="hl-4">firstPage</span><span class="hl-1">.</span><span class="hl-4">cursor</span><br/><span class="hl-7">// "100" (or null if no more pages)</span><br/><br/><span class="hl-7">// Next page using cursor from previous result</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">nextPage</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">order</span><span class="hl-1">(</span><span class="hl-6">'email'</span><span class="hl-1">).</span><span class="hl-5">cursorPaginate</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">pageSize:</span><span class="hl-1"> </span><span class="hl-8">100</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">cursor:</span><span class="hl-1"> </span><span class="hl-4">firstPage</span><span class="hl-1">.</span><span class="hl-4">cursor</span><br/><span class="hl-1">})</span>
|
|
152
188
|
</code><button type="button">Copy</button></pre>
|
|
153
189
|
|
|
154
190
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="cursorpaginateq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></span></li><li><span id="cursorpaginateincompatible"><span class="tsd-kind-type-parameter">Incompatible</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">boolean</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#cursorpaginateq">Q</a></span></li><li><span><span class="tsd-kind-parameter">opts</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#cursorpaginateincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">"scrollPaginate is incompatible with limit, offset, and leftJoinPreload"</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CursorPaginatedDreamQueryOptions</span></span><div class="tsd-comment tsd-typography"><p>cursor pagination options</p>
|
|
155
191
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">CursorPaginatedDreamQueryResult</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><p>results.cursor - identifier for the next page, or null if no more pages</p>
|
|
156
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
192
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2650">src/dream/Query.ts:2650</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="dbdriverinstance"><span>db<wbr/>Driver<wbr/>Instance</span><a href="#dbdriverinstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="dbdriverinstance-1"><span class="tsd-kind-call-signature">dbDriverInstance</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">query</span><span class="tsd-signature-symbol">?:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="db.QueryDriverBase.html" class="tsd-signature-type tsd-kind-class">QueryDriverBase</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><a href="#dbdriverinstance-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">query</span>: <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> = ...</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="db.QueryDriverBase.html" class="tsd-signature-type tsd-kind-class">QueryDriverBase</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2391">src/dream/Query.ts:2391</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="delete"><span>delete</span><a href="#delete" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="delete-1"><span class="tsd-kind-call-signature">delete</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#delete-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Deletes all records matching query using a single
|
|
157
193
|
database query, but does not call underlying callbacks.
|
|
158
194
|
Ignores association dependent destroy declarations,
|
|
159
195
|
though cascading may still happen at the database level.</p>
|
|
@@ -163,7 +199,7 @@ use <a href="#destroy" class="tsd-kind-method">Query.destroy</a> instead.</p>
|
|
|
163
199
|
</code><button type="button">Copy</button></pre>
|
|
164
200
|
|
|
165
201
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4><p>The number of records that were removed</p>
|
|
166
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
202
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L3442">src/dream/Query.ts:3442</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="destroy"><span>destroy</span><a href="#destroy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="destroy-1"><span class="tsd-kind-call-signature">destroy</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">batchSize</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">cascade</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">lock</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">skipHooks</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#destroy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Destroys all records matching the Query,
|
|
167
203
|
calling model hooks and cascading destroy
|
|
168
204
|
to associations with <code>dependent: 'destroy'</code>,
|
|
169
205
|
and returns the number of records that
|
|
@@ -264,7 +300,7 @@ carries through to the cascade.</p>
|
|
|
264
300
|
</div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4><p>The number of records that were removed</p>
|
|
265
301
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws">Throws<a href="#throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>InvalidBatchSize if <code>batchSize</code> is not a positive integer</p>
|
|
266
302
|
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-1">Throws<a href="#throws-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>BatchingIncompatibleWithLimitOrOffset if the query carries a <code>limit</code> or <code>offset</code></p>
|
|
267
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
303
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L3072">src/dream/Query.ts:3072</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="distinct"><span>distinct</span><a href="#distinct" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="distinct-1"><span class="tsd-kind-call-signature">distinct</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">column</span><span class="tsd-signature-symbol">?:</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">boolean</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">TableColumnNames</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#distinct-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns new Query with distinct clause applied.
|
|
268
304
|
If no column is specified, applies distinct to the primary key.
|
|
269
305
|
Pass true to apply distinct to primary key, false to disable distinct.</p>
|
|
270
306
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">distinct</span><span class="hl-1">(</span><span class="hl-6">'name'</span><span class="hl-1">).</span><span class="hl-5">pluck</span><span class="hl-1">(</span><span class="hl-6">'name'</span><span class="hl-1">)</span><br/><span class="hl-7">// Returns unique names</span><br/><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">distinct</span><span class="hl-1">(</span><span class="hl-0">true</span><span class="hl-1">).</span><span class="hl-5">pluck</span><span class="hl-1">(</span><span class="hl-6">'id'</span><span class="hl-1">)</span><br/><span class="hl-7">// Returns unique primary keys</span><br/><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">distinct</span><span class="hl-1">(</span><span class="hl-0">false</span><span class="hl-1">).</span><span class="hl-5">pluck</span><span class="hl-1">(</span><span class="hl-6">'name'</span><span class="hl-1">)</span><br/><span class="hl-7">// Disables distinct, returns all names including duplicates</span>
|
|
@@ -272,19 +308,19 @@ Pass true to apply distinct to primary key, false to disable distinct.</p>
|
|
|
272
308
|
|
|
273
309
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">column</span>: <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">TableColumnNames</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> = true</span></span><div class="tsd-comment tsd-typography"><p>The column name to apply distinct to, <code>true</code> to enable distinct on primary key, or <code>false</code> to disable a previously applied distinct call</p>
|
|
274
310
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A cloned Query with the distinct clause applied</p>
|
|
275
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
311
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1885">src/dream/Query.ts:1885</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="exists"><span>exists</span><a href="#exists" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="exists-1"><span class="tsd-kind-call-signature">exists</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span><a href="#exists-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns true if a record exists for the given Query, false otherwise.</p>
|
|
276
312
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">exists</span><span class="hl-1">()</span><br/><span class="hl-7">// false</span><br/><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">create</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-6">'how@yadoin'</span><span class="hl-1"> })</span><br/><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">exists</span><span class="hl-1">()</span><br/><span class="hl-7">// true</span><br/><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">where</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-6">'nonexistent@example.com'</span><span class="hl-1"> }).</span><span class="hl-5">exists</span><span class="hl-1">()</span><br/><span class="hl-7">// false</span>
|
|
277
313
|
</code><button type="button">Copy</button></pre>
|
|
278
314
|
|
|
279
315
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></h4><p>boolean - true if any records match the query, false otherwise</p>
|
|
280
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
316
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2861">src/dream/Query.ts:2861</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="find"><span>find</span><a href="#find" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="find-1"><span class="tsd-kind-call-signature">find</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">primaryKey</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">PrimaryKeyForFind</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span><a href="#find-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Finds a record matching the Query with the
|
|
281
317
|
specified primary key. Returns null if not found.</p>
|
|
282
318
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">find</span><span class="hl-1">(</span><span class="hl-8">123</span><span class="hl-1">)</span><br/><span class="hl-7">// User{id: 123}</span><br/><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">find</span><span class="hl-1">(</span><span class="hl-0">null</span><span class="hl-1">)</span><br/><span class="hl-7">// null</span><br/><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">find</span><span class="hl-1">(</span><span class="hl-0">undefined</span><span class="hl-1">)</span><br/><span class="hl-7">// null</span>
|
|
283
319
|
</code><button type="button">Copy</button></pre>
|
|
284
320
|
|
|
285
321
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">primaryKey</span>: <span class="tsd-signature-type">PrimaryKeyForFind</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>The primary key of the record to look up.</p>
|
|
286
322
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span></h4><p>Either the found record, or else null</p>
|
|
287
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
323
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L532">src/dream/Query.ts:532</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="findby"><span>find<wbr/>By</span><a href="#findby" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="findby-1"><span class="tsd-kind-call-signature">findBy</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">whereStatement</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">WhereStatement</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span><a href="#findby-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Finds a record matching the Query and the
|
|
288
324
|
specified where statement. If not found, null
|
|
289
325
|
is returned.</p>
|
|
290
326
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">findBy</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-6">'how@yadoin'</span><span class="hl-1"> })</span><br/><span class="hl-7">// User{email: 'how@yadoin'}</span>
|
|
@@ -292,7 +328,7 @@ is returned.</p>
|
|
|
292
328
|
|
|
293
329
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">whereStatement</span>: <span class="tsd-signature-type">WhereStatement</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>The where statement used to locate the record</p>
|
|
294
330
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span></h4><p>Either the first record found matching the attributes, or else null</p>
|
|
295
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
331
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L572">src/dream/Query.ts:572</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="findeach"><span>find<wbr/>Each</span><a href="#findeach" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="findeach-1"><span class="tsd-kind-call-signature">findEach</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">this</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">cb</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">instance</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">__namedParameters</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">batchSize</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#findeach-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Finds all records matching the Query in batches,
|
|
296
332
|
and then calls the provided callback for each found record.
|
|
297
333
|
Once all records have been passed for a given batch, the next set of
|
|
298
334
|
records will be fetched and passed to your callback, until all
|
|
@@ -302,28 +338,51 @@ records matching the Query have been fetched.</p>
|
|
|
302
338
|
|
|
303
339
|
<p>IMPORTANT: <code>findEach</code> always iterates in ascending primary key order.
|
|
304
340
|
Any <code>order</code> applied to the Query is discarded; passing one has no effect
|
|
305
|
-
on the order records are visited in
|
|
341
|
+
on the order records are visited in. The same goes for the <code>order</code> an
|
|
342
|
+
association declares, when the Query is an <code>associationQuery</code> or joins
|
|
343
|
+
that association, and for the relevance ranking of a similarity condition
|
|
344
|
+
(<code>ops.similarity</code>, <code>ops.wordSimilarity</code>, <code>ops.strictWordSimilarity</code>),
|
|
345
|
+
which still decides which records are visited, but not in what order.
|
|
346
|
+
<code>findEach</code> visits the records <a href="#all" class="tsd-kind-method">Query.all</a> returns: a Query that
|
|
347
|
+
joins a HasOne or HasMany association (directly, through an association
|
|
348
|
+
it joins, or as the association an <code>associationQuery</code> goes through)
|
|
349
|
+
returns a record once for each row the join matches, and <code>findEach</code>
|
|
350
|
+
visits it once for each of those rows, the rows of one record in
|
|
351
|
+
ascending order of the joined rows' primary keys. Call <code>distinct()</code> to
|
|
352
|
+
visit each record once.</p>
|
|
306
353
|
<p>This is not a limitation that can be lifted. <code>findEach</code> guarantees that
|
|
307
|
-
every matching
|
|
308
|
-
paginating on a keyset: each batch selects the next <code>batchSize</code>
|
|
309
|
-
|
|
310
|
-
That guarantee only holds over a stable,
|
|
311
|
-
mutable, non-unique column would mean a record
|
|
312
|
-
partway through the iteration could be skipped
|
|
313
|
-
(<a href="#cursorpaginate" class="tsd-kind-method">Query.cursorPaginate</a> can honor an
|
|
314
|
-
because a paginated UI tolerates that anomaly;
|
|
354
|
+
every matching row is visited exactly once, and it delivers that by
|
|
355
|
+
paginating on a keyset: each batch selects the next <code>batchSize</code> rows
|
|
356
|
+
whose primary keys (the record's, then the joined rows') sort after the
|
|
357
|
+
last row of the previous batch. That guarantee only holds over a stable,
|
|
358
|
+
unique key. Ordering by a mutable, non-unique column would mean a record
|
|
359
|
+
whose sort value changed partway through the iteration could be skipped
|
|
360
|
+
entirely or visited twice. (<a href="#cursorpaginate" class="tsd-kind-method">Query.cursorPaginate</a> can honor an
|
|
361
|
+
arbitrary order precisely because a paginated UI tolerates that anomaly;
|
|
362
|
+
a full traversal cannot.)</p>
|
|
363
|
+
<p>A Query that keeps one record of each group (one that calls <code>distinct</code>,
|
|
364
|
+
or an <code>associationQuery</code> of an association that declares <code>distinct</code>, or
|
|
365
|
+
a Query that joins one) cannot be paginated that way: its own <code>order</code>, or
|
|
366
|
+
the association's, chooses which record of each group it returns, and a
|
|
367
|
+
batch that narrowed it to the rows after the previous batch would let it
|
|
368
|
+
choose another. So <code>findEach</code> reads the keys of all of its rows before
|
|
369
|
+
visiting the first, and visits those whose rows still match when their
|
|
370
|
+
batch is read. It visits the rows the Query returned when the walk began,
|
|
371
|
+
less any destroyed or changed so that they no longer match the Query's
|
|
372
|
+
conditions, and not a row the Query returns only after the walk began,
|
|
373
|
+
such as the next record of a group whose record the callback destroyed.</p>
|
|
315
374
|
<p>If you need records processed in a particular order, load them with a
|
|
316
375
|
regular ordered query instead of <code>findEach</code>.</p>
|
|
317
|
-
<p>A <code>limit</code> or <code>offset</code> on the Query cannot compose with the
|
|
318
|
-
|
|
376
|
+
<p>A <code>limit</code> or <code>offset</code> on the Query cannot compose with the batches —
|
|
377
|
+
each batch re-applies the Query's conditions, so the limit would be
|
|
319
378
|
silently replaced by <code>batchSize</code> and the offset re-applied to every
|
|
320
|
-
|
|
379
|
+
batch — so a limit- or offset-carrying Query throws at runtime.</p>
|
|
321
380
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span><span class="tsd-kind-parameter">cb</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">instance</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span> <span class="tsd-signature-type">void</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>The callback to call for each found record</p>
|
|
322
381
|
</div></li><li><span><span class="tsd-kind-parameter">__namedParameters</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">batchSize</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = {}</span></span><div class="tsd-comment tsd-typography"><p>Options for batch processing</p>
|
|
323
382
|
</div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">batchSize</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><p>The batch size you wish to collect records in. If not provided, it will default to 1000</p>
|
|
324
383
|
</div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>void</p>
|
|
325
384
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-2">Throws<a href="#throws-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>BatchingIncompatibleWithLimitOrOffset if the query carries a <code>limit</code> or <code>offset</code></p>
|
|
326
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
385
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L662">src/dream/Query.ts:662</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="findorfail"><span>find<wbr/>Or<wbr/>Fail</span><a href="#findorfail" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="findorfail-1"><span class="tsd-kind-call-signature">findOrFail</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">primaryKey</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">PrimaryKeyForFind</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><a href="#findorfail-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Finds a record matching the Query with the
|
|
327
386
|
specified primary key. If not found, an exception
|
|
328
387
|
is raised.</p>
|
|
329
388
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">findOrFail</span><span class="hl-1">(</span><span class="hl-8">123</span><span class="hl-1">)</span><br/><span class="hl-7">// User{id: 123}</span>
|
|
@@ -331,7 +390,7 @@ is raised.</p>
|
|
|
331
390
|
|
|
332
391
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">primaryKey</span>: <span class="tsd-signature-type">PrimaryKeyForFind</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>The primary key of the record to look up</p>
|
|
333
392
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></h4><p>The found record</p>
|
|
334
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
393
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L553">src/dream/Query.ts:553</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="findorfailby"><span>find<wbr/>Or<wbr/>Fail<wbr/>By</span><a href="#findorfailby" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="findorfailby-1"><span class="tsd-kind-call-signature">findOrFailBy</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">whereStatement</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">WhereStatement</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><a href="#findorfailby-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Finds a record matching the Query and the
|
|
335
394
|
specified where statement. If not found, an exception
|
|
336
395
|
is raised.</p>
|
|
337
396
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">findOrFailBy</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-6">'how@yadoin'</span><span class="hl-1"> })</span><br/><span class="hl-7">// User{email: 'how@yadoin'}</span>
|
|
@@ -339,7 +398,7 @@ is raised.</p>
|
|
|
339
398
|
|
|
340
399
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">whereStatement</span>: <span class="tsd-signature-type">WhereStatement</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>The where statement used to locate the record</p>
|
|
341
400
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></h4><p>The first record found matching the attributes</p>
|
|
342
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
401
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L589">src/dream/Query.ts:589</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="first"><span>first</span><a href="#first" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="first-1"><span class="tsd-kind-call-signature">first</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span><a href="#first-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the first record in the database
|
|
343
402
|
matching the Query. If the Query is not
|
|
344
403
|
ordered, it will automatically order
|
|
345
404
|
by primary key.</p>
|
|
@@ -347,7 +406,7 @@ by primary key.</p>
|
|
|
347
406
|
</code><button type="button">Copy</button></pre>
|
|
348
407
|
|
|
349
408
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span></h4><p>First record in the database, or null if no record exists</p>
|
|
350
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
409
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2884">src/dream/Query.ts:2884</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="firstorfail"><span>first<wbr/>Or<wbr/>Fail</span><a href="#firstorfail" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="firstorfail-1"><span class="tsd-kind-call-signature">firstOrFail</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><a href="#firstorfail-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the first record in the database
|
|
351
410
|
matching the Query. If the Query is not
|
|
352
411
|
ordered, it will automatically order
|
|
353
412
|
by primary key. If no record is found,
|
|
@@ -357,14 +416,14 @@ an exception is raised.</p>
|
|
|
357
416
|
|
|
358
417
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></h4><p>First record in the database</p>
|
|
359
418
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-3">Throws<a href="#throws-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>RecordNotFound if no record exists</p>
|
|
360
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ca5a693d77d580b63e885f3eaf29598becd0a1a8/src/dream/Query.ts#L2558">src/dream/Query.ts:2558</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="innerjoin"><span>inner<wbr/>Join</span><a href="#innerjoin" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="innerjoin-1"><span class="tsd-kind-call-signature">innerJoin</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoindb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinschema">Schema</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjointablename">TableName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinarr">Arr</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinlastarg">LastArg</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">JoinedAssociationsTypeFromAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoindb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjointablename">TableName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinretquery">RetQuery</a> <span class="tsd-signature-symbol">=</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLeftJoinPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLimit"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowOffset"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPaginate"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-symbol">[</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociations">JoinedAssociations</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinretquery">RetQuery</a><a href="#innerjoin-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a new Query instance, with the provided
|
|
419
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2907">src/dream/Query.ts:2907</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="innerjoin"><span>inner<wbr/>Join</span><a href="#innerjoin" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="innerjoin-1"><span class="tsd-kind-call-signature">innerJoin</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoindb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinschema">Schema</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjointablename">TableName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinarr">Arr</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinlastarg">LastArg</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">JoinedAssociationsTypeFromAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoindb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjointablename">TableName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinretquery">RetQuery</a> <span class="tsd-signature-symbol">=</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLeftJoinPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLimit"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowOffset"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPaginate"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-symbol">[</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociations">JoinedAssociations</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinretquery">RetQuery</a><a href="#innerjoin-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a new Query instance, with the provided
|
|
361
420
|
joins statement attached</p>
|
|
362
421
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">innerJoin</span><span class="hl-1">(</span><span class="hl-6">'posts'</span><span class="hl-1">).</span><span class="hl-5">first</span><span class="hl-1">()</span>
|
|
363
422
|
</code><button type="button">Copy</button></pre>
|
|
364
423
|
|
|
365
424
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="innerjoindb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="innerjoinschema"><span class="tsd-kind-type-parameter">Schema</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="innerjointablename"><span class="tsd-kind-type-parameter">TableName</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span></span></li><li><span id="innerjoinarr"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">Arr</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span></span></li><li><span id="innerjoinlastarg"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">LastArg</span></span></li><li><span id="innerjoinjoinedassociationscandidate"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">JoinedAssociationsCandidate</span> = <span class="tsd-signature-type">JoinedAssociationsTypeFromAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoindb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjointablename">TableName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span></li><li><span id="innerjoinjoinedassociations"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">JoinedAssociations</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span> = <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">never</span></span></li><li><span id="innerjoinretquery"><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLeftJoinPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLimit"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowOffset"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPaginate"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-symbol">[</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinjoinedassociations">JoinedAssociations</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinlastarg">LastArg</a><span class="tsd-signature-symbol">]</span></span><div class="tsd-comment tsd-typography"><p>A chain of association names and and/andNot/andAny clauses</p>
|
|
366
425
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="#innerjoinretquery">RetQuery</a></h4><p>A cloned Query with the joins clause applied</p>
|
|
367
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
426
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1099">src/dream/Query.ts:1099</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="last"><span>last</span><a href="#last" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="last-1"><span class="tsd-kind-call-signature">last</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span><a href="#last-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the last record in the database
|
|
368
427
|
matching the Query. If the Query is not
|
|
369
428
|
ordered, it will automatically order
|
|
370
429
|
by primary key.</p>
|
|
@@ -372,7 +431,7 @@ by primary key.</p>
|
|
|
372
431
|
</code><button type="button">Copy</button></pre>
|
|
373
432
|
|
|
374
433
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">></span></h4><p>Last record in the database, or null if no record exists</p>
|
|
375
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
434
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2929">src/dream/Query.ts:2929</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="lastorfail"><span>last<wbr/>Or<wbr/>Fail</span><a href="#lastorfail" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="lastorfail-1"><span class="tsd-kind-call-signature">lastOrFail</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><a href="#lastorfail-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the last record in the database
|
|
376
435
|
matching the Query. If the Query is not
|
|
377
436
|
ordered, it will automatically order
|
|
378
437
|
by primary key. If no record is found,
|
|
@@ -382,9 +441,9 @@ it will raise an exception.</p>
|
|
|
382
441
|
|
|
383
442
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></h4><p>Last record in the database</p>
|
|
384
443
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-4">Throws<a href="#throws-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>RecordNotFound if no record exists</p>
|
|
385
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ca5a693d77d580b63e885f3eaf29598becd0a1a8/src/dream/Query.ts#L2604">src/dream/Query.ts:2604</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="leftjoin"><span>left<wbr/>Join</span><a href="#leftjoin" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="leftjoin-1"><span class="tsd-kind-call-signature">leftJoin</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoindb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinschema">Schema</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjointablename">TableName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinarr">Arr</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinlastarg">LastArg</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">JoinedAssociationsTypeFromAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoindb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjointablename">TableName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinretquery">RetQuery</a> <span class="tsd-signature-symbol">=</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLeftJoinPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLimit"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowOffset"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPaginate"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-symbol">[</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociations">JoinedAssociations</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinretquery">RetQuery</a><a href="#leftjoin-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><code class="tsd-tag">Internal</code><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="leftjoindb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="leftjoinschema"><span class="tsd-kind-type-parameter">Schema</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="leftjointablename"><span class="tsd-kind-type-parameter">TableName</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span></span></li><li><span id="leftjoinarr"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">Arr</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span></span></li><li><span id="leftjoinlastarg"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">LastArg</span></span></li><li><span id="leftjoinjoinedassociationscandidate"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">JoinedAssociationsCandidate</span> = <span class="tsd-signature-type">JoinedAssociationsTypeFromAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoindb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjointablename">TableName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span></li><li><span id="leftjoinjoinedassociations"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">JoinedAssociations</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span> = <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">never</span></span></li><li><span id="leftjoinretquery"><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLeftJoinPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLimit"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowOffset"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPaginate"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-symbol">[</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociations">JoinedAssociations</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinlastarg">LastArg</a><span class="tsd-signature-symbol">]</span></span><div class="tsd-comment tsd-typography"><p>A chain of association names and and/andNot/andAny clauses</p>
|
|
444
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2953">src/dream/Query.ts:2953</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="leftjoin"><span>left<wbr/>Join</span><a href="#leftjoin" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="leftjoin-1"><span class="tsd-kind-call-signature">leftJoin</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoindb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinschema">Schema</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjointablename">TableName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinarr">Arr</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinlastarg">LastArg</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">JoinedAssociationsTypeFromAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoindb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjointablename">TableName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinretquery">RetQuery</a> <span class="tsd-signature-symbol">=</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLeftJoinPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLimit"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowOffset"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPaginate"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-symbol">[</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociations">JoinedAssociations</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinretquery">RetQuery</a><a href="#leftjoin-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><code class="tsd-tag">Internal</code><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="leftjoindb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="leftjoinschema"><span class="tsd-kind-type-parameter">Schema</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="leftjointablename"><span class="tsd-kind-type-parameter">TableName</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span></span></li><li><span id="leftjoinarr"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">Arr</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span></span></li><li><span id="leftjoinlastarg"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">LastArg</span></span></li><li><span id="leftjoinjoinedassociationscandidate"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">JoinedAssociationsCandidate</span> = <span class="tsd-signature-type">JoinedAssociationsTypeFromAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoindb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjointablename">TableName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span></li><li><span id="leftjoinjoinedassociations"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">JoinedAssociations</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span> = <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociationscandidate">JoinedAssociationsCandidate</a><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">never</span></span></li><li><span id="leftjoinretquery"><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLeftJoinPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLimit"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowOffset"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPaginate"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-symbol">[</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinjoinedassociations">JoinedAssociations</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinlastarg">LastArg</a><span class="tsd-signature-symbol">]</span></span><div class="tsd-comment tsd-typography"><p>A chain of association names and and/andNot/andAny clauses</p>
|
|
386
445
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinretquery">RetQuery</a></h4><p>A cloned Query with the joins clause applied</p>
|
|
387
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ca5a693d77d580b63e885f3eaf29598becd0a1a8/src/dream/Query.ts#L941">src/dream/Query.ts:941</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="leftjoinpreload"><span>left<wbr/>Join<wbr/>Preload</span><a href="#leftjoinpreload" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="leftjoinpreload-1"><span class="tsd-kind-call-signature">leftJoinPreload</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloaddb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadschema">Schema</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadtablename">TableName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadarr">Arr</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadlastarg">LastArg</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">JoinedAssociationsTypeFromAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloaddb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadtablename">TableName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociationscandidate">JoinedAssociationsCandidate</a><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadretquery">RetQuery</a> <span class="tsd-signature-symbol">=</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLeftJoinPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-symbol">[</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociations">JoinedAssociations</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">this</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadq">Q</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">"leftJoinPreload is incompatible with preload, limit, offset, and paginate"</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadretquery">RetQuery</a><a href="#leftjoinpreload-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Load each specified association using a single SQL query.
|
|
446
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1154">src/dream/Query.ts:1154</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="leftjoinpreload"><span>left<wbr/>Join<wbr/>Preload</span><a href="#leftjoinpreload" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="leftjoinpreload-1"><span class="tsd-kind-call-signature">leftJoinPreload</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloaddb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadschema">Schema</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadtablename">TableName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadarr">Arr</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadlastarg">LastArg</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-symbol">=</span> <span class="tsd-signature-type">JoinedAssociationsTypeFromAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloaddb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadtablename">TableName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociationscandidate">JoinedAssociationsCandidate</a><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadretquery">RetQuery</a> <span class="tsd-signature-symbol">=</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLeftJoinPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-symbol">[</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociations">JoinedAssociations</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">this</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadq">Q</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">"leftJoinPreload is incompatible with preload, limit, offset, and paginate"</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadretquery">RetQuery</a><a href="#leftjoinpreload-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Load each specified association using a single SQL query.
|
|
388
447
|
See <a href="#preload" class="tsd-kind-method">Query.preload</a> for preloading in separate queries.</p>
|
|
389
448
|
<p>Note: since leftJoinPreload loads via single query, it has
|
|
390
449
|
some downsides and that may be avoided using <a href="#preload" class="tsd-kind-method">Query.preload</a>:</p>
|
|
@@ -406,12 +465,12 @@ documented on the <code>ignoredColumns</code> getter of Dream: declaring the
|
|
|
406
465
|
column ignored removes it from the generated schema, so leftJoinPreload
|
|
407
466
|
stops naming it a full deploy before the column is actually dropped.</li>
|
|
408
467
|
</ol>
|
|
409
|
-
<pre><code class="ts"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">posts</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">user</span><span class="hl-1">.</span><span class="hl-5">associationQuery</span><span class="hl-1">(</span><span class="hl-6">'posts'</span><span class="hl-1">).</span><span class="hl-5">leftJoinPreload</span><span class="hl-1">(</span><span class="hl-6">'comments'</span><span class="hl-1">, { </span><span class="hl-4">
|
|
468
|
+
<pre><code class="ts"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">posts</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">user</span><span class="hl-1">.</span><span class="hl-5">associationQuery</span><span class="hl-1">(</span><span class="hl-6">'posts'</span><span class="hl-1">).</span><span class="hl-5">leftJoinPreload</span><span class="hl-1">(</span><span class="hl-6">'comments'</span><span class="hl-1">, { </span><span class="hl-4">and:</span><span class="hl-1"> { </span><span class="hl-4">visibility:</span><span class="hl-1"> </span><span class="hl-6">'public'</span><span class="hl-1"> } }, </span><span class="hl-6">'replies'</span><span class="hl-1">).</span><span class="hl-5">all</span><span class="hl-1">()</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-5">log</span><span class="hl-1">(</span><span class="hl-4">posts</span><span class="hl-1">[</span><span class="hl-8">0</span><span class="hl-1">].</span><span class="hl-4">comments</span><span class="hl-1">[</span><span class="hl-8">0</span><span class="hl-1">].</span><span class="hl-4">replies</span><span class="hl-1">[</span><span class="hl-8">0</span><span class="hl-1">])</span><br/><span class="hl-7">// [Reply{id: 1}, Reply{id: 2}]</span>
|
|
410
469
|
</code><button type="button">Copy</button></pre>
|
|
411
470
|
|
|
412
471
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="leftjoinpreloadq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></span></li><li><span id="leftjoinpreloaddb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="leftjoinpreloadschema"><span class="tsd-kind-type-parameter">Schema</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="leftjoinpreloadtablename"><span class="tsd-kind-type-parameter">TableName</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span></span></li><li><span id="leftjoinpreloadarr"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">Arr</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span></span></li><li><span id="leftjoinpreloadlastarg"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">LastArg</span></span></li><li><span id="leftjoinpreloadincompatible"><span class="tsd-kind-type-parameter">Incompatible</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">boolean</span></span></li><li><span id="leftjoinpreloadjoinedassociationscandidate"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">JoinedAssociationsCandidate</span> = <span class="tsd-signature-type">JoinedAssociationsTypeFromAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloaddb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadtablename">TableName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadlastarg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span></li><li><span id="leftjoinpreloadjoinedassociations"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">JoinedAssociations</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span> = <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociationscandidate">JoinedAssociationsCandidate</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociationscandidate">JoinedAssociationsCandidate</a><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">never</span></span></li><li><span id="leftjoinpreloadretquery"><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLeftJoinPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociations">JoinedAssociations</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">JoinedAssociation</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-symbol">[</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadjoinedassociations">JoinedAssociations</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadq">Q</a></span></li><li><span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">"leftJoinPreload is incompatible with preload, limit, offset, and paginate"</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadlastarg">LastArg</a><span class="tsd-signature-symbol">]</span></span><div class="tsd-comment tsd-typography"><p>A chain of association names and and/andNot/andAny clauses</p>
|
|
413
472
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="#leftjoinpreloadretquery">RetQuery</a></h4><p>A cloned Query with the joinLoad statement applied</p>
|
|
414
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
473
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L899">src/dream/Query.ts:899</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="limit"><span>limit</span><a href="#limit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="limit-1"><span class="tsd-kind-call-signature">limit</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#limitq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#limitincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#limitretquery">RetQuery</a> <span class="tsd-signature-symbol">=</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLimit"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowOffset"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">this</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#limitq">Q</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">limit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#limitincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">"limit is incompatible with paginate and leftJoinPreload"</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#limitretquery">RetQuery</a><a href="#limit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a new Query instance, specifying a limit</p>
|
|
415
474
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">order</span><span class="hl-1">(</span><span class="hl-6">'id'</span><span class="hl-1">).</span><span class="hl-5">limit</span><span class="hl-1">(</span><span class="hl-8">2</span><span class="hl-1">).</span><span class="hl-5">all</span><span class="hl-1">()</span><br/><span class="hl-7">// [User{id: 1}, User{id: 2}]</span>
|
|
416
475
|
</code><button type="button">Copy</button></pre>
|
|
417
476
|
|
|
@@ -421,14 +480,14 @@ the batched and set-write operations — <code>findEach</code>, <code>pluckEach<
|
|
|
421
480
|
honor one: the batched and set-write operations throw
|
|
422
481
|
<code>BatchingIncompatibleWithLimitOrOffset</code> on a limit-carrying Query.</p>
|
|
423
482
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="limitq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></span></li><li><span id="limitincompatible"><span class="tsd-kind-type-parameter">Incompatible</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">boolean</span></span></li><li><span id="limitretquery"><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLimit"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowOffset"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#limitq">Q</a></span></li><li><span><span class="tsd-kind-parameter">limit</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#limitincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">"limit is incompatible with paginate and leftJoinPreload"</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="#limitretquery">RetQuery</a></h4><p>A cloned Query with the limit clause applied</p>
|
|
424
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
483
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1656">src/dream/Query.ts:1656</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="max"><span>max</span><a href="#max" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="max-1"><span class="tsd-kind-call-signature">max</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxdb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxcolumnname">ColumnName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxreturntype">ReturnType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">columnName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxcolumnname">ColumnName</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maxreturntype">ReturnType</a><span class="tsd-signature-symbol">></span><a href="#max-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the max value of the specified column
|
|
425
484
|
for this Query</p>
|
|
426
485
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">max</span><span class="hl-1">(</span><span class="hl-6">'id'</span><span class="hl-1">)</span><br/><span class="hl-7">// 99</span>
|
|
427
486
|
</code><button type="button">Copy</button></pre>
|
|
428
487
|
|
|
429
488
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="maxq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span id="maxdb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="maxcolumnname"><span class="tsd-kind-type-parameter">ColumnName</span></span></li><li><span id="maxreturntype"><span class="tsd-kind-type-parameter">ReturnType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">columnName</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxcolumnname">ColumnName</a></span><div class="tsd-comment tsd-typography"><p>a column name on the model</p>
|
|
430
489
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maxreturntype">ReturnType</a><span class="tsd-signature-symbol">></span></h4><p>the max value of the specified column for this Query</p>
|
|
431
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
490
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1923">src/dream/Query.ts:1923</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="maxby"><span>max<wbr/>By</span><a href="#maxby" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="maxby-1"><span class="tsd-kind-call-signature">maxBy</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxbyq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxbydb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxbygroupcolumnname">GroupColumnName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxbyaggregatedcolumnname">AggregatedColumnName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxbygroupkey">GroupKey</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxbyaggregatedtype">AggregatedType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">groupColumn</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxbygroupcolumnname">GroupColumnName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">aggregatedColumn</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxbyaggregatedcolumnname">AggregatedColumnName</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maxbygroupkey">GroupKey</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxbyaggregatedtype">AggregatedType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#maxby-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the max value of the specified column within each group, keyed by
|
|
432
491
|
the value of the provided group column (a SQL <code>GROUP BY</code>).</p>
|
|
433
492
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">CompositionAsset</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">maxBy</span><span class="hl-1">(</span><span class="hl-6">'name'</span><span class="hl-1">, </span><span class="hl-6">'score'</span><span class="hl-1">)</span><br/><span class="hl-7">// Map(2) { 'primary' => 9, 'secondary' => 4 }</span>
|
|
434
493
|
</code><button type="button">Copy</button></pre>
|
|
@@ -444,14 +503,14 @@ are grouped under a real <code>null</code> key; a group whose aggregated values
|
|
|
444
503
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="maxbyq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span id="maxbydb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="maxbygroupcolumnname"><span class="tsd-kind-type-parameter">GroupColumnName</span></span></li><li><span id="maxbyaggregatedcolumnname"><span class="tsd-kind-type-parameter">AggregatedColumnName</span></span></li><li><span id="maxbygroupkey"><span class="tsd-kind-type-parameter">GroupKey</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="maxbyaggregatedtype"><span class="tsd-kind-type-parameter">AggregatedType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">groupColumn</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxbygroupcolumnname">GroupColumnName</a></span><div class="tsd-comment tsd-typography"><p>the column to group by (base or joined-association-namespaced)</p>
|
|
445
504
|
</div></li><li><span><span class="tsd-kind-parameter">aggregatedColumn</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxbyaggregatedcolumnname">AggregatedColumnName</a></span><div class="tsd-comment tsd-typography"><p>the column to take the max of within each group</p>
|
|
446
505
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#maxbygroupkey">GroupKey</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#maxbyaggregatedtype">AggregatedType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><p>A Map from each present group value to the max of the aggregated column in that group</p>
|
|
447
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
506
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1960">src/dream/Query.ts:1960</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="min"><span>min</span><a href="#min" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="min-1"><span class="tsd-kind-call-signature">min</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#minq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#mindb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#mincolumnname">ColumnName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#minreturntype">ReturnType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">columnName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#mincolumnname">ColumnName</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#minreturntype">ReturnType</a><span class="tsd-signature-symbol">></span><a href="#min-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the min value of the specified column
|
|
448
507
|
for this Query</p>
|
|
449
508
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">min</span><span class="hl-1">(</span><span class="hl-6">'id'</span><span class="hl-1">)</span><br/><span class="hl-7">// 1</span>
|
|
450
509
|
</code><button type="button">Copy</button></pre>
|
|
451
510
|
|
|
452
511
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="minq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span id="mindb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="mincolumnname"><span class="tsd-kind-type-parameter">ColumnName</span></span></li><li><span id="minreturntype"><span class="tsd-kind-type-parameter">ReturnType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">columnName</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#mincolumnname">ColumnName</a></span><div class="tsd-comment tsd-typography"><p>a column name on the model</p>
|
|
453
512
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#minreturntype">ReturnType</a><span class="tsd-signature-symbol">></span></h4><p>the min value of the specified column for this Query</p>
|
|
454
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
513
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1996">src/dream/Query.ts:1996</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="minby"><span>min<wbr/>By</span><a href="#minby" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="minby-1"><span class="tsd-kind-call-signature">minBy</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#minbyq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#minbydb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#minbygroupcolumnname">GroupColumnName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#minbyaggregatedcolumnname">AggregatedColumnName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#minbygroupkey">GroupKey</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#minbyaggregatedtype">AggregatedType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">groupColumn</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#minbygroupcolumnname">GroupColumnName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">aggregatedColumn</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#minbyaggregatedcolumnname">AggregatedColumnName</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#minbygroupkey">GroupKey</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#minbyaggregatedtype">AggregatedType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#minby-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the min value of the specified column within each group, keyed by
|
|
455
514
|
the value of the provided group column (a SQL <code>GROUP BY</code>).</p>
|
|
456
515
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">CompositionAsset</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">minBy</span><span class="hl-1">(</span><span class="hl-6">'name'</span><span class="hl-1">, </span><span class="hl-6">'score'</span><span class="hl-1">)</span><br/><span class="hl-7">// Map(2) { 'primary' => 1, 'secondary' => 4 }</span>
|
|
457
516
|
</code><button type="button">Copy</button></pre>
|
|
@@ -467,14 +526,14 @@ are grouped under a real <code>null</code> key; a group whose aggregated values
|
|
|
467
526
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="minbyq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span id="minbydb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="minbygroupcolumnname"><span class="tsd-kind-type-parameter">GroupColumnName</span></span></li><li><span id="minbyaggregatedcolumnname"><span class="tsd-kind-type-parameter">AggregatedColumnName</span></span></li><li><span id="minbygroupkey"><span class="tsd-kind-type-parameter">GroupKey</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="minbyaggregatedtype"><span class="tsd-kind-type-parameter">AggregatedType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">groupColumn</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#minbygroupcolumnname">GroupColumnName</a></span><div class="tsd-comment tsd-typography"><p>the column to group by (base or joined-association-namespaced)</p>
|
|
468
527
|
</div></li><li><span><span class="tsd-kind-parameter">aggregatedColumn</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#minbyaggregatedcolumnname">AggregatedColumnName</a></span><div class="tsd-comment tsd-typography"><p>the column to take the min of within each group</p>
|
|
469
528
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#minbygroupkey">GroupKey</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#minbyaggregatedtype">AggregatedType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><p>A Map from each present group value to the min of the aggregated column in that group</p>
|
|
470
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
529
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2033">src/dream/Query.ts:2033</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="nestedselect"><span>nested<wbr/>Select</span><a href="#nestedselect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="nestedselect-1"><span class="tsd-kind-call-signature">nestedSelect</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#nestedselectsimplefieldtype">SimpleFieldType</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-keyword">typeof</span> <span class="tsd-signature-type">iterator</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"toString"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"charAt"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"charCodeAt"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"concat"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"indexOf"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"lastIndexOf"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"localeCompare"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"match"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"replace"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"search"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"slice"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"split"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"substring"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"toLowerCase"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"toLocaleLowerCase"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"toUpperCase"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"toLocaleUpperCase"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"trim"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"length"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"substr"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"valueOf"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"codePointAt"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"includes"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"endsWith"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"normalize"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"repeat"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"startsWith"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"anchor"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"big"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"blink"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"bold"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"fixed"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"fontcolor"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"fontsize"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"italics"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"link"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"small"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"strike"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"sub"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"sup"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"padStart"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"padEnd"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"trimEnd"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"trimStart"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"trimLeft"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"trimRight"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"matchAll"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"replaceAll"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"at"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"toLocaleString"</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#nestedselectpluckthroughfieldtype">PluckThroughFieldType</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">this</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">selection</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#nestedselectsimplefieldtype">SimpleFieldType</a> <span class="tsd-signature-symbol">|</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#nestedselectpluckthroughfieldtype">PluckThroughFieldType</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">SelectQueryBuilder</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><a href="#nestedselect-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a new Kysely SelectQueryBuilder instance to be used
|
|
471
530
|
in a sub Query</p>
|
|
472
531
|
<pre><code class="ts"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">records</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">where</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">id:</span><span class="hl-1"> </span><span class="hl-4">Post</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">nestedSelect</span><span class="hl-1">(</span><span class="hl-6">'userId'</span><span class="hl-1">),</span><br/><span class="hl-1">}).</span><span class="hl-5">all</span><span class="hl-1">()</span><br/><span class="hl-7">// [User{id: 1}, ...]</span>
|
|
473
532
|
</code><button type="button">Copy</button></pre>
|
|
474
533
|
|
|
475
534
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="nestedselectsimplefieldtype"><span class="tsd-kind-type-parameter">SimpleFieldType</span> <span class="tsd-signature-keyword">extends</span> <br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-keyword">typeof</span> <span class="tsd-signature-type">iterator</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"toString"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"charAt"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"charCodeAt"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"concat"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"indexOf"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"lastIndexOf"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"localeCompare"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"match"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"replace"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"search"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"slice"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"split"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"substring"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"toLowerCase"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"toLocaleLowerCase"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"toUpperCase"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"toLocaleUpperCase"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"trim"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"length"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"substr"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"valueOf"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"codePointAt"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"includes"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"endsWith"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"normalize"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"repeat"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"startsWith"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"anchor"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"big"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"blink"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"bold"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"fixed"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"fontcolor"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"fontsize"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"italics"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"link"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"small"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"strike"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"sub"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"sup"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"padStart"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"padEnd"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"trimEnd"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"trimStart"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"trimLeft"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"trimRight"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"matchAll"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"replaceAll"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"at"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"toLocaleString"</span></span></li><li><span id="nestedselectpluckthroughfieldtype"><span class="tsd-kind-type-parameter">PluckThroughFieldType</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span><span class="tsd-kind-parameter">selection</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#nestedselectsimplefieldtype">SimpleFieldType</a> <span class="tsd-signature-symbol">|</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#nestedselectpluckthroughfieldtype">PluckThroughFieldType</a></span><div class="tsd-comment tsd-typography"><p>the column to use for your nested Query</p>
|
|
476
535
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">SelectQueryBuilder</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></h4><p>A Kysely SelectQueryBuilder instance</p>
|
|
477
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
536
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1588">src/dream/Query.ts:1588</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="offset"><span>offset</span><a href="#offset" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="offset-1"><span class="tsd-kind-call-signature">offset</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#offsetq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#offsetincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#offsetretquery">RetQuery</a> <span class="tsd-signature-symbol">=</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLimit"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowOffset"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">this</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#offsetq">Q</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">offset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#offsetincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">"offset is incompatible with paginate and leftJoinPreload"</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#offsetretquery">RetQuery</a><a href="#offset-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a new Query instance, specifying an offset</p>
|
|
478
537
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">order</span><span class="hl-1">(</span><span class="hl-6">'id'</span><span class="hl-1">).</span><span class="hl-5">offset</span><span class="hl-1">(</span><span class="hl-8">2</span><span class="hl-1">).</span><span class="hl-5">limit</span><span class="hl-1">(</span><span class="hl-8">2</span><span class="hl-1">).</span><span class="hl-5">all</span><span class="hl-1">()</span><br/><span class="hl-7">// [User{id: 3}, User{id: 4}]</span>
|
|
479
538
|
</code><button type="button">Copy</button></pre>
|
|
480
539
|
|
|
@@ -484,7 +543,7 @@ the batched and set-write operations — <code>findEach</code>, <code>pluckEach<
|
|
|
484
543
|
honor one: the batched and set-write operations throw
|
|
485
544
|
<code>BatchingIncompatibleWithLimitOrOffset</code> on an offset-carrying Query.</p>
|
|
486
545
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="offsetq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></span></li><li><span id="offsetincompatible"><span class="tsd-kind-type-parameter">Incompatible</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">boolean</span></span></li><li><span id="offsetretquery"><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLimit"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowOffset"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#offsetq">Q</a></span></li><li><span><span class="tsd-kind-parameter">offset</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#offsetincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">"offset is incompatible with paginate and leftJoinPreload"</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="#offsetretquery">RetQuery</a></h4><p>A cloned Query with the offset clause applied</p>
|
|
487
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
546
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1694">src/dream/Query.ts:1694</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="order"><span>order</span><a href="#order" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="order-1"><span class="tsd-kind-call-signature">order</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#orderq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#orderdb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#ordercolumnname">ColumnName</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">arg</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#ordercolumnname">ColumnName</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#ordercolumnname">ColumnName</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">OrderDir</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#order-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a new Query instance, attaching the provided
|
|
488
547
|
order statement</p>
|
|
489
548
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">order</span><span class="hl-1">(</span><span class="hl-6">'id'</span><span class="hl-1">).</span><span class="hl-5">all</span><span class="hl-1">()</span><br/><span class="hl-7">// [User{id: 1}, User{id: 2}, ...]</span>
|
|
490
549
|
</code><button type="button">Copy</button></pre>
|
|
@@ -494,22 +553,28 @@ order statement</p>
|
|
|
494
553
|
|
|
495
554
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="orderq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span id="orderdb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="ordercolumnname"><span class="tsd-kind-type-parameter">ColumnName</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">arg</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#ordercolumnname">ColumnName</a> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#ordercolumnname">ColumnName</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">OrderDir</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></span><div class="tsd-comment tsd-typography"><p>Either a string or an object specifying order. If a string, the order is implicitly ascending. If the orderStatement is an object, statements will be provided in the order of the keys set in the object</p>
|
|
496
555
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A cloned Query with the order clause applied</p>
|
|
497
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
556
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1613">src/dream/Query.ts:1613</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="paginate"><span>paginate</span><a href="#paginate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="paginate-1"><span class="tsd-kind-call-signature">paginate</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#paginateq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#paginateincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">this</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#paginateq">Q</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#paginateincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">"paginate is incompatible with limit, offset, and leftJoinPreload"</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">PaginatedDreamQueryOptions</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">PaginatedDreamQueryResult</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#paginate-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Paginates the results of your query, accepting a pageSize and page argument,
|
|
498
557
|
which it uses to segment your query into pages, leveraging limit and offset
|
|
499
558
|
to deliver your query to you in pages.</p>
|
|
500
559
|
<pre><code class="ts"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">paginated</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">order</span><span class="hl-1">(</span><span class="hl-6">'email'</span><span class="hl-1">).</span><span class="hl-5">paginate</span><span class="hl-1">({ </span><span class="hl-4">pageSize:</span><span class="hl-1"> </span><span class="hl-8">100</span><span class="hl-1">, </span><span class="hl-4">page:</span><span class="hl-1"> </span><span class="hl-8">2</span><span class="hl-1"> })</span><br/><span class="hl-4">paginated</span><span class="hl-1">.</span><span class="hl-4">results</span><br/><span class="hl-7">// [ { User{id: 101}, User{id: 102}, ...}]</span><br/><br/><span class="hl-4">paginated</span><span class="hl-1">.</span><span class="hl-4">recordCount</span><br/><span class="hl-7">// 350</span><br/><br/><span class="hl-4">paginated</span><span class="hl-1">.</span><span class="hl-4">pageCount</span><br/><span class="hl-7">// 4</span><br/><br/><span class="hl-4">paginated</span><span class="hl-1">.</span><span class="hl-4">currentPage</span><br/><span class="hl-7">// 2</span>
|
|
501
560
|
</code><button type="button">Copy</button></pre>
|
|
502
561
|
|
|
562
|
+
<p>Under a similarity condition (<code>ops.similarity</code>, <code>ops.wordSimilarity</code>,
|
|
563
|
+
<code>ops.strictWordSimilarity</code>), pages come best match first: records are
|
|
564
|
+
ordered by relevance ahead of the Query's <code>order</code> (or, without one, the
|
|
565
|
+
descending primary key). For best-match-first pages, use <code>paginate</code>
|
|
566
|
+
rather than <a href="#cursorpaginate" class="tsd-kind-method">Query.cursorPaginate</a>, which does not order by
|
|
567
|
+
relevance.</p>
|
|
503
568
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="paginateq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></span></li><li><span id="paginateincompatible"><span class="tsd-kind-type-parameter">Incompatible</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">boolean</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#paginateq">Q</a></span></li><li><span><span class="tsd-kind-parameter">opts</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#paginateincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">"paginate is incompatible with limit, offset, and leftJoinPreload"</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">PaginatedDreamQueryOptions</span></span><div class="tsd-comment tsd-typography"><p>Pagination options</p>
|
|
504
569
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">PaginatedDreamQueryResult</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><p>results.recordCount - A number representing the total number of records matching your query</p>
|
|
505
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
570
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2449">src/dream/Query.ts:2449</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="passthrough"><span>passthrough</span><a href="#passthrough" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="passthrough-1"><span class="tsd-kind-call-signature">passthrough</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">passthroughOnStatement</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">PassthroughOnClause</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">PassthroughColumnNames</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#passthrough-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sends data through for use as passthrough data
|
|
506
571
|
for the associations that require it.</p>
|
|
507
572
|
<pre><code class="ts"><span class="hl-0">class</span><span class="hl-1"> </span><span class="hl-9">Post</span><span class="hl-1"> {</span><br/><span class="hl-1"> @</span><span class="hl-4">deco</span><span class="hl-1">.</span><span class="hl-5">HasMany</span><span class="hl-1">(</span><span class="hl-6">'LocalizedText'</span><span class="hl-1">)</span><br/><span class="hl-1"> </span><span class="hl-0">public</span><span class="hl-1"> </span><span class="hl-4">localizedTexts</span><span class="hl-1">: </span><span class="hl-9">LocalizedText</span><span class="hl-1">[]</span><br/><br/><span class="hl-1"> @</span><span class="hl-4">deco</span><span class="hl-1">.</span><span class="hl-5">HasOne</span><span class="hl-1">(</span><span class="hl-6">'LocalizedText'</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">and:</span><span class="hl-1"> { </span><span class="hl-4">locale:</span><span class="hl-1"> </span><span class="hl-4">DreamConst</span><span class="hl-1">.</span><span class="hl-4">passthrough</span><span class="hl-1"> },</span><br/><span class="hl-1"> })</span><br/><span class="hl-1"> </span><span class="hl-0">public</span><span class="hl-1"> </span><span class="hl-4">currentLocalizedText</span><span class="hl-1">: </span><span class="hl-9">LocalizedText</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">passthrough</span><span class="hl-1">({ </span><span class="hl-4">locale:</span><span class="hl-1"> </span><span class="hl-6">'es-ES'</span><span class="hl-1"> })</span><br/><span class="hl-1"> .</span><span class="hl-5">preload</span><span class="hl-1">(</span><span class="hl-6">'posts'</span><span class="hl-1">, </span><span class="hl-6">'currentLocalizedText'</span><span class="hl-1">)</span><br/><span class="hl-1"> .</span><span class="hl-5">first</span><span class="hl-1">()</span>
|
|
508
573
|
</code><button type="button">Copy</button></pre>
|
|
509
574
|
|
|
510
575
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">passthroughOnStatement</span>: <span class="tsd-signature-type">PassthroughOnClause</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">PassthroughColumnNames</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>where statement used for associations that require passthrough data</p>
|
|
511
576
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A cloned Query with the passthrough data</p>
|
|
512
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
577
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1480">src/dream/Query.ts:1480</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="pluck"><span>pluck</span><a href="#pluck" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="pluck-1"><span class="tsd-kind-call-signature">pluck</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckdb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckcolumnnames">ColumnNames</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-type">ColumnNamesAccountingForJoinedAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckq">Q</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"queryTypeOpts"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckdb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckreturnvalue">ReturnValue</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">NamespacedOrBaseModelColumnTypes</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckcolumnnames">ColumnNames</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckq">Q</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">0</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">NamespacedOrBaseModelColumnTypes</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckcolumnnames">ColumnNames</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckq">Q</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">this</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckq">Q</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">columnNames</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckcolumnnames">ColumnNames</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckreturnvalue">ReturnValue</a><span class="tsd-signature-symbol">></span><a href="#pluck-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Plucks the provided fields from the given dream class table</p>
|
|
513
578
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">order</span><span class="hl-1">(</span><span class="hl-6">'id'</span><span class="hl-1">).</span><span class="hl-5">pluck</span><span class="hl-1">(</span><span class="hl-6">'id'</span><span class="hl-1">)</span><br/><span class="hl-7">// [1, 2, 3]</span>
|
|
514
579
|
</code><button type="button">Copy</button></pre>
|
|
515
580
|
|
|
@@ -520,40 +585,58 @@ array is returned:</p>
|
|
|
520
585
|
|
|
521
586
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="pluckq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span id="pluckdb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="pluckcolumnnames"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">ColumnNames</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">ColumnNamesAccountingForJoinedAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckq">Q</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"queryTypeOpts"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckdb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span></span></li><li><span id="pluckreturnvalue"><span class="tsd-kind-type-parameter">ReturnValue</span> <span class="tsd-signature-keyword">extends</span> <br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">NamespacedOrBaseModelColumnTypes</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckcolumnnames">ColumnNames</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckq">Q</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">0</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">NamespacedOrBaseModelColumnTypes</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckcolumnnames">ColumnNames</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckq">Q</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckq">Q</a></span></li><li><span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">columnNames</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckcolumnnames">ColumnNames</a></span><div class="tsd-comment tsd-typography"><p>The column or array of columns to pluck</p>
|
|
522
587
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckreturnvalue">ReturnValue</a><span class="tsd-signature-symbol">></span></h4><p>An array of pluck results</p>
|
|
523
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
588
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2222">src/dream/Query.ts:2222</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="pluckeach"><span>pluck<wbr/>Each</span><a href="#pluckeach" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="pluckeach-1"><span class="tsd-kind-call-signature">pluckEach</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachcolumnnames">ColumnNames</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">this</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq">Q</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">PluckEachArgs</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">ValidatedPluckEachColumnNames</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachcolumnnames">ColumnNames</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">ColumnNamesAccountingForJoinedAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq">Q</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"queryTypeOpts"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">NamespacedOrBaseModelColumnTypes</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">ValidatedPluckEachColumnNames</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachcolumnnames">ColumnNames</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">ColumnNamesAccountingForJoinedAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq">Q</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"queryTypeOpts"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq">Q</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#pluckeach-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Plucks the specified column names from the given dream class table
|
|
524
589
|
in batches, passing each found columns into the
|
|
525
590
|
provided callback function</p>
|
|
526
591
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">order</span><span class="hl-1">(</span><span class="hl-6">'id'</span><span class="hl-1">).</span><span class="hl-5">pluckEach</span><span class="hl-1">(</span><span class="hl-6">'id'</span><span class="hl-1">, (</span><span class="hl-4">id</span><span class="hl-1">) </span><span class="hl-0">=></span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-5">log</span><span class="hl-1">(</span><span class="hl-4">id</span><span class="hl-1">)</span><br/><span class="hl-1">})</span><br/><span class="hl-7">// 1</span><br/><span class="hl-7">// 2</span><br/><span class="hl-7">// 3</span>
|
|
527
592
|
</code><button type="button">Copy</button></pre>
|
|
528
593
|
|
|
529
|
-
<p
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
594
|
+
<p><code>pluckEach</code> reads the rows <a href="#findeach" class="tsd-kind-method">Query.findEach</a> visits, in the same
|
|
595
|
+
batches and the same order: ascending primary key, then, for a Query
|
|
596
|
+
that joins a HasOne or HasMany association, the joined rows' primary
|
|
597
|
+
keys, so each row the join returns is plucked once. Like <code>findEach</code>, it
|
|
598
|
+
discards the Query's <code>order</code>, an association's declared <code>order</code> and the
|
|
599
|
+
relevance ranking of a similarity condition, and it reads a Query that
|
|
600
|
+
keeps one record of each group (one that calls <code>distinct</code>, or over an
|
|
601
|
+
association that declares <code>distinct</code>) from the keys of all of its rows,
|
|
602
|
+
read before the first batch.</p>
|
|
603
|
+
<p>A <code>limit</code> or <code>offset</code> on the Query cannot compose with the batches —
|
|
604
|
+
each batch re-applies the Query's conditions, so the limit would be
|
|
605
|
+
silently replaced by the batch size and the offset re-applied to every
|
|
606
|
+
batch — so a limit- or offset-carrying Query throws at runtime.</p>
|
|
533
607
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="pluckeachq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span id="pluckeachcolumnnames"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">ColumnNames</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq">Q</a></span></li><li><span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">PluckEachArgs</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">ValidatedPluckEachColumnNames</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachcolumnnames">ColumnNames</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">ColumnNamesAccountingForJoinedAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq">Q</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"queryTypeOpts"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">NamespacedOrBaseModelColumnTypes</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">ValidatedPluckEachColumnNames</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachcolumnnames">ColumnNames</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">ColumnNamesAccountingForJoinedAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq">Q</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"queryTypeOpts"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq">Q</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>a list of column names to pluck, followed by a callback function to call for each set of found fields</p>
|
|
534
608
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>void</p>
|
|
535
609
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-5">Throws<a href="#throws-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>BatchingIncompatibleWithLimitOrOffset if the query carries a <code>limit</code> or <code>offset</code></p>
|
|
536
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
610
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2273">src/dream/Query.ts:2273</a></li></ul></aside></div></li><li class=""><div class="tsd-signature tsd-anchor-link" id="pluckeach-2"><span class="tsd-kind-call-signature">pluckEach</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq-1">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachcolumnnames-1">ColumnNames</a> <span class="tsd-signature-keyword">extends</span><br/> <span class="tsd-signature-type">ColumnNamesAccountingForJoinedAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq-1">Q</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"queryTypeOpts"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">this</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq-1">Q</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">PluckEachArgs</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachcolumnnames-1">ColumnNames</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">NamespacedOrBaseModelColumnTypes</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachcolumnnames-1">ColumnNames</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq-1">Q</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#pluckeach-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Plucks the specified column names from the given dream class table
|
|
537
611
|
in batches, passing each found columns into the
|
|
538
612
|
provided callback function</p>
|
|
539
613
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">order</span><span class="hl-1">(</span><span class="hl-6">'id'</span><span class="hl-1">).</span><span class="hl-5">pluckEach</span><span class="hl-1">(</span><span class="hl-6">'id'</span><span class="hl-1">, (</span><span class="hl-4">id</span><span class="hl-1">) </span><span class="hl-0">=></span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-5">log</span><span class="hl-1">(</span><span class="hl-4">id</span><span class="hl-1">)</span><br/><span class="hl-1">})</span><br/><span class="hl-7">// 1</span><br/><span class="hl-7">// 2</span><br/><span class="hl-7">// 3</span>
|
|
540
614
|
</code><button type="button">Copy</button></pre>
|
|
541
615
|
|
|
542
|
-
<p
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
616
|
+
<p><code>pluckEach</code> reads the rows <a href="#findeach" class="tsd-kind-method">Query.findEach</a> visits, in the same
|
|
617
|
+
batches and the same order: ascending primary key, then, for a Query
|
|
618
|
+
that joins a HasOne or HasMany association, the joined rows' primary
|
|
619
|
+
keys, so each row the join returns is plucked once. Like <code>findEach</code>, it
|
|
620
|
+
discards the Query's <code>order</code>, an association's declared <code>order</code> and the
|
|
621
|
+
relevance ranking of a similarity condition, and it reads a Query that
|
|
622
|
+
keeps one record of each group (one that calls <code>distinct</code>, or over an
|
|
623
|
+
association that declares <code>distinct</code>) from the keys of all of its rows,
|
|
624
|
+
read before the first batch.</p>
|
|
625
|
+
<p>A <code>limit</code> or <code>offset</code> on the Query cannot compose with the batches —
|
|
626
|
+
each batch re-applies the Query's conditions, so the limit would be
|
|
627
|
+
silently replaced by the batch size and the offset re-applied to every
|
|
628
|
+
batch — so a limit- or offset-carrying Query throws at runtime.</p>
|
|
546
629
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="pluckeachq-1"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span id="pluckeachcolumnnames-1"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">ColumnNames</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">ColumnNamesAccountingForJoinedAssociations</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq-1">Q</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"queryTypeOpts"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq-1">Q</a></span></li><li><span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">PluckEachArgs</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachcolumnnames-1">ColumnNames</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">NamespacedOrBaseModelColumnTypes</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachcolumnnames-1">ColumnNames</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachq-1">Q</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>a list of column names to pluck, followed by a callback function to call for each set of found fields</p>
|
|
547
630
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><p>void</p>
|
|
548
631
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-6">Throws<a href="#throws-6" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>BatchingIncompatibleWithLimitOrOffset if the query carries a <code>limit</code> or <code>offset</code></p>
|
|
549
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
632
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2300">src/dream/Query.ts:2300</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="preload"><span>preload</span><a href="#preload" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="preload-1"><span class="tsd-kind-call-signature">preload</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloaddb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadschema">Schema</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadtablename">TableName</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-keyword">const</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadarr">Arr</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadretquery">RetQuery</a> <span class="tsd-signature-symbol">=</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLimit"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowOffset"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPaginate"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">this</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadq">Q</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">"preload is incompatible with leftJoinPreload"</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">VariadicLoadArgs</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloaddb">DB</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadschema">Schema</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadtablename">TableName</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadarr">Arr</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadretquery">RetQuery</a><a href="#preload-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Load each specified association using a separate SQL query.
|
|
550
633
|
See <a href="#leftjoinpreload" class="tsd-kind-method">Query.leftJoinPreload</a> for preloading in a single query.</p>
|
|
551
|
-
<pre><code class="ts"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">user</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">preload</span><span class="hl-1">(</span><span class="hl-6">'posts'</span><span class="hl-1">, </span><span class="hl-6">'comments'</span><span class="hl-1">, { </span><span class="hl-4">
|
|
634
|
+
<pre><code class="ts"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">user</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">preload</span><span class="hl-1">(</span><span class="hl-6">'posts'</span><span class="hl-1">, </span><span class="hl-6">'comments'</span><span class="hl-1">, { </span><span class="hl-4">and:</span><span class="hl-1"> { </span><span class="hl-4">visibility:</span><span class="hl-1"> </span><span class="hl-6">'public'</span><span class="hl-1"> } }, </span><span class="hl-6">'replies'</span><span class="hl-1">).</span><span class="hl-5">first</span><span class="hl-1">()</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-5">log</span><span class="hl-1">(</span><span class="hl-4">user</span><span class="hl-1">.</span><span class="hl-4">posts</span><span class="hl-1">[</span><span class="hl-8">0</span><span class="hl-1">].</span><span class="hl-4">comments</span><span class="hl-1">[</span><span class="hl-8">0</span><span class="hl-1">].</span><span class="hl-4">replies</span><span class="hl-1">[</span><span class="hl-8">0</span><span class="hl-1">])</span><br/><span class="hl-7">// [Reply{id: 1}, Reply{id: 2}]</span>
|
|
552
635
|
</code><button type="button">Copy</button></pre>
|
|
553
636
|
|
|
554
637
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="preloadq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></span></li><li><span id="preloaddb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="preloadschema"><span class="tsd-kind-type-parameter">Schema</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="preloadtablename"><span class="tsd-kind-type-parameter">TableName</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">string</span></span></li><li><span id="preloadarr"><span class="tsd-signature-keyword">const</span> <span class="tsd-kind-type-parameter">Arr</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">[]</span></span></li><li><span id="preloadincompatible"><span class="tsd-kind-type-parameter">Incompatible</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">boolean</span></span></li><li><span id="preloadretquery"><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLimit"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowOffset"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPaginate"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadq">Q</a></span></li><li><span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">"preload is incompatible with leftJoinPreload"</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">...</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadarr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">VariadicLoadArgs</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloaddb">DB</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadschema">Schema</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadtablename">TableName</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadarr">Arr</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">]</span></span><div class="tsd-comment tsd-typography"><p>A chain of association names and and/andNot/andAny clauses</p>
|
|
555
638
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadretquery">RetQuery</a></h4><p>A cloned Query with the preload statement applied</p>
|
|
556
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
639
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L961">src/dream/Query.ts:961</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="preloadfor"><span>preload<wbr/>For</span><a href="#preloadfor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="preloadfor-1"><span class="tsd-kind-call-signature">preloadFor</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadforq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadforserializerkey">SerializerKey</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadforretquery">RetQuery</a> <span class="tsd-signature-symbol">=</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLimit"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowOffset"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPaginate"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">this</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadforq">Q</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">serializerKey</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadforserializerkey">SerializerKey</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">modifierFn</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">LoadForModifierFn</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadforretquery">RetQuery</a><a href="#preloadfor-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Recursively preloads all Dream associations referenced by <code>rendersOne</code> and <code>rendersMany</code>
|
|
557
640
|
in a DreamSerializer. This traverses the entire content tree of serializers to automatically
|
|
558
641
|
load all necessary associations, eliminating N+1 query problems and removing the need to
|
|
559
642
|
manually remember which associations to preload for serialization.</p>
|
|
@@ -570,7 +653,7 @@ automatically preloads all associations that will be needed during serialization
|
|
|
570
653
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="preloadforq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></span></li><li><span id="preloadforserializerkey"><span class="tsd-kind-type-parameter">SerializerKey</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="preloadforretquery"><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowLimit"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowOffset"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPaginate"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"allowPreload"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableAlias"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadforq">Q</a></span></li><li><span><span class="tsd-kind-parameter">serializerKey</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadforserializerkey">SerializerKey</a></span><div class="tsd-comment tsd-typography"><p>The serializer key to use for determining which associations to preload.</p>
|
|
571
654
|
</div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">modifierFn</span>: <span class="tsd-signature-type">LoadForModifierFn</span></span><div class="tsd-comment tsd-typography"><p>Optional callback function to modify or omit specific associations during preloading. Called for each association with the Dream class and association name. Return an object with <code>and</code>, <code>andAny</code>, or <code>andNot</code> properties to add where conditions, return 'omit' to skip preloading that association (useful when you want to handle it manually), or return undefined to use default preloading</p>
|
|
572
655
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="#preloadforretquery">RetQuery</a></h4><p>A Query with all serialization associations preloaded</p>
|
|
573
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
656
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1037">src/dream/Query.ts:1037</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="reallydestroy"><span>really<wbr/>Destroy</span><a href="#reallydestroy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="reallydestroy-1"><span class="tsd-kind-call-signature">reallyDestroy</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">batchSize</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">cascade</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">lock</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">skipHooks</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#reallydestroy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Destroys all records matching the Query,
|
|
574
657
|
permanently removing each matched record from
|
|
575
658
|
the database instead of soft deleting it.</p>
|
|
576
659
|
<p>The SoftDelete decorator is bypassed when
|
|
@@ -608,47 +691,82 @@ carries through to the cascade.</p>
|
|
|
608
691
|
</div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4><p>The number of records that were removed</p>
|
|
609
692
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-7">Throws<a href="#throws-7" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>InvalidBatchSize if <code>batchSize</code> is not a positive integer</p>
|
|
610
693
|
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-8">Throws<a href="#throws-8" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>BatchingIncompatibleWithLimitOrOffset if the query carries a <code>limit</code> or <code>offset</code></p>
|
|
611
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
694
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L3360">src/dream/Query.ts:3360</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="removealldefaultscopes"><span class="deprecated">remove<wbr/>All<wbr/>Default<wbr/>Scopes</span><a href="#removealldefaultscopes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="removealldefaultscopes-1"><span class="tsd-kind-call-signature">removeAllDefaultScopes</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#removealldefaultscopes-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A new Query which bypasses user-removable default scopes</p>
|
|
612
695
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-deprecated"><h4 class="tsd-anchor-link" id="deprecated">Deprecated<a href="#deprecated" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Use <a href="#removedefaultscope" class="tsd-kind-method">removeDefaultScope</a> instead. This method will become private in v3.</p>
|
|
613
696
|
<p>Prevents user-removable default scopes from applying when the Query is
|
|
614
697
|
executed, including when associations are loaded. An STI child's reserved
|
|
615
698
|
type discriminator remains enforced; query the STI base model to span its
|
|
616
699
|
registered children.</p>
|
|
617
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
700
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1404">src/dream/Query.ts:1404</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected"><h3 class="tsd-anchor-link" id="removealldefaultscopesexceptonassociations"><code class="tsd-tag">Protected</code><span>remove<wbr/>All<wbr/>Default<wbr/>Scopes<wbr/>Except<wbr/>On<wbr/>Associations</span><a href="#removealldefaultscopesexceptonassociations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-protected"><li class=""><div class="tsd-signature tsd-anchor-link" id="removealldefaultscopesexceptonassociations-1"><span class="tsd-kind-call-signature">removeAllDefaultScopesExceptOnAssociations</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><a href="#removealldefaultscopesexceptonassociations-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Prevents default scopes from applying when
|
|
618
701
|
the Query is executed, but not when applying to associations</p>
|
|
619
702
|
</div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A new Query which will prevent default scopes from applying, but not when applying to asociations</p>
|
|
620
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
703
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1417">src/dream/Query.ts:1417</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="removedefaultscope"><span>remove<wbr/>Default<wbr/>Scope</span><a href="#removedefaultscope" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="removedefaultscope-1"><span class="tsd-kind-call-signature">removeDefaultScope</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">scopeName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">AllDefaultScopeNames</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#removedefaultscope-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Prevents a specific default scope from applying when
|
|
621
704
|
the Query is executed</p>
|
|
622
705
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">scopeName</span>: <span class="tsd-signature-type">AllDefaultScopeNames</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A new Query which will prevent a specific default scope from applying</p>
|
|
623
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
706
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1430">src/dream/Query.ts:1430</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected"><h3 class="tsd-anchor-link" id="removedefaultscopeexceptonassociations"><code class="tsd-tag">Protected</code><span>remove<wbr/>Default<wbr/>Scope<wbr/>Except<wbr/>On<wbr/>Associations</span><a href="#removedefaultscopeexceptonassociations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-protected"><li class=""><div class="tsd-signature tsd-anchor-link" id="removedefaultscopeexceptonassociations-1"><span class="tsd-kind-call-signature">removeDefaultScopeExceptOnAssociations</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">scopeName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">DefaultScopeName</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#removedefaultscopeexceptonassociations-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Prevents a specific default scope from applying when
|
|
624
707
|
the Query is executed, but not when applying to asociations</p>
|
|
625
708
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">scopeName</span>: <span class="tsd-signature-type">DefaultScopeName</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A new Query which will prevent a specific default scope from applying, but not when applying to asociations</p>
|
|
626
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
709
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1445">src/dream/Query.ts:1445</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="scrollpaginate"><span class="deprecated">scroll<wbr/>Paginate</span><a href="#scrollpaginate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="scrollpaginate-1"><span class="tsd-kind-call-signature">scrollPaginate</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#scrollpaginateq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#scrollpaginateincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">this</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#scrollpaginateq">Q</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#scrollpaginateincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">"scrollPaginate is incompatible with limit, offset, and leftJoinPreload"</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CursorPaginatedDreamQueryOptions</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">CursorPaginatedDreamQueryResult</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#scrollpaginate-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="scrollpaginateq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span></span></li><li><span id="scrollpaginateincompatible"><span class="tsd-kind-type-parameter">Incompatible</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">boolean</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">this</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#scrollpaginateq">Q</a></span></li><li><span><span class="tsd-kind-parameter">opts</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#scrollpaginateincompatible">Incompatible</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">"scrollPaginate is incompatible with limit, offset, and leftJoinPreload"</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CursorPaginatedDreamQueryOptions</span></span><div class="tsd-comment tsd-typography"><p>scroll pagination options</p>
|
|
627
710
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">CursorPaginatedDreamQueryResult</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><p>results.cursor - identifier for the next page, or null if no more pages</p>
|
|
628
711
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-deprecated"><h4 class="tsd-anchor-link" id="deprecated-1">Deprecated<a href="#deprecated-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Use <a href="#cursorpaginate" class="tsd-kind-method">cursorPaginate</a> instead.</p>
|
|
629
712
|
<p>Paginates the results of your query using cursor-based pagination,
|
|
630
713
|
accepting a pageSize and cursor argument. This method
|
|
631
714
|
provides better performance for large datasets by using cursor-based
|
|
632
715
|
pagination instead of offset-based pagination.</p>
|
|
633
|
-
<p>
|
|
634
|
-
|
|
635
|
-
|
|
716
|
+
<p>Pages follow the Query's <code>order</code>, preceded by the <code>order</code> declared on any
|
|
717
|
+
association the Query is built on or joins (so an <code>associationQuery</code> of
|
|
718
|
+
an ordered association pages in that association's order), with
|
|
719
|
+
ascending primary key as the final tiebreaker; with neither, pages run in
|
|
720
|
+
ascending primary key order. If those orders already include the primary
|
|
721
|
+
key (e.g.: <code>id: 'asc'</code>), the implicit primary key ordering is omitted.</p>
|
|
722
|
+
<p>A Query that joins a HasOne or HasMany association (directly, through an
|
|
723
|
+
association it joins, or as the association an <code>associationQuery</code> goes
|
|
724
|
+
through) returns a record once for each row the join matches, as
|
|
725
|
+
<a href="#all" class="tsd-kind-method">Query.all</a> does, and the pages return each of those rows once,
|
|
726
|
+
sorting the rows of one record by the joined rows' primary keys after the
|
|
727
|
+
primary key. The cursor of such a Query is an opaque string that names
|
|
728
|
+
its last row by primary keys, the record's and the joined rows' (readable
|
|
729
|
+
by whoever holds it; it is not encrypted), and the next page starts after
|
|
730
|
+
that row, or, if the row is gone, after the record's first row. Any other
|
|
731
|
+
Query's cursor is its last record's primary key. A record's primary key
|
|
732
|
+
is always accepted as a cursor: the next page starts after that record's
|
|
733
|
+
first row. A cursor carries no other value its row sorts by: those are
|
|
734
|
+
read from the database when the next page is.</p>
|
|
735
|
+
<p>A Query that calls <code>distinct</code> on its primary key (as <code>distinct()</code> does,
|
|
736
|
+
e.g.: <code>User.innerJoin('posts').distinct()</code>) returns each record once, as
|
|
737
|
+
<a href="#all" class="tsd-kind-method">Query.all</a> does, and so do its pages, whose cursor is the last
|
|
738
|
+
record's primary key. A Query that calls <code>distinct</code> on another column has
|
|
739
|
+
to be ordered by that column first (e.g.:
|
|
740
|
+
<code>Post.distinct('category').order({ category: 'asc', createdAt: 'desc' })</code>),
|
|
741
|
+
or the database rejects its pages. Its pages return the records
|
|
742
|
+
<a href="#all" class="tsd-kind-method">Query.all</a> returns, the one its order keeps for each value of that
|
|
743
|
+
column (the newest post of each category), and its cursor is also the
|
|
744
|
+
last record's primary key. Over an association that declares <code>distinct</code>
|
|
745
|
+
and an <code>order</code> led by its distinct column (an <code>associationQuery</code> of it, or
|
|
746
|
+
a Query that joins it), the pages return the rows <a href="#all" class="tsd-kind-method">Query.all</a>
|
|
747
|
+
returns: the row the association's <code>order</code> keeps for each value of its
|
|
748
|
+
distinct column.</p>
|
|
749
|
+
<p>A similarity condition (<code>ops.similarity</code>, <code>ops.wordSimilarity</code>,
|
|
750
|
+
<code>ops.strictWordSimilarity</code>) still decides which records match, but its
|
|
751
|
+
relevance ranking does not order the pages: a cursor can only resume from
|
|
752
|
+
values it compares, and the rank is not one of them. For best-match-first
|
|
753
|
+
pages, use <a href="#paginate" class="tsd-kind-method">Query.paginate</a>.</p>
|
|
636
754
|
<pre><code class="ts"><span class="hl-7">// First page (using undefined to start from beginning)</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">firstPage</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">order</span><span class="hl-1">(</span><span class="hl-6">'email'</span><span class="hl-1">).</span><span class="hl-5">scrollPaginate</span><span class="hl-1">({ </span><span class="hl-4">pageSize:</span><span class="hl-1"> </span><span class="hl-8">100</span><span class="hl-1">, </span><span class="hl-4">cursor:</span><span class="hl-1"> </span><span class="hl-0">undefined</span><span class="hl-1"> })</span><br/><span class="hl-4">firstPage</span><span class="hl-1">.</span><span class="hl-4">results</span><br/><span class="hl-7">// [ { User{id: 1}, User{id: 2}, ...}]</span><br/><br/><span class="hl-4">firstPage</span><span class="hl-1">.</span><span class="hl-4">cursor</span><br/><span class="hl-7">// "100" (or null if no more pages)</span><br/><br/><span class="hl-7">// Next page using cursor from previous result</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">nextPage</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">order</span><span class="hl-1">(</span><span class="hl-6">'email'</span><span class="hl-1">).</span><span class="hl-5">scrollPaginate</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">pageSize:</span><span class="hl-1"> </span><span class="hl-8">100</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">cursor:</span><span class="hl-1"> </span><span class="hl-4">firstPage</span><span class="hl-1">.</span><span class="hl-4">cursor</span><br/><span class="hl-1">})</span>
|
|
637
755
|
</code><button type="button">Copy</button></pre>
|
|
638
756
|
|
|
639
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
757
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2557">src/dream/Query.ts:2557</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="sql"><span>sql</span><a href="#sql" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="sql-1"><span class="tsd-kind-call-signature">sql</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">CompiledQuery</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span><a href="#sql-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the sql that would be executed by this Query</p>
|
|
640
758
|
<pre><code class="ts"><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">where</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-6">'how@yadoin'</span><span class="hl-1"> }).</span><span class="hl-5">sql</span><span class="hl-1">()</span><br/><span class="hl-7">// {</span><br/><span class="hl-7">// query: {</span><br/><span class="hl-7">// kind: 'SelectQueryNode',</span><br/><span class="hl-7">// from: { kind: 'FromNode', froms: [Array] },</span><br/><span class="hl-7">// selections: [ [Object] ],</span><br/><span class="hl-7">// distinctOn: undefined,</span><br/><span class="hl-7">// joins: undefined,</span><br/><span class="hl-7">// groupBy: undefined,</span><br/><span class="hl-7">// orderBy: undefined,</span><br/><span class="hl-7">// where: { kind: 'WhereNode', where: [Object] },</span><br/><span class="hl-7">// frontModifiers: undefined,</span><br/><span class="hl-7">// endModifiers: undefined,</span><br/><span class="hl-7">// limit: undefined,</span><br/><span class="hl-7">// offset: undefined,</span><br/><span class="hl-7">// with: undefined,</span><br/><span class="hl-7">// having: undefined,</span><br/><span class="hl-7">// explain: undefined,</span><br/><span class="hl-7">// setOperations: undefined</span><br/><span class="hl-7">// },</span><br/><span class="hl-7">// sql: 'select "users".* from "users" where ("users"."email" = $1 and "users"."deleted_at" is null)',</span><br/><span class="hl-7">// parameters: [ 'how@yadoin' ]</span><br/><span class="hl-7">//}</span>
|
|
641
759
|
</code><button type="button">Copy</button></pre>
|
|
642
760
|
|
|
643
761
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">CompiledQuery</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">object</span><span class="tsd-signature-symbol">></span></h4><p>An object representing the underlying sql statement</p>
|
|
644
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
762
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1748">src/dream/Query.ts:1748</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="sum"><span>sum</span><a href="#sum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="sum-1"><span class="tsd-kind-call-signature">sum</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumdb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumcolumnname">ColumnName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumreturntype">ReturnType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">columnName</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumcolumnname">ColumnName</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#sumreturntype">ReturnType</a><span class="tsd-signature-symbol">></span><a href="#sum-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the sum value of the specified column
|
|
645
763
|
for this Query</p>
|
|
646
764
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">Game</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">sum</span><span class="hl-1">(</span><span class="hl-6">'score'</span><span class="hl-1">)</span><br/><span class="hl-7">// 1</span>
|
|
647
765
|
</code><button type="button">Copy</button></pre>
|
|
648
766
|
|
|
649
767
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="sumq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span id="sumdb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="sumcolumnname"><span class="tsd-kind-type-parameter">ColumnName</span></span></li><li><span id="sumreturntype"><span class="tsd-kind-type-parameter">ReturnType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">columnName</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumcolumnname">ColumnName</a></span><div class="tsd-comment tsd-typography"><p>a column name on the model</p>
|
|
650
768
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#sumreturntype">ReturnType</a><span class="tsd-signature-symbol">></span></h4><p>the sum of the values of the specified column for this Query</p>
|
|
651
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
769
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2069">src/dream/Query.ts:2069</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="sumby"><span>sum<wbr/>By</span><a href="#sumby" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="sumby-1"><span class="tsd-kind-call-signature">sumBy</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumbyq">Q</a> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumbydb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumbygroupcolumnname">GroupColumnName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumbyaggregatedcolumnname">AggregatedColumnName</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumbygroupkey">GroupKey</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumbyaggregatedtype">AggregatedType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">groupColumn</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumbygroupcolumnname">GroupColumnName</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">aggregatedColumn</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumbyaggregatedcolumnname">AggregatedColumnName</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#sumbygroupkey">GroupKey</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumbyaggregatedtype">AggregatedType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#sumby-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the sum of the specified column within each group, keyed by
|
|
652
770
|
the value of the provided group column (a SQL <code>GROUP BY</code>).</p>
|
|
653
771
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">CompositionAsset</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">sumBy</span><span class="hl-1">(</span><span class="hl-6">'name'</span><span class="hl-1">, </span><span class="hl-6">'score'</span><span class="hl-1">)</span><br/><span class="hl-7">// Map(2) { 'primary' => 10, 'secondary' => 4 }</span>
|
|
654
772
|
</code><button type="button">Copy</button></pre>
|
|
@@ -664,20 +782,20 @@ are grouped under a real <code>null</code> key; a group whose aggregated values
|
|
|
664
782
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="sumbyq"><span class="tsd-kind-type-parameter">Q</span> <span class="tsd-signature-keyword">extends</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span id="sumbydb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="sumbygroupcolumnname"><span class="tsd-kind-type-parameter">GroupColumnName</span></span></li><li><span id="sumbyaggregatedcolumnname"><span class="tsd-kind-type-parameter">AggregatedColumnName</span></span></li><li><span id="sumbygroupkey"><span class="tsd-kind-type-parameter">GroupKey</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="sumbyaggregatedtype"><span class="tsd-kind-type-parameter">AggregatedType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">groupColumn</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumbygroupcolumnname">GroupColumnName</a></span><div class="tsd-comment tsd-typography"><p>the column to group by (base or joined-association-namespaced)</p>
|
|
665
783
|
</div></li><li><span><span class="tsd-kind-parameter">aggregatedColumn</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumbyaggregatedcolumnname">AggregatedColumnName</a></span><div class="tsd-comment tsd-typography"><p>the column to sum within each group</p>
|
|
666
784
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#sumbygroupkey">GroupKey</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#sumbyaggregatedtype">AggregatedType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4><p>A Map from each present group value to the sum of the aggregated column in that group</p>
|
|
667
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ca5a693d77d580b63e885f3eaf29598becd0a1a8/src/dream/Query.ts#L1885">src/dream/Query.ts:1885</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="tokysely"><span>to<wbr/>Kysely</span><a href="#tokysely" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="tokysely-1"><span class="tsd-kind-call-signature">toKysely</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselyquerytype">QueryType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">"update"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"delete"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"select"</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a> <span class="tsd-signature-symbol">=</span> (<br/> (<br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"length"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">0</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">Key</span> <span class="tsd-signature-keyword">in</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Nullable</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">Extract</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">alias</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type tsd-kind-type-parameter">Key</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">null</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> (<br/> (<br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"length"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">0</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">Key</span> <span class="tsd-signature-keyword">in</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Nullable</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">Extract</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">alias</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type tsd-kind-type-parameter">Key</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><br/> )<span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytablenames">TableNames</a> <span class="tsd-signature-symbol">=</span> (<br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"length"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">0</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span><br/> <span class="tsd-signature-symbol">|</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">|</span> (<br/> (<br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"length"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">0</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><br/> )<br/> <span class="tsd-signature-symbol">|</span> (<br/> (<br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"length"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">0</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"alias"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><br/> )<br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytokyselyreturntype">ToKyselyReturnType</a> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselyquerytype">QueryType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">"select"</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">SelectQueryBuilder</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytablenames">TableNames</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselyquerytype">QueryType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">"delete"</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">DeleteQueryBuilder</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytablenames">TableNames</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselyquerytype">QueryType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">"update"</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">UpdateQueryBuilder</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytablenames">TableNames</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytablenames">TableNames</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">type</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselyquerytype">QueryType</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytokyselyreturntype">ToKyselyReturnType</a><a href="#tokysely-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Converts the given dream class into a Kysely query, enabling
|
|
785
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2106">src/dream/Query.ts:2106</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="tokysely"><span>to<wbr/>Kysely</span><a href="#tokysely" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="tokysely-1"><span class="tsd-kind-call-signature">toKysely</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselyquerytype">QueryType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">"update"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"delete"</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"select"</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a> <span class="tsd-signature-symbol">=</span> (<br/> (<br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"length"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">0</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">Key</span> <span class="tsd-signature-keyword">in</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Nullable</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">Extract</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">alias</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type tsd-kind-type-parameter">Key</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">null</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> (<br/> (<br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"length"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">0</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">Key</span> <span class="tsd-signature-keyword">in</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Nullable</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">Extract</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">alias</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type tsd-kind-type-parameter">Key</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><br/> )<span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytablenames">TableNames</a> <span class="tsd-signature-symbol">=</span> (<br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"length"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">0</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span><br/> <span class="tsd-signature-symbol">|</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">|</span> (<br/> (<br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"length"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">0</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><br/> )<br/> <span class="tsd-signature-symbol">|</span> (<br/> (<br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"length"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">0</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"alias"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><br/> )<br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytokyselyreturntype">ToKyselyReturnType</a> <span class="tsd-signature-symbol">=</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselyquerytype">QueryType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">"select"</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">SelectQueryBuilder</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytablenames">TableNames</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselyquerytype">QueryType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">"delete"</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">DeleteQueryBuilder</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytablenames">TableNames</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselyquerytype">QueryType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">"update"</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">UpdateQueryBuilder</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytablenames">TableNames</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytablenames">TableNames</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">type</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselyquerytype">QueryType</a><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytokyselyreturntype">ToKyselyReturnType</a><a href="#tokysely-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Converts the given dream class into a Kysely query, enabling
|
|
668
786
|
you to build custom queries using the Kysely API</p>
|
|
669
787
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">toKysely</span><span class="hl-1">(</span><span class="hl-6">'select'</span><span class="hl-1">).</span><span class="hl-5">where</span><span class="hl-1">(</span><span class="hl-6">'email'</span><span class="hl-1">, </span><span class="hl-6">'='</span><span class="hl-1">, </span><span class="hl-6">'how@yadoin'</span><span class="hl-1">).</span><span class="hl-5">execute</span><span class="hl-1">()</span>
|
|
670
788
|
</code><button type="button">Copy</button></pre>
|
|
671
789
|
|
|
672
790
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="tokyselyquerytype"><span class="tsd-kind-type-parameter">QueryType</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">"update"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"delete"</span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">"select"</span></span></li><li><span id="tokyselydbtype"><span class="tsd-kind-type-parameter">DbType</span> = (<br/> (<a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"length"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">0</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span>) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">Key</span> <span class="tsd-signature-keyword">in</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Nullable</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">Extract</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">alias</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type tsd-kind-type-parameter">Key</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><br/>) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">null</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> (<br/> (<br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"length"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">0</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">Key</span> <span class="tsd-signature-keyword">in</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Nullable</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">Extract</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">alias</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type tsd-kind-type-parameter">Key</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">}</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><br/> )</span></li><li><span id="tokyselytablenames"><span class="tsd-kind-type-parameter">TableNames</span> = (<a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"length"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">0</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span>) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span><br/> <span class="tsd-signature-symbol">|</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">|</span> (<br/> (<br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"length"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">0</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><br/> )<br/> <span class="tsd-signature-symbol">|</span> (<br/> (<br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"length"</span><span class="tsd-signature-symbol">]</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">0</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">true</span><br/> <span class="tsd-signature-symbol">?</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"alias"</span><span class="tsd-signature-symbol">]</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</span><br/> )<br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"table"</span><span class="tsd-signature-symbol">]</span></span></li><li><span id="tokyselytokyselyreturntype"><span class="tsd-kind-type-parameter">ToKyselyReturnType</span> = <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselyquerytype">QueryType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">"select"</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">SelectQueryBuilder</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytablenames">TableNames</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselyquerytype">QueryType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">"delete"</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">DeleteQueryBuilder</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytablenames">TableNames</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselyquerytype">QueryType</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">"update"</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">UpdateQueryBuilder</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytablenames">TableNames</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytablenames">TableNames</a> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-keyword">keyof</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselydbtype">DbType</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">never</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">type</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselyquerytype">QueryType</a></span><div class="tsd-comment tsd-typography"><p>the type of Kysely query builder instance you would like to obtain</p>
|
|
673
791
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="#tokyselytokyselyreturntype">ToKyselyReturnType</a></h4><p>A Kysely query. Depending on the type passed, it will return either a SelectQueryBuilder, DeleteQueryBuilder, or an UpdateQueryBuilder</p>
|
|
674
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
792
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1763">src/dream/Query.ts:1763</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="txn"><span>txn</span><a href="#txn" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="txn-1"><span class="tsd-kind-call-signature">txn</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">dreamTransaction</span><span class="tsd-signature-symbol">:</span> <a href="index.DreamTransaction.html" class="tsd-signature-type tsd-kind-class">DreamTransaction</a><span class="tsd-signature-symbol"><</span><a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#txn-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Applies transaction to the Query instance</p>
|
|
675
793
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">ApplicationModel</span><span class="hl-1">.</span><span class="hl-5">transaction</span><span class="hl-1">(</span><span class="hl-0">async</span><span class="hl-1"> </span><span class="hl-4">txn</span><span class="hl-1"> </span><span class="hl-0">=></span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">txn</span><span class="hl-1">(</span><span class="hl-4">txn</span><span class="hl-1">).</span><span class="hl-5">create</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-6">'how@yadoin'</span><span class="hl-1"> })</span><br/><span class="hl-1">})</span>
|
|
676
794
|
</code><button type="button">Copy</button></pre>
|
|
677
795
|
|
|
678
796
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">dreamTransaction</span>: <a href="index.DreamTransaction.html" class="tsd-signature-type tsd-kind-class">DreamTransaction</a><span class="tsd-signature-symbol"><</span><a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></span><div class="tsd-comment tsd-typography"><p>A DreamTransaction instance (usually collected by calling <code>ApplicationModel.transaction</code>)</p>
|
|
679
797
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A cloned Query with the transaction applied</p>
|
|
680
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
798
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1801">src/dream/Query.ts:1801</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="undestroy"><span>undestroy</span><a href="#undestroy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="undestroy-1"><span class="tsd-kind-call-signature">undestroy</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">cascade</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">skipHooks</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#undestroy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Undestroys a SoftDelete model, unsetting
|
|
681
799
|
the <code>deletedAt</code> field in the database.</p>
|
|
682
800
|
<p>If the model is not a SoftDelete model,
|
|
683
801
|
this will raise an exception.</p>
|
|
@@ -697,7 +815,7 @@ carries through to the cascade. The SoftDelete scope is always bypassed.</p>
|
|
|
697
815
|
</div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">skipHooks</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>If true, skips applying model hooks during the undestroy operation. Defaults to false</p>
|
|
698
816
|
</div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4><p>The number of records that were removed</p>
|
|
699
817
|
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-9">Throws<a href="#throws-9" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>BatchingIncompatibleWithLimitOrOffset if the query carries a <code>limit</code> or <code>offset</code></p>
|
|
700
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ca5a693d77d580b63e885f3eaf29598becd0a1a8/src/dream/Query.ts#L3045">src/dream/Query.ts:3045</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="update"><span>update</span><a href="#update" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="update-1"><span class="tsd-kind-call-signature">update</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">cb</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">record</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">DrainOuterGeneric</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">K</span> <span class="tsd-signature-keyword">in</span> <span class="tsd-signature-type">string</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">UpdateType</span><span class="tsd-signature-symbol"><</span>(...)<span class="tsd-signature-symbol">[</span>(...)<span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span>(...)<span class="tsd-signature-symbol">[</span>(...)<span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type tsd-kind-type-parameter">K</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">&</span> (<br/> <a href="../types/types.DreamVirtualColumns.html" class="tsd-signature-type tsd-kind-type-alias">DreamVirtualColumns</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"schema"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><a href="../types/types.DreamVirtualColumns.html" class="tsd-signature-type tsd-kind-type-alias">DreamVirtualColumns</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><br/> ) <span class="tsd-signature-symbol">&</span> (<br/> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">UnionToIntersection</span><span class="tsd-signature-symbol"><</span><br/> (((...)<span class="tsd-signature-symbol">[</span>(...)<span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span>) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">never</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span>) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> (<br/> ((...) <span class="tsd-signature-keyword">extends</span> (...) <span class="tsd-signature-symbol">?</span> (...) <span class="tsd-signature-symbol">:</span> (...)) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> (...) <span class="tsd-signature-symbol">&</span> (...)<br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">K</span> <span class="tsd-signature-keyword">in</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">:</span> (...) <span class="tsd-signature-symbol">|</span> (...) <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">object</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">UnionToIntersection</span><span class="tsd-signature-symbol"><</span><br/> (((...)<span class="tsd-signature-symbol">[</span>(...)<span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span>) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">never</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span>) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> (<br/> ((...) <span class="tsd-signature-keyword">extends</span> (...) <span class="tsd-signature-symbol">?</span> (...) <span class="tsd-signature-symbol">:</span> (...)) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> (...) <span class="tsd-signature-symbol">&</span> (...)<br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">K</span> <span class="tsd-signature-keyword">in</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">:</span> (...) <span class="tsd-signature-symbol">|</span> (...) <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> )<span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">DrainOuterGeneric</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">K</span> <span class="tsd-signature-keyword">in</span> <span class="tsd-signature-type">string</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">UpdateType</span><span class="tsd-signature-symbol"><</span>(...)<span class="tsd-signature-symbol">[</span>(...)<span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">&</span> (<br/> <a href="../types/types.DreamVirtualColumns.html" class="tsd-signature-type tsd-kind-type-alias">DreamVirtualColumns</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"schema"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><a href="../types/types.DreamVirtualColumns.html" class="tsd-signature-type tsd-kind-type-alias">DreamVirtualColumns</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><br/> ) <span class="tsd-signature-symbol">&</span> (<br/> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">UnionToIntersection</span><span class="tsd-signature-symbol"><</span><br/> ((...) <span class="tsd-signature-keyword">extends</span> (...) <span class="tsd-signature-symbol">?</span> (...) <span class="tsd-signature-symbol">:</span> (...)) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> (...) <span class="tsd-signature-keyword">extends</span> (...) <span class="tsd-signature-symbol">?</span> (...) <span class="tsd-signature-symbol">:</span> (...)<span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">object</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">UnionToIntersection</span><span class="tsd-signature-symbol"><</span><br/> ((...) <span class="tsd-signature-keyword">extends</span> (...) <span class="tsd-signature-symbol">?</span> (...) <span class="tsd-signature-symbol">:</span> (...)) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> (...) <span class="tsd-signature-keyword">extends</span> (...) <span class="tsd-signature-symbol">?</span> (...) <span class="tsd-signature-symbol">:</span> (...)<span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> )<span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">batchSize</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">lock</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">skipHooks</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#update-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Updates all records matching the Query</p>
|
|
818
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L3397">src/dream/Query.ts:3397</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="update"><span>update</span><a href="#update" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="update-1"><span class="tsd-kind-call-signature">update</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">cb</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">record</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">)</span> <span class="tsd-signature-symbol">=></span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">DrainOuterGeneric</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">K</span> <span class="tsd-signature-keyword">in</span> <span class="tsd-signature-type">string</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">UpdateType</span><span class="tsd-signature-symbol"><</span>(...)<span class="tsd-signature-symbol">[</span>(...)<span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span>(...)<span class="tsd-signature-symbol">[</span>(...)<span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type tsd-kind-type-parameter">K</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">&</span> (<br/> <a href="../types/types.DreamVirtualColumns.html" class="tsd-signature-type tsd-kind-type-alias">DreamVirtualColumns</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"schema"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><a href="../types/types.DreamVirtualColumns.html" class="tsd-signature-type tsd-kind-type-alias">DreamVirtualColumns</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><br/> ) <span class="tsd-signature-symbol">&</span> (<br/> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">UnionToIntersection</span><span class="tsd-signature-symbol"><</span><br/> (((...)<span class="tsd-signature-symbol">[</span>(...)<span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span>) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">never</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span>) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> (<br/> ((...) <span class="tsd-signature-keyword">extends</span> (...) <span class="tsd-signature-symbol">?</span> (...) <span class="tsd-signature-symbol">:</span> (...)) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> (...) <span class="tsd-signature-symbol">&</span> (...)<br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">K</span> <span class="tsd-signature-keyword">in</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">:</span> (...) <span class="tsd-signature-symbol">|</span> (...) <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">object</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">UnionToIntersection</span><span class="tsd-signature-symbol"><</span><br/> (((...)<span class="tsd-signature-symbol">[</span>(...)<span class="tsd-signature-symbol">]</span> <span class="tsd-signature-symbol">&</span> <span class="tsd-signature-type">string</span>) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">never</span> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">false</span> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span>) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> (<br/> ((...) <span class="tsd-signature-keyword">extends</span> (...) <span class="tsd-signature-symbol">?</span> (...) <span class="tsd-signature-symbol">:</span> (...)) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> (...) <span class="tsd-signature-symbol">&</span> (...)<br/> ) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">K</span> <span class="tsd-signature-keyword">in</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">:</span> (...) <span class="tsd-signature-symbol">|</span> (...) <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> )<span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">DrainOuterGeneric</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-symbol">{</span> <span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">K</span> <span class="tsd-signature-keyword">in</span> <span class="tsd-signature-type">string</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">number</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">UpdateType</span><span class="tsd-signature-symbol"><</span>(...)<span class="tsd-signature-symbol">[</span>(...)<span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">&</span> (<br/> <a href="../types/types.DreamVirtualColumns.html" class="tsd-signature-type tsd-kind-type-alias">DreamVirtualColumns</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"schema"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-keyword">readonly</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol"><</span><a href="../types/types.DreamVirtualColumns.html" class="tsd-signature-type tsd-kind-type-alias">DreamVirtualColumns</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span><br/> ) <span class="tsd-signature-symbol">&</span> (<br/> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">UnionToIntersection</span><span class="tsd-signature-symbol"><</span><br/> ((...) <span class="tsd-signature-keyword">extends</span> (...) <span class="tsd-signature-symbol">?</span> (...) <span class="tsd-signature-symbol">:</span> (...)) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> (...) <span class="tsd-signature-keyword">extends</span> (...) <span class="tsd-signature-symbol">?</span> (...) <span class="tsd-signature-symbol">:</span> (...)<span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">object</span><br/> <span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><br/> <span class="tsd-signature-type">UnionToIntersection</span><span class="tsd-signature-symbol"><</span><br/> ((...) <span class="tsd-signature-keyword">extends</span> (...) <span class="tsd-signature-symbol">?</span> (...) <span class="tsd-signature-symbol">:</span> (...)) <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">false</span><br/> <span class="tsd-signature-symbol">?</span> <span class="tsd-signature-type">never</span><br/> <span class="tsd-signature-symbol">:</span> (...) <span class="tsd-signature-keyword">extends</span> (...) <span class="tsd-signature-symbol">?</span> (...) <span class="tsd-signature-symbol">:</span> (...)<span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> )<span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">batchSize</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">lock</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">skipHooks</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#update-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Updates all records matching the Query</p>
|
|
701
819
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">where</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-4">ops</span><span class="hl-1">.</span><span class="hl-5">ilike</span><span class="hl-1">(</span><span class="hl-6">'%burpcollaborator%'</span><span class="hl-1">) }).</span><span class="hl-5">update</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-0">null</span><span class="hl-1"> })</span><br/><span class="hl-7">// 12</span>
|
|
702
820
|
</code><button type="button">Copy</button></pre>
|
|
703
821
|
|
|
@@ -812,12 +930,32 @@ the run hangs indefinitely and pins both connections. Reads through the
|
|
|
812
930
|
record (<code>reload</code>, <code>associationQuery</code>, ...) likewise run on a separate
|
|
813
931
|
connection and snapshot. Derive the attributes and return them; Dream
|
|
814
932
|
performs the write inside the batch's transaction.</li>
|
|
815
|
-
<li><strong
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
933
|
+
<li><strong>Without <code>lock: true</code>, a record is not re-checked before it is
|
|
934
|
+
written.</strong> The unlocked per-record paths — an attributes object without
|
|
935
|
+
<code>lock: true</code> or <code>skipHooks: true</code>, and a callback under <code>lock: false</code> —
|
|
936
|
+
read a batch, then write each record by its primary key alone, with no
|
|
937
|
+
compare-and-set. What a concurrent delete between that read and a
|
|
938
|
+
record's write does depends on what the delete leaves behind. A soft
|
|
939
|
+
delete (<code>destroy()</code> on a <code>@SoftDelete</code> model, which generated models are
|
|
940
|
+
by default) leaves the row in place, so the write lands on the
|
|
941
|
+
soft-deleted record: its update hooks run, it is counted, and its
|
|
942
|
+
<code>deletedAt</code> stays set. A hard delete (<code>reallyDestroy()</code>, a Query's
|
|
943
|
+
<code>delete()</code>, or <code>destroy()</code> on a model without <code>@SoftDelete</code>) removes the
|
|
944
|
+
row, so that record's write throws <code>CannotSaveMissingDream</code> — after its
|
|
945
|
+
<code>beforeUpdate</code> and <code>beforeSave</code> hooks have run — and the run rejects
|
|
946
|
+
without returning a count. Every record written before it, in its own
|
|
947
|
+
batch as well as earlier ones, stays committed, unless the Query carries
|
|
948
|
+
<code>.txn(txn)</code>, which puts those writes in the caller's transaction. (A
|
|
949
|
+
record whose write turns out to be a no-op emits no SQL, so it does not
|
|
950
|
+
throw even if its row is gone, and it is counted.) The single-statement
|
|
951
|
+
<code>skipHooks</code> attributes form is one <code>UPDATE ... WHERE</code> that carries the
|
|
952
|
+
Query's default scopes, so it never writes a soft-deleted record and
|
|
953
|
+
cannot fail part-way through. Use <code>lock: true</code> when deleters may race
|
|
954
|
+
the update: its locked re-read re-applies the Query's conditions and
|
|
955
|
+
default scopes, so a soft- or hard-deleted record drops out of the run,
|
|
956
|
+
neither written nor counted. (A Query that removes the
|
|
957
|
+
<code>dream:SoftDelete</code> default scope reads and writes soft-deleted records
|
|
958
|
+
on every path.)</li>
|
|
821
959
|
<li><strong>A <code>limit</code> or <code>offset</code> on the Query is incompatible with <code>update</code> on
|
|
822
960
|
every path.</strong> The batched paths re-apply the Query's conditions to each
|
|
823
961
|
batch window, where a limit or offset would skip or truncate rows
|
|
@@ -864,7 +1002,8 @@ are the right tools for bulk updates.</li>
|
|
|
864
1002
|
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-11">Throws<a href="#throws-11" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>MissingRequiredLockOptionForUpdateCallback if a callback is passed without an options object carrying a boolean <code>lock</code></p>
|
|
865
1003
|
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-12">Throws<a href="#throws-12" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>BatchingIncompatibleWithLimitOrOffset if the query carries a <code>limit</code> or <code>offset</code></p>
|
|
866
1004
|
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-13">Throws<a href="#throws-13" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>CannotSetEncryptedColumnInQueryUpdate if the single-statement <code>skipHooks</code> form's attributes name an <code>@Encrypted</code> backing column with anything other than <code>null</code></p>
|
|
867
|
-
</div
|
|
1005
|
+
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-14">Throws<a href="#throws-14" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>CannotSaveMissingDream if, on an unlocked per-record path, a record's row is hard-deleted between its batch's read and a write that is not a no-op</p>
|
|
1006
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L3660">src/dream/Query.ts:3660</a></li></ul></aside></div></li><li class=""><div class="tsd-signature tsd-anchor-link" id="update-2"><span class="tsd-kind-call-signature">update</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">attributes</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.UpdateableProperties.html" class="tsd-signature-type tsd-kind-type-alias">UpdateableProperties</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">batchSize</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">lock</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">skipHooks</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#update-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Updates all records matching the Query</p>
|
|
868
1007
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">where</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-4">ops</span><span class="hl-1">.</span><span class="hl-5">ilike</span><span class="hl-1">(</span><span class="hl-6">'%burpcollaborator%'</span><span class="hl-1">) }).</span><span class="hl-5">update</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-0">null</span><span class="hl-1"> })</span><br/><span class="hl-7">// 12</span>
|
|
869
1008
|
</code><button type="button">Copy</button></pre>
|
|
870
1009
|
|
|
@@ -979,12 +1118,32 @@ the run hangs indefinitely and pins both connections. Reads through the
|
|
|
979
1118
|
record (<code>reload</code>, <code>associationQuery</code>, ...) likewise run on a separate
|
|
980
1119
|
connection and snapshot. Derive the attributes and return them; Dream
|
|
981
1120
|
performs the write inside the batch's transaction.</li>
|
|
982
|
-
<li><strong
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1121
|
+
<li><strong>Without <code>lock: true</code>, a record is not re-checked before it is
|
|
1122
|
+
written.</strong> The unlocked per-record paths — an attributes object without
|
|
1123
|
+
<code>lock: true</code> or <code>skipHooks: true</code>, and a callback under <code>lock: false</code> —
|
|
1124
|
+
read a batch, then write each record by its primary key alone, with no
|
|
1125
|
+
compare-and-set. What a concurrent delete between that read and a
|
|
1126
|
+
record's write does depends on what the delete leaves behind. A soft
|
|
1127
|
+
delete (<code>destroy()</code> on a <code>@SoftDelete</code> model, which generated models are
|
|
1128
|
+
by default) leaves the row in place, so the write lands on the
|
|
1129
|
+
soft-deleted record: its update hooks run, it is counted, and its
|
|
1130
|
+
<code>deletedAt</code> stays set. A hard delete (<code>reallyDestroy()</code>, a Query's
|
|
1131
|
+
<code>delete()</code>, or <code>destroy()</code> on a model without <code>@SoftDelete</code>) removes the
|
|
1132
|
+
row, so that record's write throws <code>CannotSaveMissingDream</code> — after its
|
|
1133
|
+
<code>beforeUpdate</code> and <code>beforeSave</code> hooks have run — and the run rejects
|
|
1134
|
+
without returning a count. Every record written before it, in its own
|
|
1135
|
+
batch as well as earlier ones, stays committed, unless the Query carries
|
|
1136
|
+
<code>.txn(txn)</code>, which puts those writes in the caller's transaction. (A
|
|
1137
|
+
record whose write turns out to be a no-op emits no SQL, so it does not
|
|
1138
|
+
throw even if its row is gone, and it is counted.) The single-statement
|
|
1139
|
+
<code>skipHooks</code> attributes form is one <code>UPDATE ... WHERE</code> that carries the
|
|
1140
|
+
Query's default scopes, so it never writes a soft-deleted record and
|
|
1141
|
+
cannot fail part-way through. Use <code>lock: true</code> when deleters may race
|
|
1142
|
+
the update: its locked re-read re-applies the Query's conditions and
|
|
1143
|
+
default scopes, so a soft- or hard-deleted record drops out of the run,
|
|
1144
|
+
neither written nor counted. (A Query that removes the
|
|
1145
|
+
<code>dream:SoftDelete</code> default scope reads and writes soft-deleted records
|
|
1146
|
+
on every path.)</li>
|
|
988
1147
|
<li><strong>A <code>limit</code> or <code>offset</code> on the Query is incompatible with <code>update</code> on
|
|
989
1148
|
every path.</strong> The batched paths re-apply the Query's conditions to each
|
|
990
1149
|
batch window, where a limit or offset would skip or truncate rows
|
|
@@ -1027,11 +1186,12 @@ are the right tools for bulk updates.</li>
|
|
|
1027
1186
|
</div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">lock</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">true</span></h5><div class="tsd-comment tsd-typography"><p>If true, each batch is re-selected with an exclusive row lock inside its own transaction before being updated, making the update a compare-and-set. Defaults to false for the attributes form; with a callback there is no default — an explicit boolean is required. One typing asymmetry to know: with an attributes object, an explicit <code>lock: false</code> keeps the raw single-statement (<code>DreamTableSchema</code>) typing that <code>skipHooks</code> uses, so virtual/encrypted attributes type-check only when the options object is omitted entirely or <code>lock</code> is <code>true</code></p>
|
|
1028
1187
|
</div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">skipHooks</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>If true, skips applying model hooks. Defaults to false</p>
|
|
1029
1188
|
</div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4><p>The number of records that were updated</p>
|
|
1030
|
-
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-
|
|
1031
|
-
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-
|
|
1032
|
-
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-
|
|
1033
|
-
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-
|
|
1034
|
-
</div
|
|
1189
|
+
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-15">Throws<a href="#throws-15" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>InvalidBatchSize if <code>batchSize</code> is not a positive integer</p>
|
|
1190
|
+
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-16">Throws<a href="#throws-16" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>MissingRequiredLockOptionForUpdateCallback if a callback is passed without an options object carrying a boolean <code>lock</code></p>
|
|
1191
|
+
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-17">Throws<a href="#throws-17" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>BatchingIncompatibleWithLimitOrOffset if the query carries a <code>limit</code> or <code>offset</code></p>
|
|
1192
|
+
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-18">Throws<a href="#throws-18" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>CannotSetEncryptedColumnInQueryUpdate if the single-statement <code>skipHooks</code> form's attributes name an <code>@Encrypted</code> backing column with anything other than <code>null</code></p>
|
|
1193
|
+
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-19">Throws<a href="#throws-19" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>CannotSaveMissingDream if, on an unlocked per-record path, a record's row is hard-deleted between its batch's read and a write that is not a no-op</p>
|
|
1194
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L3669">src/dream/Query.ts:3669</a></li></ul></aside></div></li><li class=""><div class="tsd-signature tsd-anchor-link" id="update-3"><span class="tsd-kind-call-signature">update</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">attributes</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">DreamTableSchema</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">lock</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">skipHooks</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#update-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Updates all records matching the Query</p>
|
|
1035
1195
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">where</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-4">ops</span><span class="hl-1">.</span><span class="hl-5">ilike</span><span class="hl-1">(</span><span class="hl-6">'%burpcollaborator%'</span><span class="hl-1">) }).</span><span class="hl-5">update</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-0">null</span><span class="hl-1"> })</span><br/><span class="hl-7">// 12</span>
|
|
1036
1196
|
</code><button type="button">Copy</button></pre>
|
|
1037
1197
|
|
|
@@ -1146,12 +1306,32 @@ the run hangs indefinitely and pins both connections. Reads through the
|
|
|
1146
1306
|
record (<code>reload</code>, <code>associationQuery</code>, ...) likewise run on a separate
|
|
1147
1307
|
connection and snapshot. Derive the attributes and return them; Dream
|
|
1148
1308
|
performs the write inside the batch's transaction.</li>
|
|
1149
|
-
<li><strong
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1309
|
+
<li><strong>Without <code>lock: true</code>, a record is not re-checked before it is
|
|
1310
|
+
written.</strong> The unlocked per-record paths — an attributes object without
|
|
1311
|
+
<code>lock: true</code> or <code>skipHooks: true</code>, and a callback under <code>lock: false</code> —
|
|
1312
|
+
read a batch, then write each record by its primary key alone, with no
|
|
1313
|
+
compare-and-set. What a concurrent delete between that read and a
|
|
1314
|
+
record's write does depends on what the delete leaves behind. A soft
|
|
1315
|
+
delete (<code>destroy()</code> on a <code>@SoftDelete</code> model, which generated models are
|
|
1316
|
+
by default) leaves the row in place, so the write lands on the
|
|
1317
|
+
soft-deleted record: its update hooks run, it is counted, and its
|
|
1318
|
+
<code>deletedAt</code> stays set. A hard delete (<code>reallyDestroy()</code>, a Query's
|
|
1319
|
+
<code>delete()</code>, or <code>destroy()</code> on a model without <code>@SoftDelete</code>) removes the
|
|
1320
|
+
row, so that record's write throws <code>CannotSaveMissingDream</code> — after its
|
|
1321
|
+
<code>beforeUpdate</code> and <code>beforeSave</code> hooks have run — and the run rejects
|
|
1322
|
+
without returning a count. Every record written before it, in its own
|
|
1323
|
+
batch as well as earlier ones, stays committed, unless the Query carries
|
|
1324
|
+
<code>.txn(txn)</code>, which puts those writes in the caller's transaction. (A
|
|
1325
|
+
record whose write turns out to be a no-op emits no SQL, so it does not
|
|
1326
|
+
throw even if its row is gone, and it is counted.) The single-statement
|
|
1327
|
+
<code>skipHooks</code> attributes form is one <code>UPDATE ... WHERE</code> that carries the
|
|
1328
|
+
Query's default scopes, so it never writes a soft-deleted record and
|
|
1329
|
+
cannot fail part-way through. Use <code>lock: true</code> when deleters may race
|
|
1330
|
+
the update: its locked re-read re-applies the Query's conditions and
|
|
1331
|
+
default scopes, so a soft- or hard-deleted record drops out of the run,
|
|
1332
|
+
neither written nor counted. (A Query that removes the
|
|
1333
|
+
<code>dream:SoftDelete</code> default scope reads and writes soft-deleted records
|
|
1334
|
+
on every path.)</li>
|
|
1155
1335
|
<li><strong>A <code>limit</code> or <code>offset</code> on the Query is incompatible with <code>update</code> on
|
|
1156
1336
|
every path.</strong> The batched paths re-apply the Query's conditions to each
|
|
1157
1337
|
batch window, where a limit or offset would skip or truncate rows
|
|
@@ -1193,11 +1373,12 @@ are the right tools for bulk updates.</li>
|
|
|
1193
1373
|
</div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">lock</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">false</span></h5><div class="tsd-comment tsd-typography"><p>If true, each batch is re-selected with an exclusive row lock inside its own transaction before being updated, making the update a compare-and-set. Defaults to false for the attributes form; with a callback there is no default — an explicit boolean is required. One typing asymmetry to know: with an attributes object, an explicit <code>lock: false</code> keeps the raw single-statement (<code>DreamTableSchema</code>) typing that <code>skipHooks</code> uses, so virtual/encrypted attributes type-check only when the options object is omitted entirely or <code>lock</code> is <code>true</code></p>
|
|
1194
1374
|
</div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">skipHooks</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>If true, skips applying model hooks. Defaults to false</p>
|
|
1195
1375
|
</div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4><p>The number of records that were updated</p>
|
|
1196
|
-
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-
|
|
1197
|
-
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-
|
|
1198
|
-
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-
|
|
1199
|
-
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-
|
|
1200
|
-
</div
|
|
1376
|
+
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-20">Throws<a href="#throws-20" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>InvalidBatchSize if <code>batchSize</code> is not a positive integer</p>
|
|
1377
|
+
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-21">Throws<a href="#throws-21" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>MissingRequiredLockOptionForUpdateCallback if a callback is passed without an options object carrying a boolean <code>lock</code></p>
|
|
1378
|
+
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-22">Throws<a href="#throws-22" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>BatchingIncompatibleWithLimitOrOffset if the query carries a <code>limit</code> or <code>offset</code></p>
|
|
1379
|
+
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-23">Throws<a href="#throws-23" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>CannotSetEncryptedColumnInQueryUpdate if the single-statement <code>skipHooks</code> form's attributes name an <code>@Encrypted</code> backing column with anything other than <code>null</code></p>
|
|
1380
|
+
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-24">Throws<a href="#throws-24" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>CannotSaveMissingDream if, on an unlocked per-record path, a record's row is hard-deleted between its batch's read and a write that is not a no-op</p>
|
|
1381
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L3673">src/dream/Query.ts:3673</a></li></ul></aside></div></li><li class=""><div class="tsd-signature tsd-anchor-link" id="update-4"><span class="tsd-kind-call-signature">update</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">attributes</span><span class="tsd-signature-symbol">:</span> <a href="../types/types.UpdateableProperties.html" class="tsd-signature-type tsd-kind-type-alias">UpdateableProperties</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#update-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Updates all records matching the Query</p>
|
|
1201
1382
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">where</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-4">ops</span><span class="hl-1">.</span><span class="hl-5">ilike</span><span class="hl-1">(</span><span class="hl-6">'%burpcollaborator%'</span><span class="hl-1">) }).</span><span class="hl-5">update</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-0">null</span><span class="hl-1"> })</span><br/><span class="hl-7">// 12</span>
|
|
1202
1383
|
</code><button type="button">Copy</button></pre>
|
|
1203
1384
|
|
|
@@ -1312,12 +1493,32 @@ the run hangs indefinitely and pins both connections. Reads through the
|
|
|
1312
1493
|
record (<code>reload</code>, <code>associationQuery</code>, ...) likewise run on a separate
|
|
1313
1494
|
connection and snapshot. Derive the attributes and return them; Dream
|
|
1314
1495
|
performs the write inside the batch's transaction.</li>
|
|
1315
|
-
<li><strong
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1496
|
+
<li><strong>Without <code>lock: true</code>, a record is not re-checked before it is
|
|
1497
|
+
written.</strong> The unlocked per-record paths — an attributes object without
|
|
1498
|
+
<code>lock: true</code> or <code>skipHooks: true</code>, and a callback under <code>lock: false</code> —
|
|
1499
|
+
read a batch, then write each record by its primary key alone, with no
|
|
1500
|
+
compare-and-set. What a concurrent delete between that read and a
|
|
1501
|
+
record's write does depends on what the delete leaves behind. A soft
|
|
1502
|
+
delete (<code>destroy()</code> on a <code>@SoftDelete</code> model, which generated models are
|
|
1503
|
+
by default) leaves the row in place, so the write lands on the
|
|
1504
|
+
soft-deleted record: its update hooks run, it is counted, and its
|
|
1505
|
+
<code>deletedAt</code> stays set. A hard delete (<code>reallyDestroy()</code>, a Query's
|
|
1506
|
+
<code>delete()</code>, or <code>destroy()</code> on a model without <code>@SoftDelete</code>) removes the
|
|
1507
|
+
row, so that record's write throws <code>CannotSaveMissingDream</code> — after its
|
|
1508
|
+
<code>beforeUpdate</code> and <code>beforeSave</code> hooks have run — and the run rejects
|
|
1509
|
+
without returning a count. Every record written before it, in its own
|
|
1510
|
+
batch as well as earlier ones, stays committed, unless the Query carries
|
|
1511
|
+
<code>.txn(txn)</code>, which puts those writes in the caller's transaction. (A
|
|
1512
|
+
record whose write turns out to be a no-op emits no SQL, so it does not
|
|
1513
|
+
throw even if its row is gone, and it is counted.) The single-statement
|
|
1514
|
+
<code>skipHooks</code> attributes form is one <code>UPDATE ... WHERE</code> that carries the
|
|
1515
|
+
Query's default scopes, so it never writes a soft-deleted record and
|
|
1516
|
+
cannot fail part-way through. Use <code>lock: true</code> when deleters may race
|
|
1517
|
+
the update: its locked re-read re-applies the Query's conditions and
|
|
1518
|
+
default scopes, so a soft- or hard-deleted record drops out of the run,
|
|
1519
|
+
neither written nor counted. (A Query that removes the
|
|
1520
|
+
<code>dream:SoftDelete</code> default scope reads and writes soft-deleted records
|
|
1521
|
+
on every path.)</li>
|
|
1321
1522
|
<li><strong>A <code>limit</code> or <code>offset</code> on the Query is incompatible with <code>update</code> on
|
|
1322
1523
|
every path.</strong> The batched paths re-apply the Query's conditions to each
|
|
1323
1524
|
batch window, where a limit or offset would skip or truncate rows
|
|
@@ -1356,27 +1557,28 @@ not pass <code>lock</code>.</strong> Plain <code>update(attributes)</code> (hook
|
|
|
1356
1557
|
are the right tools for bulk updates.</li>
|
|
1357
1558
|
</ul>
|
|
1358
1559
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">attributes</span>: <a href="../types/types.UpdateableProperties.html" class="tsd-signature-type tsd-kind-type-alias">UpdateableProperties</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">></span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4><p>The number of records that were updated</p>
|
|
1359
|
-
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-
|
|
1360
|
-
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-
|
|
1361
|
-
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-
|
|
1362
|
-
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-
|
|
1363
|
-
</div
|
|
1560
|
+
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-25">Throws<a href="#throws-25" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>InvalidBatchSize if <code>batchSize</code> is not a positive integer</p>
|
|
1561
|
+
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-26">Throws<a href="#throws-26" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>MissingRequiredLockOptionForUpdateCallback if a callback is passed without an options object carrying a boolean <code>lock</code></p>
|
|
1562
|
+
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-27">Throws<a href="#throws-27" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>BatchingIncompatibleWithLimitOrOffset if the query carries a <code>limit</code> or <code>offset</code></p>
|
|
1563
|
+
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-28">Throws<a href="#throws-28" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>CannotSetEncryptedColumnInQueryUpdate if the single-statement <code>skipHooks</code> form's attributes name an <code>@Encrypted</code> backing column with anything other than <code>null</code></p>
|
|
1564
|
+
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-29">Throws<a href="#throws-29" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>CannotSaveMissingDream if, on an unlocked per-record path, a record's row is hard-deleted between its batch's read and a write that is not a no-op</p>
|
|
1565
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L3677">src/dream/Query.ts:3677</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="where"><span>where</span><a href="#where" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="where-1"><span class="tsd-kind-call-signature">where</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#wheredb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#whereschema">Schema</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">whereStatement</span><span class="tsd-signature-symbol">:</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">WhereStatementForJoinedAssociation</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#wheredb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#whereschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#where-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Applies a where statement to the Query instance</p>
|
|
1364
1566
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">where</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-6">'how@yadoin'</span><span class="hl-1"> }).</span><span class="hl-5">first</span><span class="hl-1">()</span><br/><span class="hl-7">// User{email: 'how@yadoin'}</span>
|
|
1365
1567
|
</code><button type="button">Copy</button></pre>
|
|
1366
1568
|
|
|
1367
1569
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="wheredb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="whereschema"><span class="tsd-kind-type-parameter">Schema</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">whereStatement</span>: <br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">WhereStatementForJoinedAssociation</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#wheredb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#whereschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></span><div class="tsd-comment tsd-typography"><p>Where statement to apply to the Query</p>
|
|
1368
1570
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A cloned Query with the where clause applied</p>
|
|
1369
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
1571
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1497">src/dream/Query.ts:1497</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="whereany"><span>where<wbr/>Any</span><a href="#whereany" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="whereany-1"><span class="tsd-kind-call-signature">whereAny</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#whereanydb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#whereanyschema">Schema</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">whereStatements</span><span class="tsd-signature-symbol">:</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">WhereStatementForJoinedAssociation</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#whereanydb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#whereanyschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#whereany-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Accepts a list of where statements, each of
|
|
1370
1572
|
which is combined via <code>OR</code></p>
|
|
1371
1573
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">whereAny</span><span class="hl-1">([{ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-6">'how@yadoin'</span><span class="hl-1"> }, { </span><span class="hl-4">name:</span><span class="hl-1"> </span><span class="hl-6">'fred'</span><span class="hl-1"> }]).</span><span class="hl-5">first</span><span class="hl-1">()</span><br/><span class="hl-7">// [User{email: 'how@yadoin'}, User{name: 'fred'}, User{name: 'fred'}]</span>
|
|
1372
1574
|
</code><button type="button">Copy</button></pre>
|
|
1373
1575
|
|
|
1374
1576
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="whereanydb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="whereanyschema"><span class="tsd-kind-type-parameter">Schema</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">whereStatements</span>: <br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">WhereStatementForJoinedAssociation</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#whereanydb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#whereanyschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">[]</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></span><div class="tsd-comment tsd-typography"><p>a list of where statements to <code>OR</code> together</p>
|
|
1375
1577
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A cloned Query with the whereAny clause applied</p>
|
|
1376
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
1578
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1521">src/dream/Query.ts:1521</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="wherenot"><span>where<wbr/>Not</span><a href="#wherenot" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="wherenot-1"><span class="tsd-kind-call-signature">whereNot</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#wherenotdb">DB</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#wherenotschema">Schema</a> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">whereStatement</span><span class="tsd-signature-symbol">:</span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">WhereStatementForJoinedAssociation</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#wherenotdb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#wherenotschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#wherenot-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Applies a whereNot statement to the Query instance</p>
|
|
1377
1579
|
<pre><code class="ts"><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">query</span><span class="hl-1">().</span><span class="hl-5">whereNot</span><span class="hl-1">({ </span><span class="hl-4">email:</span><span class="hl-1"> </span><span class="hl-6">'how@yadoin'</span><span class="hl-1"> }).</span><span class="hl-5">first</span><span class="hl-1">()</span><br/><span class="hl-7">// User{email: 'hello@world'}</span>
|
|
1378
1580
|
</code><button type="button">Copy</button></pre>
|
|
1379
1581
|
|
|
1380
1582
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="wherenotdb"><span class="tsd-kind-type-parameter">DB</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li><li><span id="wherenotschema"><span class="tsd-kind-type-parameter">Schema</span> <span class="tsd-signature-keyword">extends</span> <span class="tsd-signature-type">any</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">whereStatement</span>: <br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">WhereStatementForJoinedAssociation</span><span class="tsd-signature-symbol"><</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"joinedAssociations"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#wherenotdb">DB</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#wherenotschema">Schema</a><span class="tsd-signature-symbol">,</span><br/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"rootTableName"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">,</span><br/> <span class="tsd-signature-symbol">></span><br/> <span class="tsd-signature-symbol">|</span> <span class="tsd-signature-type">null</span></span><div class="tsd-comment tsd-typography"><p>A where statement to negate and apply to the Query</p>
|
|
1381
1583
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Query</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dreaminstance">DreamInstance</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#querytypeopts">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A cloned Query with the whereNot clause applied</p>
|
|
1382
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ca5a693d77d580b63e885f3eaf29598becd0a1a8/src/dream/Query.ts#L1327">src/dream/Query.ts:1327</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="dbdriverclass"><code class="tsd-tag">Static</code><span>db<wbr/>Driver<wbr/>Class</span><a href="#dbdriverclass" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="dbdriverclass-1"><span class="tsd-kind-call-signature">dbDriverClass</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dbdriverclasst">T</a> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">connectionName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">typeof</span> <a href="db.QueryDriverBase.html" class="tsd-signature-type tsd-kind-class">QueryDriverBase</a><a href="#dbdriverclass-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="dbdriverclasst"><span class="tsd-kind-type-parameter">T</span> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">connectionName</span>: <span class="tsd-signature-type">string</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-keyword">typeof</span> <a href="db.QueryDriverBase.html" class="tsd-signature-type tsd-kind-class">QueryDriverBase</a></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/ca5a693d77d580b63e885f3eaf29598becd0a1a8/src/dream/Query.ts#L2162">src/dream/Query.ts:2162</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#connectionoverride" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>connection<wbr/>Override</span></a><a href="#dreamclass" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dream<wbr/>Class</span></a><a href="#dreaminstance-1"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dream<wbr/>Instance</span></a><a href="#dreamtransaction"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dream<wbr/>Transaction</span></a><a href="#innerjoindreamclasses" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>inner<wbr/>Join<wbr/>Dream<wbr/>Classes</span></a><a href="#querytypeopts-1"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>query<wbr/>Type<wbr/>Opts</span></a><a href="#batch_sizes"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>BATCH_<wbr/>SIZES</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Accessors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Accessors</summary><div><a href="#connectionname"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>connection<wbr/>Name</span></a><a href="#isdreamquery"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>is<wbr/>Dream<wbr/>Query</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#all"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>all</span></a><a href="#avg"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>avg</span></a><a href="#avgby"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>avg<wbr/>By</span></a><a href="#clone"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>clone</span></a><a href="#connection"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>connection</span></a><a href="#count"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>count</span></a><a href="#countby"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>count<wbr/>By</span></a><a href="#cursorpaginate"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>cursor<wbr/>Paginate</span></a><a href="#dbdriverinstance"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>db<wbr/>Driver<wbr/>Instance</span></a><a href="#delete"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>delete</span></a><a href="#destroy"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>destroy</span></a><ul><li><ul><li><a href="#guarded-compare-and-set-destroy"><span>Guarded (compare-<wbr/>and-<wbr/>set) destroy</span></a></li></ul></li></ul><a href="#distinct"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>distinct</span></a><a href="#exists"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>exists</span></a><a href="#find"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find</span></a><a href="#findby"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>By</span></a><a href="#findeach"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Each</span></a><a href="#findorfail"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Or<wbr/>Fail</span></a><a href="#findorfailby"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Or<wbr/>Fail<wbr/>By</span></a><a href="#first"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>first</span></a><a href="#firstorfail"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>first<wbr/>Or<wbr/>Fail</span></a><a href="#innerjoin"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>inner<wbr/>Join</span></a><a href="#last"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>last</span></a><a href="#lastorfail"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>last<wbr/>Or<wbr/>Fail</span></a><a href="#leftjoin"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>left<wbr/>Join</span></a><a href="#leftjoinpreload"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>left<wbr/>Join<wbr/>Preload</span></a><a href="#limit"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>limit</span></a><a href="#max"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>max</span></a><a href="#maxby"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>max<wbr/>By</span></a><a href="#min"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>min</span></a><a href="#minby"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>min<wbr/>By</span></a><a href="#nestedselect"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>nested<wbr/>Select</span></a><a href="#offset"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>offset</span></a><a href="#order"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>order</span></a><a href="#paginate"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>paginate</span></a><a href="#passthrough"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>passthrough</span></a><a href="#pluck"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>pluck</span></a><a href="#pluckeach"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>pluck<wbr/>Each</span></a><a href="#preload"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>preload</span></a><a href="#preloadfor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>preload<wbr/>For</span></a><a href="#reallydestroy"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>really<wbr/>Destroy</span></a><a href="#removealldefaultscopes"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>All<wbr/>Default<wbr/>Scopes</span></a><a href="#removealldefaultscopesexceptonassociations" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>All<wbr/>Default<wbr/>Scopes<wbr/>Except<wbr/>On<wbr/>Associations</span></a><a href="#removedefaultscope"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Default<wbr/>Scope</span></a><a href="#removedefaultscopeexceptonassociations" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Default<wbr/>Scope<wbr/>Except<wbr/>On<wbr/>Associations</span></a><a href="#scrollpaginate"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>scroll<wbr/>Paginate</span></a><a href="#sql"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>sql</span></a><a href="#sum"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>sum</span></a><a href="#sumby"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>sum<wbr/>By</span></a><a href="#tokysely"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>to<wbr/>Kysely</span></a><a href="#txn"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>txn</span></a><a href="#undestroy"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>undestroy</span></a><a href="#update"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>update</span></a><a href="#where"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where</span></a><a href="#whereany"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where<wbr/>Any</span></a><a href="#wherenot"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where<wbr/>Not</span></a><a href="#dbdriverclass"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>db<wbr/>Driver<wbr/>Class</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@rvoh/dream</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
1584
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L1548">src/dream/Query.ts:1548</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="dbdriverclass"><code class="tsd-tag">Static</code><span>db<wbr/>Driver<wbr/>Class</span><a href="#dbdriverclass" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="dbdriverclass-1"><span class="tsd-kind-call-signature">dbDriverClass</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="#dbdriverclasst">T</a> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">connectionName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-keyword">typeof</span> <a href="db.QueryDriverBase.html" class="tsd-signature-type tsd-kind-class">QueryDriverBase</a><a href="#dbdriverclass-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span id="dbdriverclasst"><span class="tsd-kind-type-parameter">T</span> <span class="tsd-signature-keyword">extends</span> <a href="index.Dream.html" class="tsd-signature-type tsd-kind-class">Dream</a></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">connectionName</span>: <span class="tsd-signature-type">string</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-keyword">typeof</span> <a href="db.QueryDriverBase.html" class="tsd-signature-type tsd-kind-class">QueryDriverBase</a></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3dfe77330956cf0483dab2061668fc38ccee1836/src/dream/Query.ts#L2386">src/dream/Query.ts:2386</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#connectionoverride" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>connection<wbr/>Override</span></a><a href="#dreamclass" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dream<wbr/>Class</span></a><a href="#dreaminstance-1"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dream<wbr/>Instance</span></a><a href="#dreamtransaction"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dream<wbr/>Transaction</span></a><a href="#innerjoindreamclasses" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>inner<wbr/>Join<wbr/>Dream<wbr/>Classes</span></a><a href="#querytypeopts-1"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>query<wbr/>Type<wbr/>Opts</span></a><a href="#batch_sizes"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>BATCH_<wbr/>SIZES</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Accessors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Accessors</summary><div><a href="#connectionname"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>connection<wbr/>Name</span></a><a href="#isdreamquery"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Accessor"><use href="../assets/icons.svg#icon-262144"></use></svg><span>is<wbr/>Dream<wbr/>Query</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#all"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>all</span></a><a href="#avg"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>avg</span></a><a href="#avgby"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>avg<wbr/>By</span></a><a href="#clone"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>clone</span></a><a href="#connection"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>connection</span></a><a href="#count"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>count</span></a><a href="#countby"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>count<wbr/>By</span></a><a href="#cursorpaginate"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>cursor<wbr/>Paginate</span></a><a href="#dbdriverinstance"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>db<wbr/>Driver<wbr/>Instance</span></a><a href="#delete"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>delete</span></a><a href="#destroy"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>destroy</span></a><ul><li><ul><li><a href="#guarded-compare-and-set-destroy"><span>Guarded (compare-<wbr/>and-<wbr/>set) destroy</span></a></li></ul></li></ul><a href="#distinct"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>distinct</span></a><a href="#exists"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>exists</span></a><a href="#find"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find</span></a><a href="#findby"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>By</span></a><a href="#findeach"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Each</span></a><a href="#findorfail"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Or<wbr/>Fail</span></a><a href="#findorfailby"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Or<wbr/>Fail<wbr/>By</span></a><a href="#first"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>first</span></a><a href="#firstorfail"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>first<wbr/>Or<wbr/>Fail</span></a><a href="#innerjoin"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>inner<wbr/>Join</span></a><a href="#last"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>last</span></a><a href="#lastorfail"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>last<wbr/>Or<wbr/>Fail</span></a><a href="#leftjoin"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>left<wbr/>Join</span></a><a href="#leftjoinpreload"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>left<wbr/>Join<wbr/>Preload</span></a><a href="#limit"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>limit</span></a><a href="#max"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>max</span></a><a href="#maxby"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>max<wbr/>By</span></a><a href="#min"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>min</span></a><a href="#minby"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>min<wbr/>By</span></a><a href="#nestedselect"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>nested<wbr/>Select</span></a><a href="#offset"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>offset</span></a><a href="#order"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>order</span></a><a href="#paginate"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>paginate</span></a><a href="#passthrough"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>passthrough</span></a><a href="#pluck"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>pluck</span></a><a href="#pluckeach"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>pluck<wbr/>Each</span></a><a href="#preload"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>preload</span></a><a href="#preloadfor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>preload<wbr/>For</span></a><a href="#reallydestroy"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>really<wbr/>Destroy</span></a><a href="#removealldefaultscopes"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>All<wbr/>Default<wbr/>Scopes</span></a><a href="#removealldefaultscopesexceptonassociations" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>All<wbr/>Default<wbr/>Scopes<wbr/>Except<wbr/>On<wbr/>Associations</span></a><a href="#removedefaultscope"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Default<wbr/>Scope</span></a><a href="#removedefaultscopeexceptonassociations" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Default<wbr/>Scope<wbr/>Except<wbr/>On<wbr/>Associations</span></a><a href="#scrollpaginate"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>scroll<wbr/>Paginate</span></a><a href="#sql"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>sql</span></a><a href="#sum"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>sum</span></a><a href="#sumby"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>sum<wbr/>By</span></a><a href="#tokysely"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>to<wbr/>Kysely</span></a><a href="#txn"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>txn</span></a><a href="#undestroy"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>undestroy</span></a><a href="#update"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>update</span></a><a href="#where"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where</span></a><a href="#whereany"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where<wbr/>Any</span></a><a href="#wherenot"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where<wbr/>Not</span></a><a href="#dbdriverclass"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>db<wbr/>Driver<wbr/>Class</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@rvoh/dream</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|