@rvoh/dream 2.20.0 → 2.22.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/dist/cjs/src/Dream.js +3 -0
- package/dist/cjs/src/cli/index.js +7 -4
- package/dist/cjs/src/dream/DreamClassTransactionBuilder.js +3 -0
- package/dist/cjs/src/dream/Query.js +203 -4
- package/dist/cjs/src/dream/QueryDriver/Base.js +26 -0
- package/dist/cjs/src/dream/QueryDriver/Kysely.js +46 -4
- package/dist/cjs/src/dream/QueryDriver/Postgres.js +21 -0
- package/dist/cjs/src/dream/internal/destroyAssociatedRecords.js +76 -4
- package/dist/cjs/src/dream/internal/destroyDream.js +6 -7
- package/dist/cjs/src/errors/InvalidBatchSize.js +19 -0
- package/dist/cjs/src/errors/NoColumnsToAlterMigration.js +17 -0
- package/dist/cjs/src/errors/RowLockIncompatibleWithDistinct.js +14 -0
- package/dist/cjs/src/errors/RowLockIncompatibleWithJoinLoad.js +14 -0
- package/dist/cjs/src/errors/UnparseableMigrationColumn.js +16 -0
- package/dist/cjs/src/errors/ops/ArrayEqualityRequiresArrayColumn.js +23 -0
- package/dist/cjs/src/helpers/cli/generateMigration.js +20 -3
- package/dist/cjs/src/helpers/cli/generateMigrationContent.js +74 -9
- package/dist/cjs/src/ops/index.js +19 -0
- package/dist/esm/src/Dream.js +3 -0
- package/dist/esm/src/cli/index.js +7 -4
- package/dist/esm/src/dream/DreamClassTransactionBuilder.js +3 -0
- package/dist/esm/src/dream/Query.js +203 -4
- package/dist/esm/src/dream/QueryDriver/Base.js +26 -0
- package/dist/esm/src/dream/QueryDriver/Kysely.js +46 -4
- package/dist/esm/src/dream/QueryDriver/Postgres.js +21 -0
- package/dist/esm/src/dream/internal/destroyAssociatedRecords.js +76 -4
- package/dist/esm/src/dream/internal/destroyDream.js +6 -7
- package/dist/esm/src/errors/InvalidBatchSize.js +19 -0
- package/dist/esm/src/errors/NoColumnsToAlterMigration.js +17 -0
- package/dist/esm/src/errors/RowLockIncompatibleWithDistinct.js +14 -0
- package/dist/esm/src/errors/RowLockIncompatibleWithJoinLoad.js +14 -0
- package/dist/esm/src/errors/UnparseableMigrationColumn.js +16 -0
- package/dist/esm/src/errors/ops/ArrayEqualityRequiresArrayColumn.js +23 -0
- package/dist/esm/src/helpers/cli/generateMigration.js +20 -3
- package/dist/esm/src/helpers/cli/generateMigrationContent.js +74 -9
- package/dist/esm/src/ops/index.js +19 -0
- package/dist/types/src/Dream.d.ts +3 -0
- package/dist/types/src/cli/index.d.ts +1 -1
- package/dist/types/src/dream/DreamClassTransactionBuilder.d.ts +3 -0
- package/dist/types/src/dream/Query.d.ts +140 -3
- package/dist/types/src/dream/QueryDriver/Base.d.ts +21 -0
- package/dist/types/src/dream/QueryDriver/Kysely.d.ts +1 -0
- package/dist/types/src/dream/QueryDriver/Postgres.d.ts +20 -0
- package/dist/types/src/dream/internal/destroyAssociatedRecords.d.ts +22 -3
- package/dist/types/src/errors/InvalidBatchSize.d.ts +5 -0
- package/dist/types/src/errors/NoColumnsToAlterMigration.d.ts +6 -0
- package/dist/types/src/errors/RowLockIncompatibleWithDistinct.d.ts +3 -0
- package/dist/types/src/errors/RowLockIncompatibleWithJoinLoad.d.ts +3 -0
- package/dist/types/src/errors/UnparseableMigrationColumn.d.ts +5 -0
- package/dist/types/src/errors/ops/ArrayEqualityRequiresArrayColumn.d.ts +8 -0
- package/dist/types/src/helpers/cli/generateMigrationContent.d.ts +11 -1
- package/dist/types/src/ops/index.d.ts +19 -0
- package/dist/types/src/types/associations/shared.d.ts +2 -2
- package/dist/types/src/types/dream.d.ts +8 -0
- package/dist/types/src/types/types/associations/shared.ts +84 -55
- package/dist/types/src/types/types/dream.ts +30 -0
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/db.DreamMigrationHelpers.html +11 -11
- package/docs/classes/db.KyselyQueryDriver.html +55 -41
- package/docs/classes/db.PostgresQueryDriver.html +55 -42
- package/docs/classes/db.QueryDriverBase.html +54 -40
- 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.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 +19 -19
- package/docs/classes/index.Dream.html +127 -125
- package/docs/classes/index.DreamApp.html +10 -10
- package/docs/classes/index.DreamTransaction.html +2 -2
- package/docs/classes/index.Env.html +2 -2
- package/docs/classes/index.Query.html +161 -71
- package/docs/classes/system.CliFileWriter.html +4 -4
- package/docs/classes/system.DreamBin.html +2 -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 +11 -11
- package/docs/classes/system.ObjectSerializerBuilder.html +8 -8
- package/docs/classes/system.PathHelpers.html +3 -3
- package/docs/classes/utils.Encrypt.html +3 -3
- 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/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.DreamAppInitOptions.html +2 -2
- package/docs/interfaces/types.DreamAppOpts.html +2 -2
- package/docs/interfaces/types.DreamDbConfig.html +5 -5
- package/docs/interfaces/types.DurationObject.html +2 -2
- package/docs/interfaces/types.EncryptOptions.html +2 -2
- 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/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.OpenapiSchemaCommonFields.html +1 -1
- package/docs/types/openapi.OpenapiSchemaExpressionAllOf.html +2 -2
- package/docs/types/openapi.OpenapiSchemaExpressionAnyOf.html +2 -2
- package/docs/types/openapi.OpenapiSchemaExpressionOneOf.html +2 -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 +2 -2
- package/docs/types/openapi.OpenapiSchemaNumber.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObject.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectAllOf.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectAllOfShorthand.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectAnyOf.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectAnyOfShorthand.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectBase.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectBaseShorthand.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectOneOf.html +1 -1
- package/docs/types/openapi.OpenapiSchemaObjectOneOfShorthand.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 +2 -2
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionAnyOf.html +2 -2
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionOneOf.html +2 -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 +38 -23
- 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
|
@@ -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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L89">src/dream/Query.ts:89</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/5133f6fa68e16c878139f35bc0bc97741b1c6e72/src/dream/Query.ts#L341">src/dream/Query.ts:341</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/5133f6fa68e16c878139f35bc0bc97741b1c6e72/src/dream/Query.ts#L332">src/dream/Query.ts:332</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/5133f6fa68e16c878139f35bc0bc97741b1c6e72/src/dream/Query.ts#L330">src/dream/Query.ts:330</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/5133f6fa68e16c878139f35bc0bc97741b1c6e72/src/dream/Query.ts#L331">src/dream/Query.ts:331</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L348">src/dream/Query.ts:348</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L339">src/dream/Query.ts:339</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L337">src/dream/Query.ts:337</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L338">src/dream/Query.ts:338</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L121">src/dream/Query.ts:121</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L346">src/dream/Query.ts:346</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L113">src/dream/Query.ts:113</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">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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L99">src/dream/Query.ts:99</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2048">src/dream/Query.ts:2048</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L390">src/dream/Query.ts:390</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2030">src/dream/Query.ts:2030</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1836">src/dream/Query.ts:1836</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1873">src/dream/Query.ts:1873</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L406">src/dream/Query.ts:406</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2361">src/dream/Query.ts:2361</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1512">src/dream/Query.ts:1512</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,7 +141,7 @@ 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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1546">src/dream/Query.ts:1546</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>
|
|
@@ -153,7 +153,7 @@ then the implicit primary key ordering will be omitted.</p>
|
|
|
153
153
|
|
|
154
154
|
</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
155
|
</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/
|
|
156
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2218">src/dream/Query.ts:2218</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2043">src/dream/Query.ts:2043</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
157
|
database query, but does not call underlying callbacks.
|
|
158
158
|
Ignores association dependent destroy declarations,
|
|
159
159
|
though cascading may still happen at the database level.</p>
|
|
@@ -163,7 +163,7 @@ use <a href="#destroy" class="tsd-kind-method">Query.destroy</a> instead.</p>
|
|
|
163
163
|
</code><button type="button">Copy</button></pre>
|
|
164
164
|
|
|
165
165
|
</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/
|
|
166
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2836">src/dream/Query.ts:2836</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">__namedParameters</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
167
|
calling model hooks and cascading destroy
|
|
168
168
|
to associations with <code>dependent: 'destroy'</code>,
|
|
169
169
|
and returns the number of records that
|
|
@@ -175,11 +175,84 @@ dependent-destroy declarations, use
|
|
|
175
175
|
<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">destroy</span><span class="hl-1">()</span><br/><span class="hl-7">// 12</span>
|
|
176
176
|
</code><button type="button">Copy</button></pre>
|
|
177
177
|
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
<h2 id="guarded-compare-and-set-destroy" class="tsd-anchor-link">Guarded (compare-and-set) destroy<a href="#guarded-compare-and-set-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></h2>
|
|
179
|
+
<p>By default, <code>destroy</code> reads the matching records and then destroys each of
|
|
180
|
+
them, so a concurrent writer can change a record in between — the record is
|
|
181
|
+
destroyed even though it no longer matches the Query that selected it.
|
|
182
|
+
Passing <code>lock: true</code> closes that window, making <code>destroy</code> a compare-and-set
|
|
183
|
+
the way <code>update(..., { skipHooks: true })</code> already is:</p>
|
|
184
|
+
<pre><code class="ts"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">destroyed</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">Order</span><span class="hl-1">.</span><span class="hl-5">where</span><span class="hl-1">({ </span><span class="hl-4">status:</span><span class="hl-1"> </span><span class="hl-6">'pending'</span><span class="hl-1"> }).</span><span class="hl-5">destroy</span><span class="hl-1">({ </span><span class="hl-4">lock:</span><span class="hl-1"> </span><span class="hl-0">true</span><span class="hl-1"> })</span><br/><span class="hl-7">// 0 — someone else moved every one of them out of 'pending' first</span>
|
|
185
|
+
</code><button type="button">Copy</button></pre>
|
|
186
|
+
|
|
187
|
+
<p>With <code>lock: true</code>, records are processed in batches, and each batch runs in
|
|
188
|
+
its own transaction which first re-selects that batch's records with an
|
|
189
|
+
exclusive row lock and then destroys them before committing. Because the
|
|
190
|
+
database re-checks the Query's conditions after acquiring each row lock,
|
|
191
|
+
a record a concurrent transaction has already moved out of the Query drops
|
|
192
|
+
out of the locked read and is never destroyed. The returned count is the
|
|
193
|
+
number of records actually claimed, so a caller can detect that it lost a
|
|
194
|
+
race by comparing the count against what it expected.</p>
|
|
195
|
+
<p>Things to know before relying on it:</p>
|
|
196
|
+
<ul>
|
|
197
|
+
<li><strong>The guarantee is per batch, not set-wide.</strong> A run spanning more than one
|
|
198
|
+
batch can win a race in batch 1 and lose one in batch 2; nothing holds the
|
|
199
|
+
whole matched set still for the duration of the run. Sharing one
|
|
200
|
+
transaction across every batch — by threading a transaction onto the Query
|
|
201
|
+
itself, <code>Order.query().txn(txn).where({ ... }).destroy({ lock: true })</code> —
|
|
202
|
+
buys two things: the destroys become all-or-nothing (a rollback undoes the
|
|
203
|
+
whole run), and the row locks taken by every batch are held until you
|
|
204
|
+
commit. It does <strong>not</strong> extend the compare-and-set to the part of the set
|
|
205
|
+
the run has not reached yet: under READ COMMITTED each statement takes a
|
|
206
|
+
fresh snapshot, so a record moved out of the Query between batch 1 and
|
|
207
|
+
batch 2 still drops out of batch 2's locked read. A genuinely set-wide
|
|
208
|
+
guarantee needs REPEATABLE READ / SERIALIZABLE, or a single locking
|
|
209
|
+
statement over the whole set.</li>
|
|
210
|
+
<li><strong>Only a transaction carried by the Query is shared.</strong> Merely wrapping the
|
|
211
|
+
call in <code>Model.transaction(...)</code> does not thread that transaction onto the
|
|
212
|
+
Query — <code>Dream.transaction</code> establishes no ambient transaction, it only
|
|
213
|
+
hands a <code>txn</code> to your callback — so each batch would open its own
|
|
214
|
+
transaction on a different pooled connection. Worse, if the surrounding
|
|
215
|
+
transaction has already written to any of the matched rows, each batch's
|
|
216
|
+
locked read blocks on locks the surrounding transaction holds while that
|
|
217
|
+
transaction awaits the destroy: a cycle across two connections, which
|
|
218
|
+
Postgres's deadlock detector cannot see, so it hangs rather than aborting.
|
|
219
|
+
Always pass the transaction with <code>.txn(txn)</code>.</li>
|
|
220
|
+
<li><strong>Behavior above READ COMMITTED differs.</strong> The drop-out-of-the-result
|
|
221
|
+
behavior described above is READ COMMITTED (Postgres's default). Under
|
|
222
|
+
REPEATABLE READ or SERIALIZABLE, the same race raises a serialization
|
|
223
|
+
failure instead of silently returning a lower count. Both are safe; only
|
|
224
|
+
one of them is quiet.</li>
|
|
225
|
+
<li><strong><code>batchSize</code> defaults to 10 here</strong>, not <code>findEach</code>'s 1000, and the
|
|
226
|
+
default is deliberately small. Every row in a batch stays locked for the
|
|
227
|
+
whole batch, including the time spent running each record's hooks and
|
|
228
|
+
<code>dependent: 'destroy'</code> cascade, so an oversized batch blocks unrelated
|
|
229
|
+
writers touching those rows and surfaces as timeouts somewhere else in the
|
|
230
|
+
application, which is very hard to trace back to this destroy. Too small a
|
|
231
|
+
batch, by contrast, only slows down this call, which you can see and fix.
|
|
232
|
+
Lower it further for models with deep <code>dependent: 'destroy'</code> cascades or
|
|
233
|
+
expensive destroy hooks.</li>
|
|
234
|
+
<li><strong>A batch waits, without bound, for whoever holds the row.</strong> The locked
|
|
235
|
+
read is a plain <code>FOR UPDATE</code>: if another transaction already holds a lock
|
|
236
|
+
on one of the batch's rows, this call blocks until that transaction ends,
|
|
237
|
+
holding its own transaction and its pooled connection open the whole
|
|
238
|
+
time. Dream sets no <code>lock_timeout</code> or <code>statement_timeout</code>, so a
|
|
239
|
+
long-running writer on the other side stalls the run indefinitely and, at
|
|
240
|
+
scale, ties up connections. If that is a risk in your application, set a
|
|
241
|
+
<code>lock_timeout</code> on the connection so a stuck batch fails instead of
|
|
242
|
+
hanging.</li>
|
|
243
|
+
<li><strong>If you are destroying a large set and do not need compare-and-set, do
|
|
244
|
+
not pass <code>lock</code>.</strong> Plain <code>destroy()</code> (hooks and cascade, no locking) or
|
|
245
|
+
<a href="#delete" class="tsd-kind-method">delete</a> (a single statement, no hooks or cascade)
|
|
246
|
+
are the right tools for bulk removal.</li>
|
|
247
|
+
</ul>
|
|
248
|
+
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><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-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">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></span><div class="tsd-comment tsd-typography"><p>Options for destroying the instance</p>
|
|
249
|
+
</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 number of records to process per batch. Must be a positive integer. Defaults to 10 when <code>lock</code> is true, and to 1000 otherwise</p>
|
|
250
|
+
</div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">cascade</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>If false, skips destroying associations marked <code>dependent: 'destroy'</code>. Defaults to true</p>
|
|
251
|
+
</div></li><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">boolean</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 destroyed, making the destroy a compare-and-set. Defaults to false</p>
|
|
180
252
|
</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 destroy operation. Defaults to false</p>
|
|
181
253
|
</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>
|
|
182
|
-
<
|
|
254
|
+
<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>
|
|
255
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2588">src/dream/Query.ts:2588</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.
|
|
183
256
|
If no column is specified, applies distinct to the primary key.
|
|
184
257
|
Pass true to apply distinct to primary key, false to disable distinct.</p>
|
|
185
258
|
<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>
|
|
@@ -187,19 +260,19 @@ Pass true to apply distinct to primary key, false to disable distinct.</p>
|
|
|
187
260
|
|
|
188
261
|
</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>
|
|
189
262
|
</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>
|
|
190
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
263
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1579">src/dream/Query.ts:1579</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>
|
|
191
264
|
<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>
|
|
192
265
|
</code><button type="button">Copy</button></pre>
|
|
193
266
|
|
|
194
267
|
</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>
|
|
195
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
268
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2388">src/dream/Query.ts:2388</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
|
|
196
269
|
specified primary key. Returns null if not found.</p>
|
|
197
270
|
<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>
|
|
198
271
|
</code><button type="button">Copy</button></pre>
|
|
199
272
|
|
|
200
273
|
</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>
|
|
201
274
|
</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>
|
|
202
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
275
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L483">src/dream/Query.ts:483</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
|
|
203
276
|
specified where statement. If not found, null
|
|
204
277
|
is returned.</p>
|
|
205
278
|
<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>
|
|
@@ -207,19 +280,33 @@ is returned.</p>
|
|
|
207
280
|
|
|
208
281
|
</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>
|
|
209
282
|
</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>
|
|
210
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
283
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L523">src/dream/Query.ts:523</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,
|
|
211
284
|
and then calls the provided callback for each found record.
|
|
212
285
|
Once all records have been passed for a given batch, the next set of
|
|
213
286
|
records will be fetched and passed to your callback, until all
|
|
214
287
|
records matching the Query have been fetched.</p>
|
|
215
|
-
<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">
|
|
216
|
-
</code><button type="button">Copy</button></pre>
|
|
217
|
-
|
|
288
|
+
<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">deletedAt:</span><span class="hl-1"> </span><span class="hl-0">null</span><span class="hl-1"> }).</span><span class="hl-5">findEach</span><span class="hl-1">(</span><span class="hl-4">user</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">DreamApp</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><br/><span class="hl-1">})</span><br/><span class="hl-7">// User{id: 1}</span><br/><span class="hl-7">// User{id: 2}</span>
|
|
289
|
+
</code><button type="button">Copy</button></pre>
|
|
290
|
+
|
|
291
|
+
<p>IMPORTANT: <code>findEach</code> always iterates in ascending primary key order.
|
|
292
|
+
Any <code>order</code> applied to the Query is discarded; passing one has no effect
|
|
293
|
+
on the order records are visited in.</p>
|
|
294
|
+
<p>This is not a limitation that can be lifted. <code>findEach</code> guarantees that
|
|
295
|
+
every matching record is visited exactly once, and it delivers that by
|
|
296
|
+
paginating on a keyset: each batch selects the next <code>batchSize</code> records
|
|
297
|
+
with a primary key greater than the last record of the previous batch.
|
|
298
|
+
That guarantee only holds over a stable, unique key. Ordering by a
|
|
299
|
+
mutable, non-unique column would mean a record whose sort value changed
|
|
300
|
+
partway through the iteration could be skipped entirely or visited twice.
|
|
301
|
+
(<a href="#cursorpaginate" class="tsd-kind-method">Query.cursorPaginate</a> can honor an arbitrary order precisely
|
|
302
|
+
because a paginated UI tolerates that anomaly; a full traversal cannot.)</p>
|
|
303
|
+
<p>If you need records processed in a particular order, load them with a
|
|
304
|
+
regular ordered query instead of <code>findEach</code>.</p>
|
|
218
305
|
</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>
|
|
219
306
|
</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>
|
|
220
307
|
</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>
|
|
221
308
|
</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>
|
|
222
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
309
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L583">src/dream/Query.ts:583</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
|
|
223
310
|
specified primary key. If not found, an exception
|
|
224
311
|
is raised.</p>
|
|
225
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">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>
|
|
@@ -227,7 +314,7 @@ is raised.</p>
|
|
|
227
314
|
|
|
228
315
|
</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>
|
|
229
316
|
</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>
|
|
230
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
317
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L504">src/dream/Query.ts:504</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
|
|
231
318
|
specified where statement. If not found, an exception
|
|
232
319
|
is raised.</p>
|
|
233
320
|
<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>
|
|
@@ -235,7 +322,7 @@ is raised.</p>
|
|
|
235
322
|
|
|
236
323
|
</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>
|
|
237
324
|
</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>
|
|
238
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
325
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L540">src/dream/Query.ts:540</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
|
|
239
326
|
matching the Query. If the Query is not
|
|
240
327
|
ordered, it will automatically order
|
|
241
328
|
by primary key.</p>
|
|
@@ -243,7 +330,7 @@ by primary key.</p>
|
|
|
243
330
|
</code><button type="button">Copy</button></pre>
|
|
244
331
|
|
|
245
332
|
</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>
|
|
246
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
333
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2411">src/dream/Query.ts:2411</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
|
|
247
334
|
matching the Query. If the Query is not
|
|
248
335
|
ordered, it will automatically order
|
|
249
336
|
by primary key. If no record is found,
|
|
@@ -252,15 +339,15 @@ an exception is raised.</p>
|
|
|
252
339
|
</code><button type="button">Copy</button></pre>
|
|
253
340
|
|
|
254
341
|
</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>
|
|
255
|
-
<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>RecordNotFound if no record exists</p>
|
|
256
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/5133f6fa68e16c878139f35bc0bc97741b1c6e72/src/dream/Query.ts#L2410">src/dream/Query.ts:2410</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
|
|
342
|
+
<div class="tsd-comment tsd-typography"><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>RecordNotFound if no record exists</p>
|
|
343
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2434">src/dream/Query.ts:2434</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
|
|
257
344
|
joins statement attached</p>
|
|
258
345
|
<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>
|
|
259
346
|
</code><button type="button">Copy</button></pre>
|
|
260
347
|
|
|
261
348
|
</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>
|
|
262
349
|
</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>
|
|
263
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
350
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L827">src/dream/Query.ts:827</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
|
|
264
351
|
matching the Query. If the Query is not
|
|
265
352
|
ordered, it will automatically order
|
|
266
353
|
by primary key.</p>
|
|
@@ -268,7 +355,7 @@ by primary key.</p>
|
|
|
268
355
|
</code><button type="button">Copy</button></pre>
|
|
269
356
|
|
|
270
357
|
</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>
|
|
271
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
358
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2456">src/dream/Query.ts:2456</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
|
|
272
359
|
matching the Query. If the Query is not
|
|
273
360
|
ordered, it will automatically order
|
|
274
361
|
by primary key. If no record is found,
|
|
@@ -277,10 +364,10 @@ it will raise an exception.</p>
|
|
|
277
364
|
</code><button type="button">Copy</button></pre>
|
|
278
365
|
|
|
279
366
|
</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>
|
|
280
|
-
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-
|
|
281
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/5133f6fa68e16c878139f35bc0bc97741b1c6e72/src/dream/Query.ts#L2456">src/dream/Query.ts:2456</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>
|
|
367
|
+
<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>RecordNotFound if no record exists</p>
|
|
368
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2480">src/dream/Query.ts:2480</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>
|
|
282
369
|
</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>
|
|
283
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/5133f6fa68e16c878139f35bc0bc97741b1c6e72/src/dream/Query.ts#L858">src/dream/Query.ts:858</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.
|
|
370
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L882">src/dream/Query.ts:882</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.
|
|
284
371
|
See <a href="#preload" class="tsd-kind-method">Query.preload</a> for preloading in separate queries.</p>
|
|
285
372
|
<p>Note: since leftJoinPreload loads via single query, it has
|
|
286
373
|
some downsides and that may be avoided using <a href="#preload" class="tsd-kind-method">Query.preload</a>:</p>
|
|
@@ -307,19 +394,19 @@ stops naming it a full deploy before the column is actually dropped.</li>
|
|
|
307
394
|
|
|
308
395
|
</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>
|
|
309
396
|
</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>
|
|
310
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
397
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L643">src/dream/Query.ts:643</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>
|
|
311
398
|
<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>
|
|
312
399
|
</code><button type="button">Copy</button></pre>
|
|
313
400
|
|
|
314
401
|
</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>
|
|
315
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
402
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1366">src/dream/Query.ts:1366</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
|
|
316
403
|
for this Query</p>
|
|
317
404
|
<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>
|
|
318
405
|
</code><button type="button">Copy</button></pre>
|
|
319
406
|
|
|
320
407
|
</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>
|
|
321
408
|
</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>
|
|
322
|
-
<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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1617">src/dream/Query.ts:1617</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
|
|
323
410
|
the value of the provided group column (a SQL <code>GROUP BY</code>).</p>
|
|
324
411
|
<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>
|
|
325
412
|
</code><button type="button">Copy</button></pre>
|
|
@@ -335,14 +422,14 @@ are grouped under a real <code>null</code> key; a group whose aggregated values
|
|
|
335
422
|
</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>
|
|
336
423
|
</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>
|
|
337
424
|
</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>
|
|
338
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
425
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1654">src/dream/Query.ts:1654</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
|
|
339
426
|
for this Query</p>
|
|
340
427
|
<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>
|
|
341
428
|
</code><button type="button">Copy</button></pre>
|
|
342
429
|
|
|
343
430
|
</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>
|
|
344
431
|
</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>
|
|
345
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
432
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1690">src/dream/Query.ts:1690</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
|
|
346
433
|
the value of the provided group column (a SQL <code>GROUP BY</code>).</p>
|
|
347
434
|
<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>
|
|
348
435
|
</code><button type="button">Copy</button></pre>
|
|
@@ -358,19 +445,19 @@ are grouped under a real <code>null</code> key; a group whose aggregated values
|
|
|
358
445
|
</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>
|
|
359
446
|
</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>
|
|
360
447
|
</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>
|
|
361
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
448
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1727">src/dream/Query.ts:1727</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
|
|
362
449
|
in a sub Query</p>
|
|
363
450
|
<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>
|
|
364
451
|
</code><button type="button">Copy</button></pre>
|
|
365
452
|
|
|
366
453
|
</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>
|
|
367
454
|
</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>
|
|
368
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
455
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1304">src/dream/Query.ts:1304</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>
|
|
369
456
|
<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>
|
|
370
457
|
</code><button type="button">Copy</button></pre>
|
|
371
458
|
|
|
372
459
|
</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>
|
|
373
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
460
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1398">src/dream/Query.ts:1398</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
|
|
374
461
|
order statement</p>
|
|
375
462
|
<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>
|
|
376
463
|
</code><button type="button">Copy</button></pre>
|
|
@@ -380,7 +467,7 @@ order statement</p>
|
|
|
380
467
|
|
|
381
468
|
</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>
|
|
382
469
|
</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>
|
|
383
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
470
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1329">src/dream/Query.ts:1329</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,
|
|
384
471
|
which it uses to segment your query into pages, leveraging limit and offset
|
|
385
472
|
to deliver your query to you in pages.</p>
|
|
386
473
|
<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>
|
|
@@ -388,14 +475,14 @@ to deliver your query to you in pages.</p>
|
|
|
388
475
|
|
|
389
476
|
</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>
|
|
390
477
|
</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>
|
|
391
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
478
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2094">src/dream/Query.ts:2094</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
|
|
392
479
|
for the associations that require it.</p>
|
|
393
480
|
<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>
|
|
394
481
|
</code><button type="button">Copy</button></pre>
|
|
395
482
|
|
|
396
483
|
</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>
|
|
397
484
|
</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>
|
|
398
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
485
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1196">src/dream/Query.ts:1196</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>
|
|
399
486
|
<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>
|
|
400
487
|
</code><button type="button">Copy</button></pre>
|
|
401
488
|
|
|
@@ -406,7 +493,7 @@ array is returned:</p>
|
|
|
406
493
|
|
|
407
494
|
</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>
|
|
408
495
|
</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>
|
|
409
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
496
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1916">src/dream/Query.ts:1916</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/> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachdb">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="#pluckeachcolumnnames">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">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="#pluckeachdb">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="#pluckeachcbargtypes">CbArgTypes</a> <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-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><a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachcolumnnames">ColumnNames</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachcbargtypes">CbArgTypes</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><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
|
|
410
497
|
in batches, passing each found columns into the
|
|
411
498
|
provided callback function</p>
|
|
412
499
|
<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>
|
|
@@ -414,14 +501,14 @@ provided callback function</p>
|
|
|
414
501
|
|
|
415
502
|
</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="pluckeachdb"><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="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">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="#pluckeachdb">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="pluckeachcbargtypes"><span class="tsd-kind-type-parameter">CbArgTypes</span> <span class="tsd-signature-keyword">extends</span> <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">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><a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachcolumnnames">ColumnNames</a><span class="tsd-signature-symbol">,</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="#pluckeachcbargtypes">CbArgTypes</a><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>
|
|
416
503
|
</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>
|
|
417
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
504
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1951">src/dream/Query.ts:1951</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.
|
|
418
505
|
See <a href="#leftjoinpreload" class="tsd-kind-method">Query.leftJoinPreload</a> for preloading in a single query.</p>
|
|
419
506
|
<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">visibilty:</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>
|
|
420
507
|
</code><button type="button">Copy</button></pre>
|
|
421
508
|
|
|
422
509
|
</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>
|
|
423
510
|
</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>
|
|
424
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
511
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L705">src/dream/Query.ts:705</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>
|
|
425
512
|
in a DreamSerializer. This traverses the entire content tree of serializers to automatically
|
|
426
513
|
load all necessary associations, eliminating N+1 query problems and removing the need to
|
|
427
514
|
manually remember which associations to preload for serialization.</p>
|
|
@@ -438,7 +525,7 @@ automatically preloads all associations that will be needed during serialization
|
|
|
438
525
|
</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>
|
|
439
526
|
</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>
|
|
440
527
|
</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>
|
|
441
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
528
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L781">src/dream/Query.ts:781</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">__namedParameters</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,
|
|
442
529
|
ignoring the SoftDelete decorator and
|
|
443
530
|
permanently removing records from the database.</p>
|
|
444
531
|
<p>Calls model hooks and applies cascade destroy
|
|
@@ -450,23 +537,26 @@ decorator, use <a href="#destroy" class="tsd-kind-method">Query.destroy</a> inst
|
|
|
450
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">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">reallyDestroy</span><span class="hl-1">()</span><br/><span class="hl-7">// 12</span>
|
|
451
538
|
</code><button type="button">Copy</button></pre>
|
|
452
539
|
|
|
453
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">__namedParameters</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><div class="tsd-comment tsd-typography"><p>Options for destroying the instance</p>
|
|
454
|
-
</div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">
|
|
540
|
+
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><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-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">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></span><div class="tsd-comment tsd-typography"><p>Options for destroying the instance</p>
|
|
541
|
+
</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 number of records to process per batch. Must be a positive integer. Defaults to 10 when <code>lock</code> is true, and to 1000 otherwise</p>
|
|
542
|
+
</div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">cascade</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>If false, skips destroying associations marked <code>dependent: 'destroy'</code>. Defaults to true</p>
|
|
543
|
+
</div></li><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">boolean</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 destroyed, making the destroy a compare-and-set. See <a href="#destroy" class="tsd-kind-method">Query.destroy</a> for the full semantics. Defaults to false</p>
|
|
455
544
|
</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 destroy operation. Defaults to false</p>
|
|
456
545
|
</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>
|
|
457
|
-
<
|
|
546
|
+
<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>InvalidBatchSize if <code>batchSize</code> is not a positive integer</p>
|
|
547
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2763">src/dream/Query.ts:2763</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="removealldefaultscopes"><span>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"><div class="tsd-comment tsd-typography"><p>Prevents default scopes from applying when
|
|
458
548
|
the Query is executed</p>
|
|
459
549
|
</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</p>
|
|
460
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
550
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1120">src/dream/Query.ts:1120</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
|
|
461
551
|
the Query is executed, but not when applying to associations</p>
|
|
462
552
|
</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>
|
|
463
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
553
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1133">src/dream/Query.ts:1133</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
|
|
464
554
|
the Query is executed</p>
|
|
465
555
|
</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>
|
|
466
|
-
<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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1146">src/dream/Query.ts:1146</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
|
|
467
557
|
the Query is executed, but not when applying to asociations</p>
|
|
468
558
|
</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>
|
|
469
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
559
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1161">src/dream/Query.ts:1161</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>
|
|
470
560
|
</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>
|
|
471
561
|
<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="#cursorpaginate" class="tsd-kind-method">cursorPaginate</a> instead.</p>
|
|
472
562
|
<p>Paginates the results of your query using cursor-based pagination,
|
|
@@ -479,19 +569,19 @@ then the implicit primary key ordering will be omitted.</p>
|
|
|
479
569
|
<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>
|
|
480
570
|
</code><button type="button">Copy</button></pre>
|
|
481
571
|
|
|
482
|
-
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
572
|
+
</div></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2164">src/dream/Query.ts:2164</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>
|
|
483
573
|
<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>
|
|
484
574
|
</code><button type="button">Copy</button></pre>
|
|
485
575
|
|
|
486
576
|
</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>
|
|
487
|
-
<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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1452">src/dream/Query.ts:1452</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
|
|
488
578
|
for this Query</p>
|
|
489
579
|
<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>
|
|
490
580
|
</code><button type="button">Copy</button></pre>
|
|
491
581
|
|
|
492
582
|
</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>
|
|
493
583
|
</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>
|
|
494
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
584
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/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="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
|
|
495
585
|
the value of the provided group column (a SQL <code>GROUP BY</code>).</p>
|
|
496
586
|
<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>
|
|
497
587
|
</code><button type="button">Copy</button></pre>
|
|
@@ -507,20 +597,20 @@ are grouped under a real <code>null</code> key; a group whose aggregated values
|
|
|
507
597
|
</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>
|
|
508
598
|
</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>
|
|
509
599
|
</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>
|
|
510
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/5133f6fa68e16c878139f35bc0bc97741b1c6e72/src/dream/Query.ts#L1776">src/dream/Query.ts:1776</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
|
|
600
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1800">src/dream/Query.ts:1800</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
|
|
511
601
|
you to build custom queries using the Kysely API</p>
|
|
512
602
|
<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>
|
|
513
603
|
</code><button type="button">Copy</button></pre>
|
|
514
604
|
|
|
515
605
|
</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>
|
|
516
606
|
</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>
|
|
517
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
607
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1467">src/dream/Query.ts:1467</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>
|
|
518
608
|
<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>
|
|
519
609
|
</code><button type="button">Copy</button></pre>
|
|
520
610
|
|
|
521
611
|
</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>
|
|
522
612
|
</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>
|
|
523
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
613
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1495">src/dream/Query.ts:1495</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><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">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><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="#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
|
|
524
614
|
the <code>deletedAt</code> field in the database.</p>
|
|
525
615
|
<p>If the model is not a SoftDelete model,
|
|
526
616
|
this will raise an exception.</p>
|
|
@@ -531,7 +621,7 @@ this will raise an exception.</p>
|
|
|
531
621
|
</div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">cascade</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>If false, skips undestroying associations marked <code>dependent: 'destroy'</code>. Defaults to true</p>
|
|
532
622
|
</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>
|
|
533
623
|
</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>
|
|
534
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
624
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2791">src/dream/Query.ts:2791</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">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">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>
|
|
535
625
|
<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>
|
|
536
626
|
</code><button type="button">Copy</button></pre>
|
|
537
627
|
|
|
@@ -539,29 +629,29 @@ this will raise an exception.</p>
|
|
|
539
629
|
</div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">options</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><div class="tsd-comment tsd-typography"><p>Options for updating the instance</p>
|
|
540
630
|
</div><ul class="tsd-parameters"><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>
|
|
541
631
|
</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>
|
|
542
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
632
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2852">src/dream/Query.ts:2852</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><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-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>
|
|
543
633
|
<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>
|
|
544
634
|
</code><button type="button">Copy</button></pre>
|
|
545
635
|
|
|
546
636
|
</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><div class="tsd-comment tsd-typography"><p>The attributes used to update the records</p>
|
|
547
637
|
</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">number</span><span class="tsd-signature-symbol">></span></h4><p>The number of records that were updated</p>
|
|
548
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
638
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2856">src/dream/Query.ts:2856</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>
|
|
549
639
|
<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>
|
|
550
640
|
</code><button type="button">Copy</button></pre>
|
|
551
641
|
|
|
552
642
|
</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>
|
|
553
643
|
</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>
|
|
554
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
644
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1213">src/dream/Query.ts:1213</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
|
|
555
645
|
which is combined via <code>OR</code></p>
|
|
556
646
|
<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>
|
|
557
647
|
</code><button type="button">Copy</button></pre>
|
|
558
648
|
|
|
559
649
|
</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>
|
|
560
650
|
</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>
|
|
561
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
651
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1237">src/dream/Query.ts:1237</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>
|
|
562
652
|
<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>
|
|
563
653
|
</code><button type="button">Copy</button></pre>
|
|
564
654
|
|
|
565
655
|
</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>
|
|
566
656
|
</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>
|
|
567
|
-
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/5133f6fa68e16c878139f35bc0bc97741b1c6e72/src/dream/Query.ts#L1240">src/dream/Query.ts:1240</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/5133f6fa68e16c878139f35bc0bc97741b1c6e72/src/dream/Query.ts#L2014">src/dream/Query.ts:2014</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><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>
|
|
657
|
+
<aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L1264">src/dream/Query.ts:1264</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/1cbf8c49d9ec8b482093031418454a83f02ae0b0/src/dream/Query.ts#L2038">src/dream/Query.ts:2038</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>
|