@rvoh/dream 2.1.4 → 2.2.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 +40 -2
- package/dist/cjs/src/dream/Query.js +132 -42
- package/dist/esm/src/Dream.js +40 -2
- package/dist/esm/src/dream/Query.js +132 -42
- package/dist/types/src/Dream.d.ts +40 -4
- package/dist/types/src/dream/Query.d.ts +45 -4
- package/dist/types/src/types/query.d.ts +2 -2
- package/dist/types/src/types/query.ts +2 -2
- package/docs/assets/search.js +1 -1
- package/docs/classes/db.DreamMigrationHelpers.html +9 -9
- package/docs/classes/db.KyselyQueryDriver.html +32 -32
- package/docs/classes/db.PostgresQueryDriver.html +33 -33
- package/docs/classes/db.QueryDriverBase.html +31 -31
- 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.GlobalNameNotSet.html +3 -3
- package/docs/classes/errors.InvalidCalendarDate.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 +2 -2
- package/docs/classes/index.Decorators.html +19 -19
- package/docs/classes/index.Dream.html +208 -191
- package/docs/classes/index.DreamApp.html +5 -5
- package/docs/classes/index.DreamTransaction.html +2 -2
- package/docs/classes/index.Env.html +2 -2
- package/docs/classes/index.Query.html +87 -70
- package/docs/classes/system.CliFileWriter.html +2 -2
- package/docs/classes/system.DreamBin.html +2 -2
- package/docs/classes/system.DreamCLI.html +5 -5
- package/docs/classes/system.DreamImporter.html +2 -2
- package/docs/classes/system.DreamLogos.html +2 -2
- package/docs/classes/system.DreamSerializerBuilder.html +8 -8
- package/docs/classes/system.ObjectSerializerBuilder.html +8 -8
- package/docs/classes/utils.Encrypt.html +2 -2
- 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-1.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/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.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/modules/db.html +1 -1
- package/docs/modules/errors.html +1 -1
- package/docs/modules/index.html +1 -1
- package/docs/modules/openapi.html +1 -1
- package/docs/modules/system.html +1 -1
- package/docs/modules/types.html +1 -1
- package/docs/modules/utils.html +1 -1
- package/docs/types/index.DateTime.html +1 -1
- package/docs/types/openapi.CommonOpenapiSchemaObjectFields.html +1 -1
- package/docs/types/openapi.OpenapiAllTypes.html +1 -1
- package/docs/types/openapi.OpenapiFormats.html +1 -1
- package/docs/types/openapi.OpenapiNumberFormats.html +1 -1
- package/docs/types/openapi.OpenapiPrimitiveBaseTypes.html +1 -1
- package/docs/types/openapi.OpenapiPrimitiveTypes.html +1 -1
- package/docs/types/openapi.OpenapiSchemaArray.html +1 -1
- package/docs/types/openapi.OpenapiSchemaArrayShorthand.html +1 -1
- package/docs/types/openapi.OpenapiSchemaBase.html +1 -1
- package/docs/types/openapi.OpenapiSchemaBody.html +1 -1
- package/docs/types/openapi.OpenapiSchemaBodyShorthand.html +1 -1
- package/docs/types/openapi.OpenapiSchemaCommonFields.html +1 -1
- package/docs/types/openapi.OpenapiSchemaExpressionAllOf.html +1 -1
- package/docs/types/openapi.OpenapiSchemaExpressionAnyOf.html +1 -1
- package/docs/types/openapi.OpenapiSchemaExpressionOneOf.html +1 -1
- package/docs/types/openapi.OpenapiSchemaExpressionRef.html +1 -1
- package/docs/types/openapi.OpenapiSchemaExpressionRefSchemaShorthand.html +1 -1
- package/docs/types/openapi.OpenapiSchemaInteger.html +1 -1
- package/docs/types/openapi.OpenapiSchemaNull.html +1 -1
- 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 +1 -1
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionAnyOf.html +1 -1
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionOneOf.html +1 -1
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionSerializableRef.html +1 -1
- package/docs/types/openapi.OpenapiSchemaShorthandExpressionSerializerRef.html +1 -1
- 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.Camelized.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 +1 -1
- 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.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 +1 -1
- package/docs/types/types.ViewModelClass.html +1 -1
- package/docs/types/types.WhereStatementForDream.html +1 -1
- package/docs/types/types.WhereStatementForDreamClass.html +1 -1
- package/docs/variables/index.DateTime-1.html +1 -1
- package/docs/variables/index.DreamConst.html +1 -1
- package/docs/variables/index.ops.html +1 -1
- package/docs/variables/openapi.openapiPrimitiveTypes-1.html +1 -1
- package/docs/variables/openapi.openapiShorthandPrimitiveTypes-1.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"><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></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@rvoh/dream</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@rvoh/dream</a></li><li><a href="../modules/index.html">index</a></li><li><a href="index.Query.html">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><a id="DreamInstance" class="tsd-anchor"></a><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><a id="QueryTypeOpts" class="tsd-anchor"></a><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="index.Query.html#constructor.new_Query.DreamInstance-1">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"><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></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@rvoh/dream</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@rvoh/dream</a></li><li><a href="../modules/index.html">index</a></li><li><a href="index.Query.html">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><a id="DreamInstance" class="tsd-anchor"></a><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><a id="QueryTypeOpts" class="tsd-anchor"></a><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="index.Query.html#constructor.new_Query.DreamInstance-1">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/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L79">src/dream/Query.ts:79</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"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> 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="index.Query.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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="index.Query.html#connectionOverride" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>connection<wbr/>Override</span></a>
|
|
3
3
|
<a href="index.Query.html#dreamClass" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dream<wbr/>Class</span></a>
|
|
4
4
|
<a href="index.Query.html#dreamInstance-2" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dream<wbr/>Instance</span></a>
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
<a href="index.Query.html#clone" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>clone</span></a>
|
|
14
14
|
<a href="index.Query.html#connection" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>connection</span></a>
|
|
15
15
|
<a href="index.Query.html#count" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>count</span></a>
|
|
16
|
+
<a href="index.Query.html#cursorPaginate" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>cursor<wbr/>Paginate</span></a>
|
|
16
17
|
<a href="index.Query.html#dbDriverInstance" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>db<wbr/>Driver<wbr/>Instance</span></a>
|
|
17
18
|
<a href="index.Query.html#delete" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>delete</span></a>
|
|
18
19
|
<a href="index.Query.html#destroy" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>destroy</span></a>
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
<a href="index.Query.html#removeAllDefaultScopesExceptOnAssociations" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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>
|
|
48
49
|
<a href="index.Query.html#removeDefaultScope" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Default<wbr/>Scope</span></a>
|
|
49
50
|
<a href="index.Query.html#removeDefaultScopeExceptOnAssociations" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Default<wbr/>Scope<wbr/>Except<wbr/>On<wbr/>Associations</span></a>
|
|
50
|
-
<a href="index.Query.html#scrollPaginate" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>scroll<wbr/>Paginate</span></a>
|
|
51
|
+
<a href="index.Query.html#scrollPaginate" class="tsd-index-link deprecated"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>scroll<wbr/>Paginate</span></a>
|
|
51
52
|
<a href="index.Query.html#sql" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>sql</span></a>
|
|
52
53
|
<a href="index.Query.html#sum" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>sum</span></a>
|
|
53
54
|
<a href="index.Query.html#toKysely" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>to<wbr/>Kysely</span></a>
|
|
@@ -58,16 +59,16 @@
|
|
|
58
59
|
<a href="index.Query.html#whereAny" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where<wbr/>Any</span></a>
|
|
59
60
|
<a href="index.Query.html#whereNot" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where<wbr/>Not</span></a>
|
|
60
61
|
<a href="index.Query.html#dbDriverClass" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>db<wbr/>Driver<wbr/>Class</span></a>
|
|
61
|
-
</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"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_Query" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Query</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">dreamInstance</span>, <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#constructor.new_Query" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="constructor.new_Query.DreamInstance-1" class="tsd-anchor"></a><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><a id="constructor.new_Query.QueryTypeOpts-1" class="tsd-anchor"></a><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><span class="tsd-signature-symbol">{ </span><br/><span> </span><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> </span><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> </span><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> </span><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> </span><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> </span><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> </span><span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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> </span><span class="tsd-signature-symbol">? </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><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> </span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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></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="index.Query.html#constructor.new_Query.DreamInstance-1">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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">keyof </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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="index.Query.html#constructor.new_Query.DreamInstance-1">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="index.Query.html#constructor.new_Query.DreamInstance-1">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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"schema"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"connectionTypeConfig"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"passthroughColumns"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"connectionTypeConfig"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><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></li></ul></div><h4 class="tsd-returns-title">Returns <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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/f0335d7dcc0a1a22e273b2cec30b03976c59c0d5/src/dream/Query.ts#L328">src/dream/Query.ts:328</a></li></ul></aside></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"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member tsd-is-protected"><a id="connectionOverride" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><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"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">connection<wbr/>Override</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../types/types.DbConnectionType.html" class="tsd-signature-type tsd-kind-type-alias">DbConnectionType</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/f0335d7dcc0a1a22e273b2cec30b03976c59c0d5/src/dream/Query.ts#L319">src/dream/Query.ts:319</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-protected"><a id="dreamClass" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><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"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">dream<wbr/>Class</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="index.Query.html#constructor.new_Query.DreamInstance-1">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/f0335d7dcc0a1a22e273b2cec30b03976c59c0d5/src/dream/Query.ts#L317">src/dream/Query.ts:317</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="dreamInstance-2" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>dream<wbr/>Instance</span><a href="#dreamInstance-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">dream<wbr/>Instance</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/f0335d7dcc0a1a22e273b2cec30b03976c59c0d5/src/dream/Query.ts#L318">src/dream/Query.ts:318</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="dreamTransaction" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><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"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">dream<wbr/>Transaction</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</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"> = null</span></div><div class="tsd-comment tsd-typography"><p>stores the dream transaction applied to the
|
|
62
|
+
</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"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Constructors</h2></summary><section><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_Query" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Query</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">dreamInstance</span>, <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#constructor.new_Query" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="constructor.new_Query.DreamInstance-1" class="tsd-anchor"></a><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><a id="constructor.new_Query.QueryTypeOpts-1" class="tsd-anchor"></a><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><span class="tsd-signature-symbol">{ </span><br/><span> </span><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> </span><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> </span><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> </span><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> </span><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> </span><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> </span><span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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> </span><span class="tsd-signature-symbol">? </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><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> </span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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></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="index.Query.html#constructor.new_Query.DreamInstance-1">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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">keyof </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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="index.Query.html#constructor.new_Query.DreamInstance-1">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="index.Query.html#constructor.new_Query.DreamInstance-1">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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"schema"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"connectionTypeConfig"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"passthroughColumns"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"connectionTypeConfig"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><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></li></ul></div><h4 class="tsd-returns-title">Returns <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L328">src/dream/Query.ts:328</a></li></ul></aside></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"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member tsd-is-protected"><a id="connectionOverride" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><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"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">connection<wbr/>Override</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../types/types.DbConnectionType.html" class="tsd-signature-type tsd-kind-type-alias">DbConnectionType</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L319">src/dream/Query.ts:319</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-protected"><a id="dreamClass" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><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"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">dream<wbr/>Class</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="index.Query.html#constructor.new_Query.DreamInstance-1">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/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L317">src/dream/Query.ts:317</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="dreamInstance-2" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>dream<wbr/>Instance</span><a href="#dreamInstance-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">dream<wbr/>Instance</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L318">src/dream/Query.ts:318</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="dreamTransaction" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><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"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">dream<wbr/>Transaction</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">null</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"> = null</span></div><div class="tsd-comment tsd-typography"><p>stores the dream transaction applied to the
|
|
62
63
|
current Query instance</p>
|
|
63
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
64
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
65
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
64
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L107">src/dream/Query.ts:107</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-protected"><a id="innerJoinDreamClasses" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><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"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">inner<wbr/>Join<wbr/>Dream<wbr/>Classes</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>
|
|
65
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L326">src/dream/Query.ts:326</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="queryTypeOpts-2" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Internal</code><span>query<wbr/>Type<wbr/>Opts</span><a href="#queryTypeOpts-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">query<wbr/>Type<wbr/>Opts</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a></div><div class="tsd-comment tsd-typography"><p>purely for typing</p>
|
|
66
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L99">src/dream/Query.ts:99</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="BATCH_SIZES" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><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"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">BATCH_<wbr/>SIZES</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><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> </span><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> </span><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
|
|
66
67
|
provided batching methods</p>
|
|
67
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
68
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L89">src/dream/Query.ts:89</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"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Accessors</h2></summary><section><section class="tsd-panel tsd-member"><a id="connectionName" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>connection<wbr/>Name</span><a href="#connectionName" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature" id="connectionName.connectionName-1"><span class="tsd-signature-keyword">get</span> connectionName<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li><li 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/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1755">src/dream/Query.ts:1755</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="isDreamQuery" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>is<wbr/>Dream<wbr/>Query</span><a href="#isDreamQuery" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature" id="isDreamQuery.isDreamQuery-1"><span class="tsd-signature-keyword">get</span> isDreamQuery<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns true. Useful for distinguishing Query instances
|
|
68
69
|
from other objects.</p>
|
|
69
70
|
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p>true</p>
|
|
70
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
71
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L370">src/dream/Query.ts:370</a></li></ul></aside></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"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="all" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>all</span><a href="#all" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="all.all-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">all</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span><a href="#all.all-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves an array containing all records matching the Query.
|
|
71
72
|
Be careful using this, since it will attempt to pull every
|
|
72
73
|
record into memory at once. When querying might return a large
|
|
73
74
|
number of records, consider using <code>.findEach</code>, which will pull
|
|
@@ -78,30 +79,42 @@ the records in batches.</p>
|
|
|
78
79
|
</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> </span><span class="tsd-kind-property">columns</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="index.Query.html#constructor.new_Query.DreamInstance-1">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="index.Query.html#constructor.new_Query.DreamInstance-1">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="index.Query.html#constructor.new_Query.DreamInstance-1">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><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>
|
|
79
80
|
</div><div class="tsd-comment tsd-typography"></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><span class="tsd-signature-symbol">(</span><span class="tsd-signature-keyword">keyof </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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="index.Query.html#constructor.new_Query.DreamInstance-1">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="index.Query.html#constructor.new_Query.DreamInstance-1">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><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>
|
|
80
81
|
</div><div class="tsd-comment tsd-typography"></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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4><p>an array of dreams</p>
|
|
81
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
82
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1737">src/dream/Query.ts:1737</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="avg" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>avg</span><a href="#avg" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="avg.avg-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">avg</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#avg.avg-1.Q">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#avg.avg-1.DB">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#avg.avg-1.ColumnName">ColumnName</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#avg.avg-1.ReturnType">ReturnType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">columnName</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="index.Query.html#avg.avg-1.ReturnType">ReturnType</a><span class="tsd-signature-symbol">></span><a href="#avg.avg-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the average value of the specified column
|
|
82
83
|
for this Query</p>
|
|
83
84
|
<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>
|
|
84
85
|
</code><button type="button">Copy</button></pre>
|
|
85
86
|
|
|
86
87
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="avg.avg-1.Q" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span><a id="avg.avg-1.DB" class="tsd-anchor"></a><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><a id="avg.avg-1.ColumnName" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">ColumnName</span></span></li><li><span><a id="avg.avg-1.ReturnType" class="tsd-anchor"></a><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="index.Query.html#avg.avg-1.ColumnName">ColumnName</a></span><div class="tsd-comment tsd-typography"><p>a column name on the model</p>
|
|
87
88
|
</div><div class="tsd-comment tsd-typography"></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="index.Query.html#avg.avg-1.ReturnType">ReturnType</a><span class="tsd-signature-symbol">></span></h4><p>the average of the values of the specified column for this Query</p>
|
|
88
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
89
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1590">src/dream/Query.ts:1590</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="clone" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>clone</span><a href="#clone" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="clone.clone-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">clone</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#clone.clone-1.Q-1">Q</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">this</span>, <span class="tsd-kind-parameter">opts</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="index.Query.html#clone.clone-1.Q-1">Q</a><a href="#clone.clone-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><code class="tsd-tag">Internal</code><div class="tsd-comment tsd-typography"><p>Returns a cloned version of the Query</p>
|
|
89
90
|
<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>
|
|
90
91
|
</code><button type="button">Copy</button></pre>
|
|
91
92
|
|
|
92
93
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="clone.clone-1.Q-1" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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="index.Query.html#clone.clone-1.Q-1">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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"schema"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"connectionTypeConfig"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"passthroughColumns"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"connectionTypeConfig"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><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><div class="tsd-comment tsd-typography"><p>Statements to override when cloning the Query</p>
|
|
93
94
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#clone.clone-1.Q-1">Q</a></h4><p>A cloned Query with the provided overrides clause applied</p>
|
|
94
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
95
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L386">src/dream/Query.ts:386</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="connection" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>connection</span><a href="#connection" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="connection.connection-1" class="tsd-anchor"></a><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><span class="tsd-signature-symbol">: </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#connection.connection-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Forces use of a database connection (e.g. 'primary') during the query.</p>
|
|
95
96
|
<p>NOTE: all queries within a transaction always use the 'primary' replica, so
|
|
96
97
|
explicitly setting connection within a transaction has no effect.</p>
|
|
97
98
|
</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>
|
|
98
99
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A Query with the requested connection</p>
|
|
99
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
100
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L2054">src/dream/Query.ts:2054</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="count" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>count</span><a href="#count" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="count.count-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">count</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#count.count-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the number of records matching the Query</p>
|
|
100
101
|
<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>
|
|
101
102
|
</code><button type="button">Copy</button></pre>
|
|
102
103
|
|
|
103
104
|
</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>
|
|
104
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
105
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1451">src/dream/Query.ts:1451</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="cursorPaginate" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>cursor<wbr/>Paginate</span><a href="#cursorPaginate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="cursorPaginate.cursorPaginate-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">cursor<wbr/>Paginate</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#cursorPaginate.cursorPaginate-1.Q-2">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#cursorPaginate.cursorPaginate-1.Incompatible">Incompatible</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">this</span>, <span class="tsd-kind-parameter">opts</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">CursorPaginatedDreamQueryResult</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#cursorPaginate.cursorPaginate-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Paginates the results of your query using cursor-based pagination,
|
|
106
|
+
accepting a pageSize and cursor argument. This method
|
|
107
|
+
provides better performance for large datasets by using cursor-based
|
|
108
|
+
pagination instead of offset-based pagination.</p>
|
|
109
|
+
<p>Default order is descending primary key. If an order has already been
|
|
110
|
+
set on the query, and it includes the primary key (e.g.: <code>id: 'asc'</code>),
|
|
111
|
+
then the implicit primary key ordering will be omitted.</p>
|
|
112
|
+
<pre><code class="ts"><span class="hl-7">// First page (using undefined to start from beginning)</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">firstPage</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">order</span><span class="hl-1">(</span><span class="hl-6">'email'</span><span class="hl-1">).</span><span class="hl-5">cursorPaginate</span><span class="hl-1">({ </span><span class="hl-4">pageSize:</span><span class="hl-1"> </span><span class="hl-8">100</span><span class="hl-1">, </span><span class="hl-4">cursor:</span><span class="hl-1"> </span><span class="hl-0">undefined</span><span class="hl-1"> })</span><br/><span class="hl-4">firstPage</span><span class="hl-1">.</span><span class="hl-4">results</span><br/><span class="hl-7">// [ { User{id: 777}, User{id: 776}, ...}]</span><br/><br/><span class="hl-4">firstPage</span><span class="hl-1">.</span><span class="hl-4">cursor</span><br/><span class="hl-7">// "100" (or null if no more pages)</span><br/><br/><span class="hl-7">// Next page using cursor from previous result</span><br/><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">nextPage</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">User</span><span class="hl-1">.</span><span class="hl-5">order</span><span class="hl-1">(</span><span class="hl-6">'email'</span><span class="hl-1">).</span><span class="hl-5">cursorPaginate</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-4">pageSize:</span><span class="hl-1"> </span><span class="hl-8">100</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">cursor:</span><span class="hl-1"> </span><span class="hl-4">firstPage</span><span class="hl-1">.</span><span class="hl-4">cursor</span><br/><span class="hl-1">})</span>
|
|
113
|
+
</code><button type="button">Copy</button></pre>
|
|
114
|
+
|
|
115
|
+
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="cursorPaginate.cursorPaginate-1.Q-2" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">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><a id="cursorPaginate.cursorPaginate-1.Incompatible" class="tsd-anchor"></a><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="index.Query.html#cursorPaginate.cursorPaginate-1.Q-2">Q</a></span></li><li><span><span class="tsd-kind-parameter">opts</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#cursorPaginate.cursorPaginate-1.Incompatible">Incompatible</a><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">true</span><br/><span> </span><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> </span><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>
|
|
116
|
+
</div><div class="tsd-comment tsd-typography"></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="index.Query.html#constructor.new_Query.DreamInstance-1">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>
|
|
117
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1911">src/dream/Query.ts:1911</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="dbDriverInstance" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>db<wbr/>Driver<wbr/>Instance</span><a href="#dbDriverInstance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="dbDriverInstance.dbDriverInstance-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">db<wbr/>Driver<wbr/>Instance</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">query</span><span class="tsd-signature-symbol">?</span><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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span><a href="#dbDriverInstance.dbDriverInstance-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li 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="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">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="index.Query.html#constructor.new_Query.DreamInstance-1">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/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1750">src/dream/Query.ts:1750</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="delete" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>delete</span><a href="#delete" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="delete.delete-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">delete</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#delete.delete-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Deletes all records matching query using a single
|
|
105
118
|
database query, but does not call underlying callbacks.
|
|
106
119
|
Ignores association dependent destroy declarations,
|
|
107
120
|
though cascading may still happen at the database level.</p>
|
|
@@ -111,7 +124,7 @@ use <a href="index.Query.html#destroy" class="tsd-kind-method">Query.destroy</a>
|
|
|
111
124
|
</code><button type="button">Copy</button></pre>
|
|
112
125
|
|
|
113
126
|
</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>
|
|
114
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
127
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L2331">src/dream/Query.ts:2331</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="destroy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>destroy</span><a href="#destroy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="destroy.destroy-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">destroy</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">__namedParameters</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#destroy.destroy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Destroys all records matching the Query,
|
|
115
128
|
calling model hooks and cascading destroy
|
|
116
129
|
to associations with <code>dependent: 'destroy'</code>,
|
|
117
130
|
and returns the number of records that
|
|
@@ -127,7 +140,7 @@ dependent-destroy declarations, use
|
|
|
127
140
|
</div><div class="tsd-comment tsd-typography"></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 destroying associations marked <code>dependent: 'destroy'</code>. Defaults to true</p>
|
|
128
141
|
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">skip<wbr/>Hooks</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>
|
|
129
142
|
</div><div class="tsd-comment tsd-typography"></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>
|
|
130
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
143
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L2203">src/dream/Query.ts:2203</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="distinct" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>distinct</span><a href="#distinct" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="distinct.distinct-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">distinct</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">column</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#distinct.distinct-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns new Query with distinct clause applied.
|
|
131
144
|
If no column is specified, applies distinct to the primary key.
|
|
132
145
|
Pass true to apply distinct to primary key, false to disable distinct.</p>
|
|
133
146
|
<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>
|
|
@@ -135,19 +148,19 @@ Pass true to apply distinct to primary key, false to disable distinct.</p>
|
|
|
135
148
|
|
|
136
149
|
</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="index.Query.html#constructor.new_Query.DreamInstance-1">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="index.Query.html#constructor.new_Query.DreamInstance-1">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>
|
|
137
150
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A cloned Query with the distinct clause applied</p>
|
|
138
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
151
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1474">src/dream/Query.ts:1474</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="exists" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>exists</span><a href="#exists" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="exists.exists-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">exists</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span><a href="#exists.exists-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns true if a record exists for the given Query, false otherwise.</p>
|
|
139
152
|
<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>
|
|
140
153
|
</code><button type="button">Copy</button></pre>
|
|
141
154
|
|
|
142
155
|
</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>
|
|
143
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
156
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L2081">src/dream/Query.ts:2081</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="find" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>find</span><a href="#find" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="find.find-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">find</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">primaryKey</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">null</span><span class="tsd-signature-symbol"> | </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span><a href="#find.find-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Finds a record matching the Query with the
|
|
144
157
|
specified primary key. Returns null if not found.</p>
|
|
145
158
|
<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>
|
|
146
159
|
</code><button type="button">Copy</button></pre>
|
|
147
160
|
|
|
148
161
|
</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="index.Query.html#constructor.new_Query.DreamInstance-1">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>
|
|
149
162
|
</div><div class="tsd-comment tsd-typography"></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">null</span><span class="tsd-signature-symbol"> | </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span></h4><p>Either the found record, or else null</p>
|
|
150
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
163
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L463">src/dream/Query.ts:463</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="findBy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>find<wbr/>By</span><a href="#findBy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="findBy.findBy-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">find<wbr/>By</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#findBy.findBy-1.DB-1">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#findBy.findBy-1.Schema">Schema</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">whereStatement</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">null</span><span class="tsd-signature-symbol"> | </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span><a href="#findBy.findBy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Finds a record matching the Query and the
|
|
151
164
|
specified where statement. If not found, null
|
|
152
165
|
is returned.</p>
|
|
153
166
|
<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>
|
|
@@ -155,7 +168,7 @@ is returned.</p>
|
|
|
155
168
|
|
|
156
169
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="findBy.findBy-1.DB-1" class="tsd-anchor"></a><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><a id="findBy.findBy-1.Schema" class="tsd-anchor"></a><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>: <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">MergeUnionOfRecordTypes</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Whereable</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#findBy.findBy-1.DB-1">DB</a><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span><br/><span> </span><span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">ColumnName</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-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">NonKyselySupportedSupplementalWhereClauseValues</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#findBy.findBy-1.DB-1">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#findBy.findBy-1.Schema">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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-type tsd-kind-type-parameter">ColumnName</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#findBy.findBy-1.Schema">Schema</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"columns"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type tsd-kind-type-parameter">ColumnName</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"coercedType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#findBy.findBy-1.Schema">Schema</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"columns"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type tsd-kind-type-parameter">ColumnName</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"dbType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type tsd-kind-type-parameter">ColumnName</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"enumArrayType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"enumArrayType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">undefined</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><br/><span> </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><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">null</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><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"enumArrayType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">undefined</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span><br/><span> </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><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"dbType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">"bigint"</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</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><span class="tsd-signature-type">TypesAllowedForBigintAgainstTheDb</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><a href="../types/index.DateTime.html" class="tsd-signature-type tsd-kind-type-alias">DateTime</a><span class="tsd-signature-symbol"> | </span><a href="index.CalendarDate.html" class="tsd-signature-type tsd-kind-class">CalendarDate</a><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../types/index.DateTime.html" class="tsd-signature-type tsd-kind-type-alias">DateTime</a><span class="tsd-signature-symbol"> | </span><a href="index.CalendarDate.html" class="tsd-signature-type tsd-kind-class">CalendarDate</a><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">undefined</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </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-keyword"> extends </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</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><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"enumArrayType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">undefined</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span><br/><span> </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><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"coercedType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><a href="../types/index.DateTime.html" class="tsd-signature-type tsd-kind-type-alias">DateTime</a><br/><span> </span><span class="tsd-signature-symbol">? </span><br/><span> </span><span class="tsd-signature-symbol">| </span><a href="utils.Range.html" class="tsd-signature-type tsd-kind-class">Range</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">| </span><a href="utils.Range.html" class="tsd-signature-type tsd-kind-class">Range</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">></span><br/><span> </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 href="utils.Range.html" class="tsd-signature-type tsd-kind-class">Range</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><br/><span> </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 href="utils.Range.html" class="tsd-signature-type tsd-kind-class">Range</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">OpsStatement</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ComparisonOperatorExpression</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><a href="index.CalendarDate.html" class="tsd-signature-type tsd-kind-class">CalendarDate</a><br/><span> </span><span class="tsd-signature-symbol">? </span><br/><span> </span><span class="tsd-signature-symbol">| </span><a href="utils.Range.html" class="tsd-signature-type tsd-kind-class">Range</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">| </span><a href="utils.Range.html" class="tsd-signature-type tsd-kind-class">Range</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">OpsStatement</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">"bigint"</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">undefined</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </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-keyword"> extends </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">OpsStatement</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ComparisonOperatorExpression</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><br/><span> </span><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><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>The where statement used to locate the record</p>
|
|
157
170
|
</div><div class="tsd-comment tsd-typography"></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">null</span><span class="tsd-signature-symbol"> | </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span></h4><p>Either the first record found matching the attributes, or else null</p>
|
|
158
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
171
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L503">src/dream/Query.ts:503</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="findEach" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>find<wbr/>Each</span><a href="#findEach" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="findEach.findEach-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">find<wbr/>Each</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">this</span>, <span class="tsd-kind-parameter">cb</span>, <span class="tsd-kind-parameter">__namedParameters</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#findEach.findEach-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Finds all records matching the Query in batches,
|
|
159
172
|
and then calls the provided callback for each found record.
|
|
160
173
|
Once all records have been passed for a given batch, the next set of
|
|
161
174
|
records will be fetched and passed to your callback, until all
|
|
@@ -167,7 +180,7 @@ records matching the Query have been fetched.</p>
|
|
|
167
180
|
</div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">instance</span><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></li><li 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">instance</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a></span></li></ul></div><h4 class="tsd-returns-title">Returns <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></h4></li></ul></li></ul></li><li><span><span class="tsd-kind-parameter">__namedParameters</span>: <span class="tsd-signature-symbol">{ </span><br/><span> </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><br/><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>
|
|
168
181
|
</div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">batch<wbr/>Size</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>
|
|
169
182
|
</div><div class="tsd-comment tsd-typography"></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>
|
|
170
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
183
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L550">src/dream/Query.ts:550</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="findOrFail" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>find<wbr/>Or<wbr/>Fail</span><a href="#findOrFail" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="findOrFail.findOrFail-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">find<wbr/>Or<wbr/>Fail</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">primaryKey</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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span><a href="#findOrFail.findOrFail-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Finds a record matching the Query with the
|
|
171
184
|
specified primary key. If not found, an exception
|
|
172
185
|
is raised.</p>
|
|
173
186
|
<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>
|
|
@@ -175,7 +188,7 @@ is raised.</p>
|
|
|
175
188
|
|
|
176
189
|
</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="index.Query.html#constructor.new_Query.DreamInstance-1">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>
|
|
177
190
|
</div><div class="tsd-comment tsd-typography"></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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span></h4><p>The found record</p>
|
|
178
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
191
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L484">src/dream/Query.ts:484</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="findOrFailBy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><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"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="findOrFailBy.findOrFailBy-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">find<wbr/>Or<wbr/>Fail<wbr/>By</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#findOrFailBy.findOrFailBy-1.DB-2">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#findOrFailBy.findOrFailBy-1.Schema-1">Schema</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">whereStatement</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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span><a href="#findOrFailBy.findOrFailBy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Finds a record matching the Query and the
|
|
179
192
|
specified where statement. If not found, an exception
|
|
180
193
|
is raised.</p>
|
|
181
194
|
<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>
|
|
@@ -183,7 +196,7 @@ is raised.</p>
|
|
|
183
196
|
|
|
184
197
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="findOrFailBy.findOrFailBy-1.DB-2" class="tsd-anchor"></a><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><a id="findOrFailBy.findOrFailBy-1.Schema-1" class="tsd-anchor"></a><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>: <span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">MergeUnionOfRecordTypes</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">Whereable</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#findOrFailBy.findOrFailBy-1.DB-2">DB</a><span class="tsd-signature-symbol">[</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Partial</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{</span><br/><span> </span><span class="tsd-signature-symbol">[</span><span class="tsd-kind-type-parameter">ColumnName</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-type">number</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">NonKyselySupportedSupplementalWhereClauseValues</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#findOrFailBy.findOrFailBy-1.DB-2">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#findOrFailBy.findOrFailBy-1.Schema-1">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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-type tsd-kind-type-parameter">ColumnName</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#findOrFailBy.findOrFailBy-1.Schema-1">Schema</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"columns"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type tsd-kind-type-parameter">ColumnName</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"coercedType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#findOrFailBy.findOrFailBy-1.Schema-1">Schema</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"columns"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type tsd-kind-type-parameter">ColumnName</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"dbType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type tsd-kind-type-parameter">ColumnName</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"enumArrayType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"enumArrayType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">undefined</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><br/><span> </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><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">null</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><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"enumArrayType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">undefined</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span><br/><span> </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><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"dbType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">"bigint"</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</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><span class="tsd-signature-type">TypesAllowedForBigintAgainstTheDb</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><a href="../types/index.DateTime.html" class="tsd-signature-type tsd-kind-type-alias">DateTime</a><span class="tsd-signature-symbol"> | </span><a href="index.CalendarDate.html" class="tsd-signature-type tsd-kind-class">CalendarDate</a><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a href="../types/index.DateTime.html" class="tsd-signature-type tsd-kind-type-alias">DateTime</a><span class="tsd-signature-symbol"> | </span><a href="index.CalendarDate.html" class="tsd-signature-type tsd-kind-class">CalendarDate</a><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">undefined</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </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-keyword"> extends </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</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><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"enumArrayType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">undefined</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span><br/><span> </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><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"coercedType"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><a href="../types/index.DateTime.html" class="tsd-signature-type tsd-kind-type-alias">DateTime</a><br/><span> </span><span class="tsd-signature-symbol">? </span><br/><span> </span><span class="tsd-signature-symbol">| </span><a href="utils.Range.html" class="tsd-signature-type tsd-kind-class">Range</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">| </span><a href="utils.Range.html" class="tsd-signature-type tsd-kind-class">Range</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">></span><br/><span> </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 href="utils.Range.html" class="tsd-signature-type tsd-kind-class">Range</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><br/><span> </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 href="utils.Range.html" class="tsd-signature-type tsd-kind-class">Range</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">OpsStatement</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ComparisonOperatorExpression</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><a href="index.CalendarDate.html" class="tsd-signature-type tsd-kind-class">CalendarDate</a><br/><span> </span><span class="tsd-signature-symbol">? </span><br/><span> </span><span class="tsd-signature-symbol">| </span><a href="utils.Range.html" class="tsd-signature-type tsd-kind-class">Range</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">| </span><a href="utils.Range.html" class="tsd-signature-type tsd-kind-class">Range</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">OpsStatement</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">"bigint"</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">undefined</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </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-keyword"> extends </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">OpsStatement</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">ComparisonOperatorExpression</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>...<span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><br/><span> </span><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><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>The where statement used to locate the record</p>
|
|
185
198
|
</div><div class="tsd-comment tsd-typography"></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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span></h4><p>The first record found matching the attributes</p>
|
|
186
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
199
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L522">src/dream/Query.ts:522</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="first" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>first</span><a href="#first" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="first.first-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">first</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span><a href="#first.first-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the first record in the database
|
|
187
200
|
matching the Query. If the Query is not
|
|
188
201
|
ordered, it will automatically order
|
|
189
202
|
by primary key.</p>
|
|
@@ -191,7 +204,7 @@ by primary key.</p>
|
|
|
191
204
|
</code><button type="button">Copy</button></pre>
|
|
192
205
|
|
|
193
206
|
</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">null</span><span class="tsd-signature-symbol"> | </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span></h4><p>First record in the database, or null if no record exists</p>
|
|
194
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
207
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L2104">src/dream/Query.ts:2104</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="firstOrFail" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>first<wbr/>Or<wbr/>Fail</span><a href="#firstOrFail" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="firstOrFail.firstOrFail-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">first<wbr/>Or<wbr/>Fail</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span><a href="#firstOrFail.firstOrFail-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the first record in the database
|
|
195
208
|
matching the Query. If the Query is not
|
|
196
209
|
ordered, it will automatically order
|
|
197
210
|
by primary key. If no record is found,
|
|
@@ -201,14 +214,14 @@ an exception is raised.</p>
|
|
|
201
214
|
|
|
202
215
|
</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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span></h4><p>First record in the database</p>
|
|
203
216
|
<div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Throws" class="tsd-anchor"></a>Throws<a href="#Throws" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>RecordNotFound if no record exists</p>
|
|
204
|
-
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
217
|
+
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L2127">src/dream/Query.ts:2127</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="innerJoin" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>inner<wbr/>Join</span><a href="#innerJoin" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="innerJoin.innerJoin-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">inner<wbr/>Join</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.DB-3">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.Schema-2">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.TableName">TableName</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.Arr">Arr</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.LastArg">LastArg</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.JoinedAssociationsCandidate">JoinedAssociationsCandidate</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.JoinedAssociations">JoinedAssociations</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.RetQuery">RetQuery</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</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="index.Query.html#innerJoin.innerJoin-1.RetQuery">RetQuery</a><a href="#innerJoin.innerJoin-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a new Query instance, with the provided
|
|
205
218
|
joins statement attached</p>
|
|
206
219
|
<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>
|
|
207
220
|
</code><button type="button">Copy</button></pre>
|
|
208
221
|
|
|
209
222
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="innerJoin.innerJoin-1.DB-3" class="tsd-anchor"></a><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><a id="innerJoin.innerJoin-1.Schema-2" class="tsd-anchor"></a><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><a id="innerJoin.innerJoin-1.TableName" class="tsd-anchor"></a><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><a id="innerJoin.innerJoin-1.Arr" class="tsd-anchor"></a><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><a id="innerJoin.innerJoin-1.LastArg" class="tsd-anchor"></a><span class="tsd-signature-keyword">const </span><span class="tsd-kind-type-parameter">LastArg</span></span></li><li><span><a id="innerJoin.innerJoin-1.JoinedAssociationsCandidate" class="tsd-anchor"></a><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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.DB-3">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.Schema-2">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.TableName">TableName</a><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="index.Query.html#innerJoin.innerJoin-1.Arr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.LastArg">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span></span></li><li><span><a id="innerJoin.innerJoin-1.JoinedAssociations" class="tsd-anchor"></a><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="index.Query.html#innerJoin.innerJoin-1.JoinedAssociationsCandidate">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> </span><span class="tsd-signature-symbol">? </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.JoinedAssociationsCandidate">JoinedAssociationsCandidate</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.JoinedAssociationsCandidate">JoinedAssociationsCandidate</a><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span></span></li><li><span><a id="innerJoin.innerJoin-1.RetQuery" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.JoinedAssociations">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> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-keyword">readonly </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.JoinedAssociations">JoinedAssociations</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.JoinedAssociations">JoinedAssociations</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">]</span><br/><span> </span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><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><code class="tsd-tag">Rest</code><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="index.Query.html#innerJoin.innerJoin-1.Arr">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.LastArg">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>
|
|
210
223
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#innerJoin.innerJoin-1.RetQuery">RetQuery</a></h4><p>A cloned Query with the joins clause applied</p>
|
|
211
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
224
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L775">src/dream/Query.ts:775</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="last" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>last</span><a href="#last" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="last.last-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">last</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span><a href="#last.last-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the last record in the database
|
|
212
225
|
matching the Query. If the Query is not
|
|
213
226
|
ordered, it will automatically order
|
|
214
227
|
by primary key.</p>
|
|
@@ -216,7 +229,7 @@ by primary key.</p>
|
|
|
216
229
|
</code><button type="button">Copy</button></pre>
|
|
217
230
|
|
|
218
231
|
</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">null</span><span class="tsd-signature-symbol"> | </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span></h4><p>Last record in the database, or null if no record exists</p>
|
|
219
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
232
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L2149">src/dream/Query.ts:2149</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="lastOrFail" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>last<wbr/>Or<wbr/>Fail</span><a href="#lastOrFail" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="lastOrFail.lastOrFail-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">last<wbr/>Or<wbr/>Fail</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span><a href="#lastOrFail.lastOrFail-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the last record in the database
|
|
220
233
|
matching the Query. If the Query is not
|
|
221
234
|
ordered, it will automatically order
|
|
222
235
|
by primary key. If no record is found,
|
|
@@ -226,9 +239,9 @@ it will raise an exception.</p>
|
|
|
226
239
|
|
|
227
240
|
</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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span></h4><p>Last record in the database</p>
|
|
228
241
|
<div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Throws-1" class="tsd-anchor"></a>Throws<a href="#Throws-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>RecordNotFound if no record exists</p>
|
|
229
|
-
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/f0335d7dcc0a1a22e273b2cec30b03976c59c0d5/src/dream/Query.ts#L2071">src/dream/Query.ts:2071</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="leftJoin" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>left<wbr/>Join</span><a href="#leftJoin" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="leftJoin.leftJoin-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">left<wbr/>Join</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.DB-4">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.Schema-3">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.TableName-1">TableName</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.Arr-1">Arr</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.LastArg-1">LastArg</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.JoinedAssociationsCandidate-1">JoinedAssociationsCandidate</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.JoinedAssociations-1">JoinedAssociations</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.RetQuery-1">RetQuery</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</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="index.Query.html#leftJoin.leftJoin-1.RetQuery-1">RetQuery</a><a href="#leftJoin.leftJoin-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li 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><a id="leftJoin.leftJoin-1.DB-4" class="tsd-anchor"></a><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><a id="leftJoin.leftJoin-1.Schema-3" class="tsd-anchor"></a><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><a id="leftJoin.leftJoin-1.TableName-1" class="tsd-anchor"></a><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><a id="leftJoin.leftJoin-1.Arr-1" class="tsd-anchor"></a><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><a id="leftJoin.leftJoin-1.LastArg-1" class="tsd-anchor"></a><span class="tsd-signature-keyword">const </span><span class="tsd-kind-type-parameter">LastArg</span></span></li><li><span><a id="leftJoin.leftJoin-1.JoinedAssociationsCandidate-1" class="tsd-anchor"></a><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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.DB-4">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.Schema-3">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.TableName-1">TableName</a><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="index.Query.html#leftJoin.leftJoin-1.Arr-1">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.LastArg-1">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span></span></li><li><span><a id="leftJoin.leftJoin-1.JoinedAssociations-1" class="tsd-anchor"></a><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="index.Query.html#leftJoin.leftJoin-1.JoinedAssociationsCandidate-1">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> </span><span class="tsd-signature-symbol">? </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.JoinedAssociationsCandidate-1">JoinedAssociationsCandidate</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.JoinedAssociationsCandidate-1">JoinedAssociationsCandidate</a><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span></span></li><li><span><a id="leftJoin.leftJoin-1.RetQuery-1" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.JoinedAssociations-1">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> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-keyword">readonly </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.JoinedAssociations-1">JoinedAssociations</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.JoinedAssociations-1">JoinedAssociations</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">]</span><br/><span> </span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><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><code class="tsd-tag">Rest</code><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="index.Query.html#leftJoin.leftJoin-1.Arr-1">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.LastArg-1">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>
|
|
242
|
+
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L2173">src/dream/Query.ts:2173</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="leftJoin" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>left<wbr/>Join</span><a href="#leftJoin" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="leftJoin.leftJoin-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">left<wbr/>Join</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.DB-4">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.Schema-3">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.TableName-1">TableName</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.Arr-1">Arr</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.LastArg-1">LastArg</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.JoinedAssociationsCandidate-1">JoinedAssociationsCandidate</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.JoinedAssociations-1">JoinedAssociations</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.RetQuery-1">RetQuery</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</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="index.Query.html#leftJoin.leftJoin-1.RetQuery-1">RetQuery</a><a href="#leftJoin.leftJoin-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li 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><a id="leftJoin.leftJoin-1.DB-4" class="tsd-anchor"></a><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><a id="leftJoin.leftJoin-1.Schema-3" class="tsd-anchor"></a><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><a id="leftJoin.leftJoin-1.TableName-1" class="tsd-anchor"></a><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><a id="leftJoin.leftJoin-1.Arr-1" class="tsd-anchor"></a><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><a id="leftJoin.leftJoin-1.LastArg-1" class="tsd-anchor"></a><span class="tsd-signature-keyword">const </span><span class="tsd-kind-type-parameter">LastArg</span></span></li><li><span><a id="leftJoin.leftJoin-1.JoinedAssociationsCandidate-1" class="tsd-anchor"></a><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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.DB-4">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.Schema-3">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.TableName-1">TableName</a><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="index.Query.html#leftJoin.leftJoin-1.Arr-1">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.LastArg-1">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span></span></li><li><span><a id="leftJoin.leftJoin-1.JoinedAssociations-1" class="tsd-anchor"></a><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="index.Query.html#leftJoin.leftJoin-1.JoinedAssociationsCandidate-1">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> </span><span class="tsd-signature-symbol">? </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.JoinedAssociationsCandidate-1">JoinedAssociationsCandidate</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.JoinedAssociationsCandidate-1">JoinedAssociationsCandidate</a><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span></span></li><li><span><a id="leftJoin.leftJoin-1.RetQuery-1" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.JoinedAssociations-1">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> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-keyword">readonly </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.JoinedAssociations-1">JoinedAssociations</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.JoinedAssociations-1">JoinedAssociations</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">]</span><br/><span> </span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><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><code class="tsd-tag">Rest</code><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="index.Query.html#leftJoin.leftJoin-1.Arr-1">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.LastArg-1">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>
|
|
230
243
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoin.leftJoin-1.RetQuery-1">RetQuery</a></h4><p>A cloned Query with the joins clause applied</p>
|
|
231
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
244
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L829">src/dream/Query.ts:829</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="leftJoinPreload" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>left<wbr/>Join<wbr/>Preload</span><a href="#leftJoinPreload" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="leftJoinPreload.leftJoinPreload-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">left<wbr/>Join<wbr/>Preload</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.Q-3">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.DB-5">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.Schema-4">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.TableName-2">TableName</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.Arr-2">Arr</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.LastArg-2">LastArg</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.Incompatible-1">Incompatible</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.JoinedAssociationsCandidate-2">JoinedAssociationsCandidate</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.JoinedAssociations-2">JoinedAssociations</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.RetQuery-2">RetQuery</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">this</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="index.Query.html#leftJoinPreload.leftJoinPreload-1.RetQuery-2">RetQuery</a><a href="#leftJoinPreload.leftJoinPreload-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Load each specified association using a single SQL query.
|
|
232
245
|
See <a href="index.Query.html#preload" class="tsd-kind-method">Query.preload</a> for preloading in separate queries.</p>
|
|
233
246
|
<p>Note: since leftJoinPreload loads via single query, it has
|
|
234
247
|
some downsides and that may be avoided using <a href="index.Query.html#preload" class="tsd-kind-method">Query.preload</a>:</p>
|
|
@@ -242,40 +255,40 @@ some downsides and that may be avoided using <a href="index.Query.html#preload"
|
|
|
242
255
|
<pre><code class="ts"><span class="hl-0">const</span><span class="hl-1"> </span><span class="hl-2">posts</span><span class="hl-1"> = </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">user</span><span class="hl-1">.</span><span class="hl-5">associationQuery</span><span class="hl-1">(</span><span class="hl-6">'posts'</span><span class="hl-1">).</span><span class="hl-5">leftJoinPreload</span><span class="hl-1">(</span><span class="hl-6">'comments'</span><span class="hl-1">, { </span><span class="hl-4">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">all</span><span class="hl-1">()</span><br/><span class="hl-4">console</span><span class="hl-1">.</span><span class="hl-5">log</span><span class="hl-1">(</span><span class="hl-4">posts</span><span class="hl-1">[</span><span class="hl-8">0</span><span class="hl-1">].</span><span class="hl-4">comments</span><span class="hl-1">[</span><span class="hl-8">0</span><span class="hl-1">].</span><span class="hl-4">replies</span><span class="hl-1">[</span><span class="hl-8">0</span><span class="hl-1">])</span><br/><span class="hl-7">// [Reply{id: 1}, Reply{id: 2}]</span>
|
|
243
256
|
</code><button type="button">Copy</button></pre>
|
|
244
257
|
|
|
245
|
-
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="leftJoinPreload.leftJoinPreload-1.Q-2" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">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><a id="leftJoinPreload.leftJoinPreload-1.DB-5" class="tsd-anchor"></a><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><a id="leftJoinPreload.leftJoinPreload-1.Schema-4" class="tsd-anchor"></a><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><a id="leftJoinPreload.leftJoinPreload-1.TableName-2" class="tsd-anchor"></a><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><a id="leftJoinPreload.leftJoinPreload-1.Arr-2" class="tsd-anchor"></a><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><a id="leftJoinPreload.leftJoinPreload-1.LastArg-2" class="tsd-anchor"></a><span class="tsd-signature-keyword">const </span><span class="tsd-kind-type-parameter">LastArg</span></span></li><li><span><a id="leftJoinPreload.leftJoinPreload-1.Incompatible" class="tsd-anchor"></a><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><a id="leftJoinPreload.leftJoinPreload-1.JoinedAssociationsCandidate-2" class="tsd-anchor"></a><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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.DB-5">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.Schema-4">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.TableName-2">TableName</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.Incompatible">Incompatible</a><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">true</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">]</span><br/><span> </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="index.Query.html#leftJoinPreload.leftJoinPreload-1.Arr-2">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.LastArg-2">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span></span></li><li><span><a id="leftJoinPreload.leftJoinPreload-1.JoinedAssociations-2" class="tsd-anchor"></a><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="index.Query.html#leftJoinPreload.leftJoinPreload-1.JoinedAssociationsCandidate-2">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> </span><span class="tsd-signature-symbol">? </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.JoinedAssociationsCandidate-2">JoinedAssociationsCandidate</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.JoinedAssociationsCandidate-2">JoinedAssociationsCandidate</a><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span></span></li><li><span><a id="leftJoinPreload.leftJoinPreload-1.RetQuery-2" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><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> </span><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> </span><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> </span><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> </span><span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.JoinedAssociations-2">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> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-keyword">readonly </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.JoinedAssociations-2">JoinedAssociations</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.JoinedAssociations-2">JoinedAssociations</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">]</span><br/><span> </span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><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="index.Query.html#leftJoinPreload.leftJoinPreload-1.Q-2">Q</a></span></li><li><span><code class="tsd-tag">Rest</code><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.Incompatible">Incompatible</a><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">true</span><br/><span> </span><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> </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="index.Query.html#leftJoinPreload.leftJoinPreload-1.Arr-2">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.LastArg-2">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>
|
|
258
|
+
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="leftJoinPreload.leftJoinPreload-1.Q-3" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">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><a id="leftJoinPreload.leftJoinPreload-1.DB-5" class="tsd-anchor"></a><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><a id="leftJoinPreload.leftJoinPreload-1.Schema-4" class="tsd-anchor"></a><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><a id="leftJoinPreload.leftJoinPreload-1.TableName-2" class="tsd-anchor"></a><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><a id="leftJoinPreload.leftJoinPreload-1.Arr-2" class="tsd-anchor"></a><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><a id="leftJoinPreload.leftJoinPreload-1.LastArg-2" class="tsd-anchor"></a><span class="tsd-signature-keyword">const </span><span class="tsd-kind-type-parameter">LastArg</span></span></li><li><span><a id="leftJoinPreload.leftJoinPreload-1.Incompatible-1" class="tsd-anchor"></a><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><a id="leftJoinPreload.leftJoinPreload-1.JoinedAssociationsCandidate-2" class="tsd-anchor"></a><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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.DB-5">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.Schema-4">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.TableName-2">TableName</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.Incompatible-1">Incompatible</a><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">true</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-symbol">]</span><br/><span> </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="index.Query.html#leftJoinPreload.leftJoinPreload-1.Arr-2">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.LastArg-2">LastArg</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span></span></li><li><span><a id="leftJoinPreload.leftJoinPreload-1.JoinedAssociations-2" class="tsd-anchor"></a><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="index.Query.html#leftJoinPreload.leftJoinPreload-1.JoinedAssociationsCandidate-2">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> </span><span class="tsd-signature-symbol">? </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.JoinedAssociationsCandidate-2">JoinedAssociationsCandidate</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.JoinedAssociationsCandidate-2">JoinedAssociationsCandidate</a><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">never</span></span></li><li><span><a id="leftJoinPreload.leftJoinPreload-1.RetQuery-2" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">allowLeftJoinPreload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><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> </span><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> </span><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> </span><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> </span><span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.JoinedAssociations-2">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> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-keyword">readonly </span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.JoinedAssociations-2">JoinedAssociations</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.JoinedAssociations-2">JoinedAssociations</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">]</span><br/><span> </span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><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="index.Query.html#leftJoinPreload.leftJoinPreload-1.Q-3">Q</a></span></li><li><span><code class="tsd-tag">Rest</code><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.Incompatible-1">Incompatible</a><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">true</span><br/><span> </span><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> </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="index.Query.html#leftJoinPreload.leftJoinPreload-1.Arr-2">Arr</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.LastArg-2">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>
|
|
246
259
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#leftJoinPreload.leftJoinPreload-1.RetQuery-2">RetQuery</a></h4><p>A cloned Query with the joinLoad statement applied</p>
|
|
247
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
260
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L599">src/dream/Query.ts:599</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="limit" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>limit</span><a href="#limit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="limit.limit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">limit</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#limit.limit-1.Q-4">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#limit.limit-1.Incompatible-2">Incompatible</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#limit.limit-1.RetQuery-3">RetQuery</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">this</span>, <span class="tsd-kind-parameter">limit</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#limit.limit-1.RetQuery-3">RetQuery</a><a href="#limit.limit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a new Query instance, specifying a limit</p>
|
|
248
261
|
<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>
|
|
249
262
|
</code><button type="button">Copy</button></pre>
|
|
250
263
|
|
|
251
|
-
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="limit.limit-1.Q-
|
|
252
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
264
|
+
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="limit.limit-1.Q-4" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">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><a id="limit.limit-1.Incompatible-2" class="tsd-anchor"></a><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><a id="limit.limit-1.RetQuery-3" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{ </span><br/><span> </span><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> </span><span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><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> </span><span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><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="index.Query.html#limit.limit-1.Q-4">Q</a></span></li><li><span><span class="tsd-kind-parameter">limit</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#limit.limit-1.Incompatible-2">Incompatible</a><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">true</span><br/><span> </span><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> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#limit.limit-1.RetQuery-3">RetQuery</a></h4><p>A cloned Query with the limit clause applied</p>
|
|
265
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1305">src/dream/Query.ts:1305</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="max" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>max</span><a href="#max" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="max.max-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">max</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#max.max-1.Q-5">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#max.max-1.DB-6">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#max.max-1.ColumnName-1">ColumnName</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#max.max-1.ReturnType-1">ReturnType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">columnName</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="index.Query.html#max.max-1.ReturnType-1">ReturnType</a><span class="tsd-signature-symbol">></span><a href="#max.max-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the max value of the specified column
|
|
253
266
|
for this Query</p>
|
|
254
267
|
<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>
|
|
255
268
|
</code><button type="button">Copy</button></pre>
|
|
256
269
|
|
|
257
|
-
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="max.max-1.Q-
|
|
270
|
+
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="max.max-1.Q-5" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span><a id="max.max-1.DB-6" class="tsd-anchor"></a><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><a id="max.max-1.ColumnName-1" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">ColumnName</span></span></li><li><span><a id="max.max-1.ReturnType-1" class="tsd-anchor"></a><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="index.Query.html#max.max-1.ColumnName-1">ColumnName</a></span><div class="tsd-comment tsd-typography"><p>a column name on the model</p>
|
|
258
271
|
</div><div class="tsd-comment tsd-typography"></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="index.Query.html#max.max-1.ReturnType-1">ReturnType</a><span class="tsd-signature-symbol">></span></h4><p>the max value of the specified column for this Query</p>
|
|
259
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
272
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1512">src/dream/Query.ts:1512</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="min" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>min</span><a href="#min" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="min.min-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">min</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#min.min-1.Q-6">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#min.min-1.DB-7">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#min.min-1.ColumnName-2">ColumnName</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#min.min-1.ReturnType-2">ReturnType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">columnName</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="index.Query.html#min.min-1.ReturnType-2">ReturnType</a><span class="tsd-signature-symbol">></span><a href="#min.min-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the min value of the specified column
|
|
260
273
|
for this Query</p>
|
|
261
274
|
<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>
|
|
262
275
|
</code><button type="button">Copy</button></pre>
|
|
263
276
|
|
|
264
|
-
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="min.min-1.Q-
|
|
277
|
+
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="min.min-1.Q-6" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span><a id="min.min-1.DB-7" class="tsd-anchor"></a><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><a id="min.min-1.ColumnName-2" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">ColumnName</span></span></li><li><span><a id="min.min-1.ReturnType-2" class="tsd-anchor"></a><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="index.Query.html#min.min-1.ColumnName-2">ColumnName</a></span><div class="tsd-comment tsd-typography"><p>a column name on the model</p>
|
|
265
278
|
</div><div class="tsd-comment tsd-typography"></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="index.Query.html#min.min-1.ReturnType-2">ReturnType</a><span class="tsd-signature-symbol">></span></h4><p>the min value of the specified column for this Query</p>
|
|
266
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
279
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1538">src/dream/Query.ts:1538</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="nestedSelect" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>nested<wbr/>Select</span><a href="#nestedSelect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="nestedSelect.nestedSelect-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">nested<wbr/>Select</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#nestedSelect.nestedSelect-1.SimpleFieldType">SimpleFieldType</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#nestedSelect.nestedSelect-1.PluckThroughFieldType">PluckThroughFieldType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">this</span>, <span class="tsd-kind-parameter">selection</span><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.nestedSelect-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a new Kysely SelectQueryBuilder instance to be used
|
|
267
280
|
in a sub Query</p>
|
|
268
281
|
<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>
|
|
269
282
|
</code><button type="button">Copy</button></pre>
|
|
270
283
|
|
|
271
284
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="nestedSelect.nestedSelect-1.SimpleFieldType" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">SimpleFieldType</span><span class="tsd-signature-keyword"> extends </span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">number</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-keyword">typeof </span><span class="tsd-signature-type">iterator</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"match"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"charAt"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"charCodeAt"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"concat"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"indexOf"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"lastIndexOf"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"localeCompare"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"replace"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"search"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"slice"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"split"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"substring"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"toLowerCase"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"toLocaleLowerCase"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"toUpperCase"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"toLocaleUpperCase"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"trim"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"length"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"substr"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"codePointAt"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"includes"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"endsWith"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"normalize"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"repeat"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"startsWith"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"anchor"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"big"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"blink"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"bold"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"fixed"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"fontcolor"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"fontsize"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"italics"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"link"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"small"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"strike"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"sub"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"sup"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"padStart"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"padEnd"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"trimEnd"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"trimStart"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"trimLeft"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"trimRight"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"matchAll"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"replaceAll"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"at"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"toLocaleString"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"toString"</span><br/><span> </span><span class="tsd-signature-symbol">| </span><span class="tsd-signature-type">"valueOf"</span></span></li><li><span><a id="nestedSelect.nestedSelect-1.PluckThroughFieldType" class="tsd-anchor"></a><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="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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="index.Query.html#nestedSelect.nestedSelect-1.SimpleFieldType">SimpleFieldType</a><span class="tsd-signature-symbol"> | </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#nestedSelect.nestedSelect-1.PluckThroughFieldType">PluckThroughFieldType</a></span><div class="tsd-comment tsd-typography"><p>the column to use for your nested Query</p>
|
|
272
285
|
</div><div class="tsd-comment tsd-typography"></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>
|
|
273
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
286
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1243">src/dream/Query.ts:1243</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="offset" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>offset</span><a href="#offset" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="offset.offset-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">offset</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#offset.offset-1.Q-7">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#offset.offset-1.Incompatible-3">Incompatible</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#offset.offset-1.RetQuery-4">RetQuery</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">this</span>, <span class="tsd-kind-parameter">offset</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#offset.offset-1.RetQuery-4">RetQuery</a><a href="#offset.offset-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a new Query instance, specifying an offset</p>
|
|
274
287
|
<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>
|
|
275
288
|
</code><button type="button">Copy</button></pre>
|
|
276
289
|
|
|
277
|
-
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="offset.offset-1.Q-
|
|
278
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
290
|
+
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="offset.offset-1.Q-7" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">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><a id="offset.offset-1.Incompatible-3" class="tsd-anchor"></a><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><a id="offset.offset-1.RetQuery-4" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{ </span><br/><span> </span><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> </span><span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><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> </span><span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><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="index.Query.html#offset.offset-1.Q-7">Q</a></span></li><li><span><span class="tsd-kind-parameter">offset</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#offset.offset-1.Incompatible-3">Incompatible</a><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">true</span><br/><span> </span><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> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#offset.offset-1.RetQuery-4">RetQuery</a></h4><p>A cloned Query with the offset clause applied</p>
|
|
291
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1337">src/dream/Query.ts:1337</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="order" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>order</span><a href="#order" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="order.order-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">order</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#order.order-1.Q-8">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#order.order-1.DB-8">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#order.order-1.ColumnName-3">ColumnName</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">arg</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#order.order-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a new Query instance, attaching the provided
|
|
279
292
|
order statement</p>
|
|
280
293
|
<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>
|
|
281
294
|
</code><button type="button">Copy</button></pre>
|
|
@@ -283,24 +296,24 @@ order statement</p>
|
|
|
283
296
|
<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-4">name:</span><span class="hl-1"> </span><span class="hl-6">'asc'</span><span class="hl-1">, </span><span class="hl-4">id:</span><span class="hl-1"> </span><span class="hl-6">'desc'</span><span class="hl-1"> }).</span><span class="hl-5">all</span><span class="hl-1">()</span><br/><span class="hl-7">// [User{name: 'a', id: 99}, User{name: 'a', id: 97}, User{ name: 'b', id: 98 } ...]</span>
|
|
284
297
|
</code><button type="button">Copy</button></pre>
|
|
285
298
|
|
|
286
|
-
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="order.order-1.Q-
|
|
299
|
+
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="order.order-1.Q-8" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span><a id="order.order-1.DB-8" class="tsd-anchor"></a><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><a id="order.order-1.ColumnName-3" class="tsd-anchor"></a><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>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#order.order-1.ColumnName-3">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="index.Query.html#order.order-1.ColumnName-3">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><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>
|
|
287
300
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A cloned Query with the order clause applied</p>
|
|
288
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
301
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1268">src/dream/Query.ts:1268</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="paginate" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>paginate</span><a href="#paginate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="paginate.paginate-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">paginate</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#paginate.paginate-1.Q-9">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#paginate.paginate-1.Incompatible-4">Incompatible</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">this</span>, <span class="tsd-kind-parameter">opts</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">PaginatedDreamQueryResult</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#paginate.paginate-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Paginates the results of your query, accepting a pageSize and page argument,
|
|
289
302
|
which it uses to segment your query into pages, leveraging limit and offset
|
|
290
303
|
to deliver your query to you in pages.</p>
|
|
291
304
|
<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>
|
|
292
305
|
</code><button type="button">Copy</button></pre>
|
|
293
306
|
|
|
294
|
-
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="paginate.paginate-1.Q-
|
|
307
|
+
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="paginate.paginate-1.Q-9" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">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><a id="paginate.paginate-1.Incompatible-4" class="tsd-anchor"></a><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="index.Query.html#paginate.paginate-1.Q-9">Q</a></span></li><li><span><span class="tsd-kind-parameter">opts</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#paginate.paginate-1.Incompatible-4">Incompatible</a><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">true</span><br/><span> </span><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> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">PaginatedDreamQueryOptions</span></span><div class="tsd-comment tsd-typography"><p>Pagination options</p>
|
|
295
308
|
</div><div class="tsd-comment tsd-typography"></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="index.Query.html#constructor.new_Query.DreamInstance-1">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>
|
|
296
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
309
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1787">src/dream/Query.ts:1787</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="passthrough" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>passthrough</span><a href="#passthrough" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="passthrough.passthrough-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">passthrough</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">passthroughOnStatement</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#passthrough.passthrough-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sends data through for use as passthrough data
|
|
297
310
|
for the associations that require it.</p>
|
|
298
311
|
<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>
|
|
299
312
|
</code><button type="button">Copy</button></pre>
|
|
300
313
|
|
|
301
314
|
</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">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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"connectionTypeConfig"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"passthroughColumns"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"connectionTypeConfig"</span><span class="tsd-signature-symbol"> & </span><span class="tsd-signature-keyword">keyof </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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">number</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>where statement used for associations that require passthrough data</p>
|
|
302
315
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A cloned Query with the passthrough data</p>
|
|
303
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
316
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1138">src/dream/Query.ts:1138</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="pluck" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>pluck</span><a href="#pluck" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="pluck.pluck-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">pluck</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluck.pluck-1.Q-10">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluck.pluck-1.DB-9">DB</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluck.pluck-1.ColumnNames">ColumnNames</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluck.pluck-1.ReturnValue">ReturnValue</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">this</span>, <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">columnNames</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="index.Query.html#pluck.pluck-1.ReturnValue">ReturnValue</a><span class="tsd-signature-symbol">></span><a href="#pluck.pluck-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Plucks the provided fields from the given dream class table</p>
|
|
304
317
|
<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>
|
|
305
318
|
</code><button type="button">Copy</button></pre>
|
|
306
319
|
|
|
@@ -309,24 +322,24 @@ array is returned:</p>
|
|
|
309
322
|
<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><span class="hl-6">'email'</span><span class="hl-1">)</span><br/><span class="hl-7">// [[1, 'a@a.com'], [2, 'b@b.com']]</span>
|
|
310
323
|
</code><button type="button">Copy</button></pre>
|
|
311
324
|
|
|
312
|
-
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="pluck.pluck-1.Q-
|
|
325
|
+
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="pluck.pluck-1.Q-10" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span><a id="pluck.pluck-1.DB-9" class="tsd-anchor"></a><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><a id="pluck.pluck-1.ColumnNames" class="tsd-anchor"></a><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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluck.pluck-1.Q-10">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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluck.pluck-1.DB-9">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><span class="tsd-signature-symbol">[]</span></span></li><li><span><a id="pluck.pluck-1.ReturnValue" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">ReturnValue</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">NamespacedOrBaseModelColumnTypes</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluck.pluck-1.ColumnNames">ColumnNames</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluck.pluck-1.Q-10">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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><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="index.Query.html#pluck.pluck-1.ColumnNames">ColumnNames</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluck.pluck-1.Q-10">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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="index.Query.html#pluck.pluck-1.Q-10">Q</a></span></li><li><span><code class="tsd-tag">Rest</code><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">columnNames</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluck.pluck-1.ColumnNames">ColumnNames</a></span><div class="tsd-comment tsd-typography"><p>The column or array of columns to pluck</p>
|
|
313
326
|
</div><div class="tsd-comment tsd-typography"></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="index.Query.html#pluck.pluck-1.ReturnValue">ReturnValue</a><span class="tsd-signature-symbol">></span></h4><p>An array of pluck results</p>
|
|
314
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
327
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1623">src/dream/Query.ts:1623</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="pluckEach" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>pluck<wbr/>Each</span><a href="#pluckEach" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="pluckEach.pluckEach-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">pluck<wbr/>Each</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluckEach.pluckEach-1.Q-11">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluckEach.pluckEach-1.DB-10">DB</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluckEach.pluckEach-1.ColumnNames-1">ColumnNames</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluckEach.pluckEach-1.CbArgTypes">CbArgTypes</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">this</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><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.pluckEach-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Plucks the specified column names from the given dream class table
|
|
315
328
|
in batches, passing each found columns into the
|
|
316
329
|
provided callback function</p>
|
|
317
330
|
<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>
|
|
318
331
|
</code><button type="button">Copy</button></pre>
|
|
319
332
|
|
|
320
|
-
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="pluckEach.pluckEach-1.Q-
|
|
333
|
+
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="pluckEach.pluckEach-1.Q-11" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span><a id="pluckEach.pluckEach-1.DB-10" class="tsd-anchor"></a><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><a id="pluckEach.pluckEach-1.ColumnNames-1" class="tsd-anchor"></a><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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluckEach.pluckEach-1.Q-11">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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluckEach.pluckEach-1.DB-10">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><span class="tsd-signature-symbol">[]</span></span></li><li><span><a id="pluckEach.pluckEach-1.CbArgTypes" class="tsd-anchor"></a><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="index.Query.html#pluckEach.pluckEach-1.Q-11">Q</a></span></li><li><span><code class="tsd-tag">Rest</code><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="index.Query.html#pluckEach.pluckEach-1.ColumnNames-1">ColumnNames</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#pluckEach.pluckEach-1.CbArgTypes">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>
|
|
321
334
|
</div><div class="tsd-comment tsd-typography"></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>
|
|
322
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
335
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1658">src/dream/Query.ts:1658</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="preload" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>preload</span><a href="#preload" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="preload.preload-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">preload</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preload.preload-1.Q-12">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preload.preload-1.DB-11">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preload.preload-1.Schema-5">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preload.preload-1.TableName-3">TableName</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-keyword">const </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preload.preload-1.Arr-3">Arr</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preload.preload-1.Incompatible-5">Incompatible</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preload.preload-1.RetQuery-5">RetQuery</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">this</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="index.Query.html#preload.preload-1.RetQuery-5">RetQuery</a><a href="#preload.preload-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Load each specified association using a separate SQL query.
|
|
323
336
|
See <a href="index.Query.html#leftJoinPreload" class="tsd-kind-method">Query.leftJoinPreload</a> for preloading in a single query.</p>
|
|
324
337
|
<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>
|
|
325
338
|
</code><button type="button">Copy</button></pre>
|
|
326
339
|
|
|
327
|
-
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="preload.preload-1.Q-
|
|
340
|
+
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="preload.preload-1.Q-12" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">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><a id="preload.preload-1.DB-11" class="tsd-anchor"></a><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><a id="preload.preload-1.Schema-5" class="tsd-anchor"></a><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><a id="preload.preload-1.TableName-3" class="tsd-anchor"></a><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><a id="preload.preload-1.Arr-3" class="tsd-anchor"></a><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><a id="preload.preload-1.Incompatible-5" class="tsd-anchor"></a><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><a id="preload.preload-1.RetQuery-5" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{ </span><br/><span> </span><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> </span><span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><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="index.Query.html#preload.preload-1.Q-12">Q</a></span></li><li><span><code class="tsd-tag">Rest</code><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preload.preload-1.Incompatible-5">Incompatible</a><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">true</span><br/><span> </span><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> </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="index.Query.html#preload.preload-1.Arr-3">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="index.Query.html#preload.preload-1.DB-11">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preload.preload-1.Schema-5">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preload.preload-1.TableName-3">TableName</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preload.preload-1.Arr-3">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>
|
|
328
341
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preload.preload-1.RetQuery-5">RetQuery</a></h4><p>A cloned Query with the preload statement applied</p>
|
|
329
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
342
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L661">src/dream/Query.ts:661</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="preloadFor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>preload<wbr/>For</span><a href="#preloadFor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="preloadFor.preloadFor-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">preload<wbr/>For</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preloadFor.preloadFor-1.Q-13">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preloadFor.preloadFor-1.SerializerKey">SerializerKey</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preloadFor.preloadFor-1.RetQuery-6">RetQuery</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">this</span>, <span class="tsd-kind-parameter">serializerKey</span>, <span class="tsd-kind-parameter">modifierFn</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="index.Query.html#preloadFor.preloadFor-1.RetQuery-6">RetQuery</a><a href="#preloadFor.preloadFor-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Recursively preloads all Dream associations referenced by <code>rendersOne</code> and <code>rendersMany</code>
|
|
330
343
|
in a DreamSerializer. This traverses the entire content tree of serializers to automatically
|
|
331
344
|
load all necessary associations, eliminating N+1 query problems and removing the need to
|
|
332
345
|
manually remember which associations to preload for serialization.</p>
|
|
@@ -340,10 +353,10 @@ automatically preloads all associations that will be needed during serialization
|
|
|
340
353
|
<pre><code class="ts"><span class="hl-7">// Instead of manually specifying all associations:</span><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">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-6">'replies'</span><span class="hl-1">).</span><span class="hl-5">all</span><span class="hl-1">()</span><br/><br/><span class="hl-7">// Automatically preload everything needed for serialization:</span><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">preloadFor</span><span class="hl-1">(</span><span class="hl-6">'summary'</span><span class="hl-1">).</span><span class="hl-5">all</span><span class="hl-1">()</span><br/><br/><span class="hl-7">// Add where conditions to specific associations during preloading:</span><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">preloadFor</span><span class="hl-1">(</span><span class="hl-6">'detailed'</span><span class="hl-1">, (</span><span class="hl-4">associationName</span><span class="hl-1">, </span><span class="hl-4">dreamClass</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">if</span><span class="hl-1"> (</span><span class="hl-4">dreamClass</span><span class="hl-1">.</span><span class="hl-5">typeof</span><span class="hl-1">(</span><span class="hl-4">Post</span><span class="hl-1">) && </span><span class="hl-4">associationName</span><span class="hl-1"> === </span><span class="hl-6">'comments'</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">return</span><span class="hl-1"> { </span><span class="hl-4">and:</span><span class="hl-1"> { </span><span class="hl-4">published:</span><span class="hl-1"> </span><span class="hl-0">true</span><span class="hl-1"> } }</span><br/><span class="hl-1"> }</span><br/><span class="hl-1">})</span><br/><span class="hl-1"> .</span><span class="hl-5">all</span><span class="hl-1">()</span><br/><br/><span class="hl-7">// Skip preloading specific associations to handle them manually:</span><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">preloadFor</span><span class="hl-1">(</span><span class="hl-6">'summary'</span><span class="hl-1">, (</span><span class="hl-4">associationName</span><span class="hl-1">, </span><span class="hl-4">dreamClass</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">if</span><span class="hl-1"> (</span><span class="hl-4">dreamClass</span><span class="hl-1">.</span><span class="hl-5">typeof</span><span class="hl-1">(</span><span class="hl-4">User</span><span class="hl-1">) && </span><span class="hl-4">associationName</span><span class="hl-1"> === </span><span class="hl-6">'posts'</span><span class="hl-1">) {</span><br/><span class="hl-1"> </span><span class="hl-3">return</span><span class="hl-1"> </span><span class="hl-6">'omit'</span><span class="hl-1"> </span><span class="hl-7">// Handle posts preloading separately with custom logic</span><br/><span class="hl-1"> }</span><br/><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-4">and:</span><span class="hl-1"> { </span><span class="hl-4">featured:</span><span class="hl-1"> </span><span class="hl-0">true</span><span class="hl-1"> } }) </span><span class="hl-7">// Custom preloading</span><br/><span class="hl-1"> .</span><span class="hl-5">all</span><span class="hl-1">()</span>
|
|
341
354
|
</code><button type="button">Copy</button></pre>
|
|
342
355
|
|
|
343
|
-
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="preloadFor.preloadFor-1.Q-
|
|
356
|
+
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="preloadFor.preloadFor-1.Q-13" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">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><a id="preloadFor.preloadFor-1.SerializerKey" class="tsd-anchor"></a><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><a id="preloadFor.preloadFor-1.RetQuery-6" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">RetQuery</span> = <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Readonly</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-symbol">{ </span><br/><span> </span><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> </span><span class="tsd-kind-property">allowLimit</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowOffset</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowPaginate</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">allowPreload</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">joinedAssociations</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableAlias</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-kind-property">rootTableName</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><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="index.Query.html#preloadFor.preloadFor-1.Q-13">Q</a></span></li><li><span><span class="tsd-kind-parameter">serializerKey</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preloadFor.preloadFor-1.SerializerKey">SerializerKey</a></span><div class="tsd-comment tsd-typography"><p>The serializer key to use for determining which associations to preload.</p>
|
|
344
357
|
</div><div class="tsd-comment tsd-typography"></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>
|
|
345
358
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#preloadFor.preloadFor-1.RetQuery-6">RetQuery</a></h4><p>A Query with all serialization associations preloaded</p>
|
|
346
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
359
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L735">src/dream/Query.ts:735</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="reallyDestroy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>really<wbr/>Destroy</span><a href="#reallyDestroy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="reallyDestroy.reallyDestroy-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">really<wbr/>Destroy</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">__namedParameters</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#reallyDestroy.reallyDestroy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Destroys all records matching the Query,
|
|
347
360
|
ignoring the SoftDelete decorator and
|
|
348
361
|
permanently removing records from the database.</p>
|
|
349
362
|
<p>Calls model hooks and applies cascade destroy
|
|
@@ -359,53 +372,57 @@ decorator, use <a href="index.Query.html#destroy" class="tsd-kind-method">Query.
|
|
|
359
372
|
</div><div class="tsd-comment tsd-typography"></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 destroying associations marked <code>dependent: 'destroy'</code>. Defaults to true</p>
|
|
360
373
|
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">skip<wbr/>Hooks</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>
|
|
361
374
|
</div><div class="tsd-comment tsd-typography"></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>
|
|
362
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
375
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L2260">src/dream/Query.ts:2260</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="removeAllDefaultScopes" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><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"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="removeAllDefaultScopes.removeAllDefaultScopes-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>All<wbr/>Default<wbr/>Scopes</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#removeAllDefaultScopes.removeAllDefaultScopes-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Prevents default scopes from applying when
|
|
363
376
|
the Query is executed</p>
|
|
364
377
|
</div><h4 class="tsd-returns-title">Returns <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A new Query which will prevent default scopes from applying</p>
|
|
365
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
378
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1062">src/dream/Query.ts:1062</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected"><a id="removeAllDefaultScopesExceptOnAssociations" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><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"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-protected"><li class="tsd-signature tsd-anchor-link"><a id="removeAllDefaultScopesExceptOnAssociations.removeAllDefaultScopesExceptOnAssociations-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>All<wbr/>Default<wbr/>Scopes<wbr/>Except<wbr/>On<wbr/>Associations</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#removeAllDefaultScopesExceptOnAssociations.removeAllDefaultScopesExceptOnAssociations-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Prevents default scopes from applying when
|
|
366
379
|
the Query is executed, but not when applying to associations</p>
|
|
367
380
|
</div><h4 class="tsd-returns-title">Returns <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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>
|
|
368
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
381
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1075">src/dream/Query.ts:1075</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="removeDefaultScope" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>remove<wbr/>Default<wbr/>Scope</span><a href="#removeDefaultScope" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="removeDefaultScope.removeDefaultScope-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>Default<wbr/>Scope</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">scopeName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#removeDefaultScope.removeDefaultScope-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Prevents a specific default scope from applying when
|
|
369
382
|
the Query is executed</p>
|
|
370
383
|
</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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A new Query which will prevent a specific default scope from applying</p>
|
|
371
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
384
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1088">src/dream/Query.ts:1088</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected"><a id="removeDefaultScopeExceptOnAssociations" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><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"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-protected"><li class="tsd-signature tsd-anchor-link"><a id="removeDefaultScopeExceptOnAssociations.removeDefaultScopeExceptOnAssociations-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>Default<wbr/>Scope<wbr/>Except<wbr/>On<wbr/>Associations</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">scopeName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#removeDefaultScopeExceptOnAssociations.removeDefaultScopeExceptOnAssociations-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Prevents a specific default scope from applying when
|
|
372
385
|
the Query is executed, but not when applying to asociations</p>
|
|
373
386
|
</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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span></span></li></ul></div><h4 class="tsd-returns-title">Returns <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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>
|
|
374
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
387
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1103">src/dream/Query.ts:1103</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="scrollPaginate" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span class="deprecated">scroll<wbr/>Paginate</span><a href="#scrollPaginate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="scrollPaginate.scrollPaginate-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">scroll<wbr/>Paginate</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#scrollPaginate.scrollPaginate-1.Q-14">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#scrollPaginate.scrollPaginate-1.Incompatible-6">Incompatible</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">this</span>, <span class="tsd-kind-parameter">opts</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">CursorPaginatedDreamQueryResult</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span><a href="#scrollPaginate.scrollPaginate-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="scrollPaginate.scrollPaginate-1.Q-14" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">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><a id="scrollPaginate.scrollPaginate-1.Incompatible-6" class="tsd-anchor"></a><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="index.Query.html#scrollPaginate.scrollPaginate-1.Q-14">Q</a></span></li><li><span><span class="tsd-kind-parameter">opts</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#scrollPaginate.scrollPaginate-1.Incompatible-6">Incompatible</a><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">true</span><br/><span> </span><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> </span><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>
|
|
388
|
+
</div><div class="tsd-comment tsd-typography"></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="index.Query.html#constructor.new_Query.DreamInstance-1">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>
|
|
389
|
+
<div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Deprecated" class="tsd-anchor"></a>Deprecated<a href="#Deprecated" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Use <a href="index.Query.html#cursorPaginate" class="tsd-kind-method">cursorPaginate</a> instead.</p>
|
|
390
|
+
<p>Paginates the results of your query using cursor-based pagination,
|
|
375
391
|
accepting a pageSize and cursor argument. This method
|
|
376
392
|
provides better performance for large datasets by using cursor-based
|
|
377
393
|
pagination instead of offset-based pagination.</p>
|
|
394
|
+
<p>Default order is ascending primary key. If an order has already been
|
|
395
|
+
set on the query, and it includes the primary key (e.g.: <code>id: 'asc'</code>),
|
|
396
|
+
then the implicit primary key ordering will be omitted.</p>
|
|
378
397
|
<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>
|
|
379
398
|
</code><button type="button">Copy</button></pre>
|
|
380
399
|
|
|
381
|
-
</div><
|
|
382
|
-
</div><div class="tsd-comment tsd-typography"></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">ScrollPaginatedDreamQueryResult</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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>
|
|
383
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/f0335d7dcc0a1a22e273b2cec30b03976c59c0d5/src/dream/Query.ts#L1851">src/dream/Query.ts:1851</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="sql" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>sql</span><a href="#sql" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="sql.sql-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">sql</span><span class="tsd-signature-symbol">(</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.sql-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the sql that would be executed by this Query</p>
|
|
400
|
+
</div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1857">src/dream/Query.ts:1857</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="sql" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>sql</span><a href="#sql" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="sql.sql-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">sql</span><span class="tsd-signature-symbol">(</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.sql-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the sql that would be executed by this Query</p>
|
|
384
401
|
<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>
|
|
385
402
|
</code><button type="button">Copy</button></pre>
|
|
386
403
|
|
|
387
404
|
</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>
|
|
388
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
405
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1391">src/dream/Query.ts:1391</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="sum" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>sum</span><a href="#sum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="sum.sum-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">sum</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#sum.sum-1.Q-15">Q</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#sum.sum-1.DB-12">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#sum.sum-1.ColumnName-4">ColumnName</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#sum.sum-1.ReturnType-3">ReturnType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">columnName</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="index.Query.html#sum.sum-1.ReturnType-3">ReturnType</a><span class="tsd-signature-symbol">></span><a href="#sum.sum-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Retrieves the sum value of the specified column
|
|
389
406
|
for this Query</p>
|
|
390
407
|
<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>
|
|
391
408
|
</code><button type="button">Copy</button></pre>
|
|
392
409
|
|
|
393
|
-
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="sum.sum-1.Q-
|
|
410
|
+
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="sum.sum-1.Q-15" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Q</span><span class="tsd-signature-keyword"> extends </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></span></li><li><span><a id="sum.sum-1.DB-12" class="tsd-anchor"></a><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><a id="sum.sum-1.ColumnName-4" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">ColumnName</span></span></li><li><span><a id="sum.sum-1.ReturnType-3" class="tsd-anchor"></a><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="index.Query.html#sum.sum-1.ColumnName-4">ColumnName</a></span><div class="tsd-comment tsd-typography"><p>a column name on the model</p>
|
|
394
411
|
</div><div class="tsd-comment tsd-typography"></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="index.Query.html#sum.sum-1.ReturnType-3">ReturnType</a><span class="tsd-signature-symbol">></span></h4><p>the sum of the values of the specified column for this Query</p>
|
|
395
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
412
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1564">src/dream/Query.ts:1564</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="toKysely" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>to<wbr/>Kysely</span><a href="#toKysely" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="toKysely.toKysely-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">to<wbr/>Kysely</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#toKysely.toKysely-1.QueryType">QueryType</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#toKysely.toKysely-1.DbType">DbType</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#toKysely.toKysely-1.TableNames">TableNames</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#toKysely.toKysely-1.ToKyselyReturnType">ToKyselyReturnType</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">type</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#toKysely.toKysely-1.ToKyselyReturnType">ToKyselyReturnType</a><a href="#toKysely.toKysely-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Converts the given dream class into a Kysely query, enabling
|
|
396
413
|
you to build custom queries using the Kysely API</p>
|
|
397
414
|
<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>
|
|
398
415
|
</code><button type="button">Copy</button></pre>
|
|
399
416
|
|
|
400
417
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="toKysely.toKysely-1.QueryType" class="tsd-anchor"></a><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">"select"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"delete"</span></span></li><li><span><a id="toKysely.toKysely-1.DbType" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">DbType</span> = <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">false</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">true</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">{</span><br/><span> </span><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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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-symbol">{ </span><br/><span> </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><br/><span> </span><span class="tsd-signature-symbol">}</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><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">}</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">null</span><br/><span> </span><span class="tsd-signature-symbol">? </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"DB"</span><span class="tsd-signature-symbol">]</span><br/><span> </span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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-symbol">(</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">false</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">true</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-symbol">{</span><br/><span> </span><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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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-symbol">{ </span><br/><span> </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><br/><span> </span><span class="tsd-signature-symbol">}</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><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">}</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">)</span></span></li><li><span><a id="toKysely.toKysely-1.TableNames" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">TableNames</span> = <span class="tsd-signature-symbol">(</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">false</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">true</span><br/><span> </span><span class="tsd-signature-symbol">? </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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><span class="tsd-signature-symbol">(</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">false</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">true</span><br/><span> </span><span class="tsd-signature-symbol">? </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</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="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">false</span><br/><span> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">true</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">true</span><br/><span> </span><span class="tsd-signature-symbol">? </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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> </span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol">)</span><br/><span> </span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.DreamInstance-1">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><a id="toKysely.toKysely-1.ToKyselyReturnType" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">ToKyselyReturnType</span> = <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#toKysely.toKysely-1.QueryType">QueryType</a><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">"select"</span><br/><span> </span><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="index.Query.html#toKysely.toKysely-1.DbType">DbType</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#toKysely.toKysely-1.TableNames">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="index.Query.html#toKysely.toKysely-1.DbType">DbType</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#toKysely.toKysely-1.QueryType">QueryType</a><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">"delete"</span><br/><span> </span><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="index.Query.html#toKysely.toKysely-1.DbType">DbType</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#toKysely.toKysely-1.TableNames">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="index.Query.html#toKysely.toKysely-1.DbType">DbType</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span><br/><span> </span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#toKysely.toKysely-1.QueryType">QueryType</a><span class="tsd-signature-keyword"> extends </span><span class="tsd-signature-type">"update"</span><br/><span> </span><span class="tsd-signature-symbol">? </span><span class="tsd-signature-type">UpdateQueryBuilder</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#toKysely.toKysely-1.DbType">DbType</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#toKysely.toKysely-1.TableNames">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="index.Query.html#toKysely.toKysely-1.DbType">DbType</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#toKysely.toKysely-1.TableNames">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="index.Query.html#toKysely.toKysely-1.DbType">DbType</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">></span><br/><span> </span><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="index.Query.html#toKysely.toKysely-1.QueryType">QueryType</a></span><div class="tsd-comment tsd-typography"><p>the type of Kysely query builder instance you would like to obtain</p>
|
|
401
418
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#toKysely.toKysely-1.ToKyselyReturnType">ToKyselyReturnType</a></h4><p>A Kysely query. Depending on the type passed, it will return either a SelectQueryBuilder, DeleteQueryBuilder, or an UpdateQueryBuilder</p>
|
|
402
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
419
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1406">src/dream/Query.ts:1406</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="txn" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>txn</span><a href="#txn" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="txn.txn-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">txn</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">dreamTransaction</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#txn.txn-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Applies transaction to the Query instance</p>
|
|
403
420
|
<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>
|
|
404
421
|
</code><button type="button">Copy</button></pre>
|
|
405
422
|
|
|
406
423
|
</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>: <span class="tsd-signature-type">null</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><div class="tsd-comment tsd-typography"><p>A DreamTransaction instance (usually collected by calling <code>ApplicationModel.transaction</code>)</p>
|
|
407
424
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A cloned Query with the transaction applied</p>
|
|
408
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
425
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1434">src/dream/Query.ts:1434</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="undestroy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>undestroy</span><a href="#undestroy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="undestroy.undestroy-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">undestroy</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">__namedParameters</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#undestroy.undestroy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Undestroys a SoftDelete model, unsetting
|
|
409
426
|
the <code>deletedAt</code> field in the database.</p>
|
|
410
427
|
<p>If the model is not a SoftDelete model,
|
|
411
428
|
this will raise an exception.</p>
|
|
@@ -416,7 +433,7 @@ this will raise an exception.</p>
|
|
|
416
433
|
</div><div class="tsd-comment tsd-typography"></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>
|
|
417
434
|
</div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">skip<wbr/>Hooks</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>
|
|
418
435
|
</div><div class="tsd-comment tsd-typography"></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>
|
|
419
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
436
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L2286">src/dream/Query.ts:2286</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="update" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>update</span><a href="#update" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="update.update-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">update</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">attributes</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span><a href="#update.update-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Updates all records matching the Query</p>
|
|
420
437
|
<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">updateAll</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>
|
|
421
438
|
</code><button type="button">Copy</button></pre>
|
|
422
439
|
|
|
@@ -424,23 +441,23 @@ this will raise an exception.</p>
|
|
|
424
441
|
</div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-symbol">{ </span><br/><span> </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><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = {}</span></span><div class="tsd-comment tsd-typography"><p>Options for updating the instance</p>
|
|
425
442
|
</div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">skip<wbr/>Hooks</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>
|
|
426
443
|
</div><div class="tsd-comment tsd-typography"></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>
|
|
427
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
444
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L2347">src/dream/Query.ts:2347</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="where" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>where</span><a href="#where" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="where.where-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">where</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#where.where-1.DB-13">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#where.where-1.Schema-6">Schema</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">whereStatement</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#where.where-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Applies a where statement to the Query instance</p>
|
|
428
445
|
<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>
|
|
429
446
|
</code><button type="button">Copy</button></pre>
|
|
430
447
|
|
|
431
448
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="where.where-1.DB-13" class="tsd-anchor"></a><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><a id="where.where-1.Schema-6" class="tsd-anchor"></a><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>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">WhereStatementForJoinedAssociation</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#where.where-1.DB-13">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#where.where-1.Schema-6">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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></span><div class="tsd-comment tsd-typography"><p>Where statement to apply to the Query</p>
|
|
432
449
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A cloned Query with the where clause applied</p>
|
|
433
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
450
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1155">src/dream/Query.ts:1155</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="whereAny" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>where<wbr/>Any</span><a href="#whereAny" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="whereAny.whereAny-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">where<wbr/>Any</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#whereAny.whereAny-1.DB-14">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#whereAny.whereAny-1.Schema-7">Schema</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">whereStatements</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#whereAny.whereAny-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Accepts a list of where statements, each of
|
|
434
451
|
which is combined via <code>OR</code></p>
|
|
435
452
|
<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>
|
|
436
453
|
</code><button type="button">Copy</button></pre>
|
|
437
454
|
|
|
438
455
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="whereAny.whereAny-1.DB-14" class="tsd-anchor"></a><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><a id="whereAny.whereAny-1.Schema-7" class="tsd-anchor"></a><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>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">WhereStatementForJoinedAssociation</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#whereAny.whereAny-1.DB-14">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#whereAny.whereAny-1.Schema-7">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><span class="tsd-signature-symbol">[]</span></span><div class="tsd-comment tsd-typography"><p>a list of where statements to <code>OR</code> together</p>
|
|
439
456
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A cloned Query with the whereAny clause applied</p>
|
|
440
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/
|
|
457
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1178">src/dream/Query.ts:1178</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="whereNot" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>where<wbr/>Not</span><a href="#whereNot" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="whereNot.whereNot-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">where<wbr/>Not</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#whereNot.whereNot-1.DB-15">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#whereNot.whereNot-1.Schema-8">Schema</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">whereStatement</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span><a href="#whereNot.whereNot-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Applies a whereNot statement to the Query instance</p>
|
|
441
458
|
<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>
|
|
442
459
|
</code><button type="button">Copy</button></pre>
|
|
443
460
|
|
|
444
461
|
</div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="whereNot.whereNot-1.DB-15" class="tsd-anchor"></a><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><a id="whereNot.whereNot-1.Schema-8" class="tsd-anchor"></a><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>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">WhereStatementForJoinedAssociation</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#whereNot.whereNot-1.DB-15">DB</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#whereNot.whereNot-1.Schema-8">Schema</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">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></span><div class="tsd-comment tsd-typography"><p>A where statement to negate and apply to the Query</p>
|
|
445
462
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="index.Query.html" 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="index.Query.html#constructor.new_Query.DreamInstance-1">DreamInstance</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#constructor.new_Query.QueryTypeOpts-1">QueryTypeOpts</a><span class="tsd-signature-symbol">></span></h4><p>A cloned Query with the whereNot clause applied</p>
|
|
446
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/f0335d7dcc0a1a22e273b2cec30b03976c59c0d5/src/dream/Query.ts#L1204">src/dream/Query.ts:1204</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="dbDriverClass" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><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"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="dbDriverClass.dbDriverClass-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">db<wbr/>Driver<wbr/>Class</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#dbDriverClass.dbDriverClass-1.T">T</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-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.dbDriverClass-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="dbDriverClass.dbDriverClass-1.T" class="tsd-anchor"></a><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/f0335d7dcc0a1a22e273b2cec30b03976c59c0d5/src/dream/Query.ts#L1745">src/dream/Query.ts:1745</a></li></ul></aside></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"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>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"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>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="tsd-otp-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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="tsd-otp-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><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"><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"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dream<wbr/>Class</span></a><a href="#dreamInstance-2" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dream<wbr/>Instance</span></a><a href="#dreamTransaction" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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"><use href="../assets/icons.svg#icon-1024"></use></svg><span>inner<wbr/>Join<wbr/>Dream<wbr/>Classes</span></a><a href="#queryTypeOpts-2" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>query<wbr/>Type<wbr/>Opts</span></a><a href="#BATCH_SIZES" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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="tsd-otp-Accessors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Accessors</summary><div><a href="#connectionName" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>connection<wbr/>Name</span></a><a href="#isDreamQuery" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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="tsd-otp-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#all" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>all</span></a><a href="#avg" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>avg</span></a><a href="#clone" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>clone</span></a><a href="#connection" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>connection</span></a><a href="#count" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>count</span></a><a href="#dbDriverInstance" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>db<wbr/>Driver<wbr/>Instance</span></a><a href="#delete" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>delete</span></a><a href="#destroy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>destroy</span></a><a href="#distinct" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>distinct</span></a><a href="#exists" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>exists</span></a><a href="#find" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find</span></a><a href="#findBy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>By</span></a><a href="#findEach" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Each</span></a><a href="#findOrFail" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Or<wbr/>Fail</span></a><a href="#findOrFailBy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Or<wbr/>Fail<wbr/>By</span></a><a href="#first" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>first</span></a><a href="#firstOrFail" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>first<wbr/>Or<wbr/>Fail</span></a><a href="#innerJoin" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>inner<wbr/>Join</span></a><a href="#last" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>last</span></a><a href="#lastOrFail" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>last<wbr/>Or<wbr/>Fail</span></a><a href="#leftJoin" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>left<wbr/>Join</span></a><a href="#leftJoinPreload" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>left<wbr/>Join<wbr/>Preload</span></a><a href="#limit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>limit</span></a><a href="#max" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>max</span></a><a href="#min" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>min</span></a><a href="#nestedSelect" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>nested<wbr/>Select</span></a><a href="#offset" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>offset</span></a><a href="#order" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>order</span></a><a href="#paginate" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>paginate</span></a><a href="#passthrough" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>passthrough</span></a><a href="#pluck" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>pluck</span></a><a href="#pluckEach" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>pluck<wbr/>Each</span></a><a href="#preload" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>preload</span></a><a href="#preloadFor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>preload<wbr/>For</span></a><a href="#reallyDestroy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>really<wbr/>Destroy</span></a><a href="#removeAllDefaultScopes" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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"><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" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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"><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" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>scroll<wbr/>Paginate</span></a><a href="#sql" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>sql</span></a><a href="#sum" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>sum</span></a><a href="#toKysely" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>to<wbr/>Kysely</span></a><a href="#txn" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>txn</span></a><a href="#undestroy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>undestroy</span></a><a href="#update" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>update</span></a><a href="#where" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where</span></a><a href="#whereAny" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where<wbr/>Any</span></a><a href="#whereNot" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where<wbr/>Not</span></a><a href="#dbDriverClass" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@rvoh/dream</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><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>
|
|
463
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1204">src/dream/Query.ts:1204</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="dbDriverClass" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><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"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="dbDriverClass.dbDriverClass-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">db<wbr/>Driver<wbr/>Class</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="index.Query.html#dbDriverClass.dbDriverClass-1.T">T</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-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.dbDriverClass-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="dbDriverClass.dbDriverClass-1.T" class="tsd-anchor"></a><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/3b37f65f1a1943db93ef1c1fc64277e283c5ee75/src/dream/Query.ts#L1745">src/dream/Query.ts:1745</a></li></ul></aside></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"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>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"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>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="tsd-otp-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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="tsd-otp-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><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"><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"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dream<wbr/>Class</span></a><a href="#dreamInstance-2" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dream<wbr/>Instance</span></a><a href="#dreamTransaction" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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"><use href="../assets/icons.svg#icon-1024"></use></svg><span>inner<wbr/>Join<wbr/>Dream<wbr/>Classes</span></a><a href="#queryTypeOpts-2" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>query<wbr/>Type<wbr/>Opts</span></a><a href="#BATCH_SIZES" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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="tsd-otp-Accessors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Accessors</summary><div><a href="#connectionName" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>connection<wbr/>Name</span></a><a href="#isDreamQuery" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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="tsd-otp-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#all" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>all</span></a><a href="#avg" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>avg</span></a><a href="#clone" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>clone</span></a><a href="#connection" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>connection</span></a><a href="#count" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>count</span></a><a href="#cursorPaginate" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>cursor<wbr/>Paginate</span></a><a href="#dbDriverInstance" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>db<wbr/>Driver<wbr/>Instance</span></a><a href="#delete" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>delete</span></a><a href="#destroy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>destroy</span></a><a href="#distinct" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>distinct</span></a><a href="#exists" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>exists</span></a><a href="#find" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find</span></a><a href="#findBy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>By</span></a><a href="#findEach" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Each</span></a><a href="#findOrFail" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Or<wbr/>Fail</span></a><a href="#findOrFailBy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>find<wbr/>Or<wbr/>Fail<wbr/>By</span></a><a href="#first" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>first</span></a><a href="#firstOrFail" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>first<wbr/>Or<wbr/>Fail</span></a><a href="#innerJoin" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>inner<wbr/>Join</span></a><a href="#last" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>last</span></a><a href="#lastOrFail" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>last<wbr/>Or<wbr/>Fail</span></a><a href="#leftJoin" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>left<wbr/>Join</span></a><a href="#leftJoinPreload" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>left<wbr/>Join<wbr/>Preload</span></a><a href="#limit" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>limit</span></a><a href="#max" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>max</span></a><a href="#min" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>min</span></a><a href="#nestedSelect" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>nested<wbr/>Select</span></a><a href="#offset" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>offset</span></a><a href="#order" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>order</span></a><a href="#paginate" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>paginate</span></a><a href="#passthrough" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>passthrough</span></a><a href="#pluck" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>pluck</span></a><a href="#pluckEach" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>pluck<wbr/>Each</span></a><a href="#preload" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>preload</span></a><a href="#preloadFor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>preload<wbr/>For</span></a><a href="#reallyDestroy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>really<wbr/>Destroy</span></a><a href="#removeAllDefaultScopes" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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"><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" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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"><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" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>scroll<wbr/>Paginate</span></a><a href="#sql" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>sql</span></a><a href="#sum" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>sum</span></a><a href="#toKysely" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>to<wbr/>Kysely</span></a><a href="#txn" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>txn</span></a><a href="#undestroy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>undestroy</span></a><a href="#update" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>update</span></a><a href="#where" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where</span></a><a href="#whereAny" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where<wbr/>Any</span></a><a href="#whereNot" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>where<wbr/>Not</span></a><a href="#dbDriverClass" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><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="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@rvoh/dream</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><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>
|