@tstdl/base 0.93.87 → 0.93.90
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/ai/genkit/helpers.d.ts +3 -1
- package/ai/genkit/helpers.js +3 -3
- package/api/server/gateway.d.ts +3 -0
- package/api/server/gateway.js +15 -4
- package/api/server/middlewares/catch-error.middleware.js +2 -4
- package/api/server/middlewares/cors.middleware.js +2 -3
- package/api/server/middlewares/csrf.middleware.d.ts +41 -0
- package/api/server/middlewares/csrf.middleware.js +108 -0
- package/api/server/middlewares/index.d.ts +1 -0
- package/api/server/middlewares/index.js +1 -0
- package/api/server/module.d.ts +8 -2
- package/api/server/module.js +14 -8
- package/api/server/tests/csrf.middleware.test.js +91 -0
- package/audit/drizzle/{0000_bored_stick.sql → 0000_lumpy_thunderball.sql} +3 -3
- package/audit/drizzle/meta/0000_snapshot.json +4 -4
- package/audit/drizzle/meta/_journal.json +2 -9
- package/audit/module.d.ts +4 -1
- package/audit/module.js +3 -2
- package/audit/schemas.d.ts +1 -1
- package/audit/types.d.ts +1 -1
- package/audit/types.js +1 -1
- package/authentication/client/authentication.service.d.ts +14 -1
- package/authentication/client/authentication.service.js +82 -23
- package/authentication/client/http-client.middleware.d.ts +6 -0
- package/authentication/client/http-client.middleware.js +36 -0
- package/authentication/client/module.js +8 -2
- package/authentication/models/service-account.model.d.ts +2 -2
- package/authentication/models/service-account.model.js +10 -5
- package/authentication/models/subject.model.d.ts +20 -5
- package/authentication/models/subject.model.js +34 -29
- package/authentication/models/system-account.model.d.ts +3 -2
- package/authentication/models/system-account.model.js +11 -5
- package/authentication/models/user.model.d.ts +2 -11
- package/authentication/models/user.model.js +5 -16
- package/authentication/server/authentication-api-request-token.provider.d.ts +0 -2
- package/authentication/server/authentication-api-request-token.provider.js +3 -11
- package/authentication/server/authentication.api-controller.d.ts +1 -2
- package/authentication/server/authentication.api-controller.js +8 -9
- package/authentication/server/authentication.audit.d.ts +3 -2
- package/authentication/server/authentication.service.d.ts +27 -1
- package/authentication/server/authentication.service.js +67 -18
- package/authentication/server/drizzle/{0000_normal_paper_doll.sql → 0000_soft_tag.sql} +25 -32
- package/authentication/server/drizzle/meta/0000_snapshot.json +180 -205
- package/authentication/server/drizzle/meta/_journal.json +2 -2
- package/authentication/server/helper.js +9 -2
- package/authentication/server/module.d.ts +4 -1
- package/authentication/server/module.js +9 -5
- package/authentication/server/schemas.d.ts +2 -1
- package/authentication/server/schemas.js +2 -2
- package/authentication/server/subject.service.d.ts +17 -11
- package/authentication/server/subject.service.js +86 -84
- package/authentication/tests/authentication-ancillary.service.test.d.ts +1 -0
- package/authentication/tests/authentication-ancillary.service.test.js +13 -0
- package/authentication/tests/authentication-secret-requirements.validator.test.d.ts +1 -0
- package/authentication/tests/authentication-secret-requirements.validator.test.js +29 -0
- package/authentication/tests/authentication.api-controller.test.d.ts +1 -0
- package/authentication/tests/authentication.api-controller.test.js +88 -0
- package/authentication/tests/authentication.api-request-token.provider.test.d.ts +1 -0
- package/authentication/tests/authentication.api-request-token.provider.test.js +48 -0
- package/authentication/tests/authentication.client-middleware.test.d.ts +1 -0
- package/authentication/tests/authentication.client-middleware.test.js +23 -0
- package/authentication/tests/authentication.client-service.test.d.ts +1 -0
- package/authentication/tests/authentication.client-service.test.js +70 -0
- package/authentication/tests/authentication.service.test.d.ts +1 -0
- package/authentication/tests/authentication.service.test.js +186 -0
- package/authentication/tests/authentication.test-ancillary-service.d.ts +9 -0
- package/authentication/tests/authentication.test-ancillary-service.js +27 -0
- package/authentication/tests/helper.test.d.ts +1 -0
- package/authentication/tests/helper.test.js +107 -0
- package/authentication/tests/secret-requirements.error.test.d.ts +1 -0
- package/authentication/tests/secret-requirements.error.test.js +14 -0
- package/authentication/tests/subject.service.test.d.ts +1 -0
- package/authentication/tests/subject.service.test.js +140 -0
- package/circuit-breaker/postgres/drizzle/meta/0000_snapshot.json +1 -1
- package/circuit-breaker/postgres/drizzle/meta/_journal.json +2 -2
- package/circuit-breaker/postgres/module.d.ts +7 -1
- package/circuit-breaker/postgres/module.js +8 -6
- package/circuit-breaker/tests/circuit-breaker.test.js +2 -22
- package/document-management/api/document-management.api.js +2 -6
- package/document-management/server/services/document-validation.service.js +6 -5
- package/document-management/server/services/document-workflow.service.js +5 -5
- package/document-management/service-models/document-folders.view-model.d.ts +5 -2
- package/document-management/service-models/document-folders.view-model.js +42 -9
- package/document-management/service-models/enriched/enriched-document-management-data.view.js +1 -1
- package/examples/document-management/main.js +4 -4
- package/http/client/adapters/undici.adapter.d.ts +7 -5
- package/http/client/adapters/undici.adapter.js +13 -10
- package/http/client/module.d.ts +3 -1
- package/http/client/module.js +8 -9
- package/http/server/http-server.d.ts +2 -0
- package/http/server/node/module.d.ts +6 -2
- package/http/server/node/module.js +6 -4
- package/http/server/node/node-http-server.d.ts +2 -0
- package/http/server/node/node-http-server.js +7 -0
- package/http/types.d.ts +1 -1
- package/key-value-store/postgres/module.d.ts +7 -1
- package/key-value-store/postgres/module.js +7 -3
- package/lock/postgres/lock.js +0 -1
- package/lock/postgres/module.d.ts +7 -1
- package/lock/postgres/module.js +9 -5
- package/logger/formatter.d.ts +2 -0
- package/logger/formatters/json.js +2 -2
- package/logger/formatters/pretty-print.js +8 -10
- package/logger/logger.d.ts +1 -1
- package/logger/logger.js +15 -12
- package/message-bus/local/module.d.ts +5 -2
- package/message-bus/local/module.js +5 -4
- package/module/module.d.ts +2 -1
- package/module/module.js +3 -0
- package/module/modules/web-server.module.d.ts +11 -6
- package/module/modules/web-server.module.js +15 -10
- package/orm/decorators.d.ts +24 -1
- package/orm/decorators.js +40 -4
- package/orm/query/base.d.ts +17 -17
- package/orm/query/base.js +1 -1
- package/orm/repository.types.d.ts +45 -1
- package/orm/schemas/tsvector.js +1 -1
- package/orm/server/drizzle/schema-converter.d.ts +3 -1
- package/orm/server/drizzle/schema-converter.js +120 -14
- package/orm/server/index.d.ts +1 -0
- package/orm/server/index.js +1 -0
- package/orm/server/module.d.ts +4 -2
- package/orm/server/module.js +6 -5
- package/orm/server/query-converter.d.ts +6 -3
- package/orm/server/query-converter.js +32 -20
- package/orm/server/repository-config.d.ts +8 -0
- package/orm/server/repository-config.js +8 -0
- package/orm/server/repository.d.ts +117 -43
- package/orm/server/repository.js +757 -253
- package/orm/server/transaction.d.ts +4 -2
- package/orm/server/transaction.js +14 -5
- package/orm/server/transactional.d.ts +6 -2
- package/orm/server/transactional.js +39 -9
- package/orm/server/types.d.ts +2 -0
- package/orm/sqls/case-when.d.ts +3 -3
- package/orm/sqls/case-when.js +2 -2
- package/orm/sqls/sqls.d.ts +31 -5
- package/orm/sqls/sqls.js +69 -6
- package/orm/tests/data-types.test.d.ts +1 -0
- package/orm/tests/data-types.test.js +39 -0
- package/orm/tests/decorators.test.d.ts +1 -0
- package/orm/tests/decorators.test.js +77 -0
- package/orm/tests/encryption.test.d.ts +1 -0
- package/orm/tests/encryption.test.js +34 -0
- package/orm/tests/query-complex.test.d.ts +1 -0
- package/orm/tests/query-complex.test.js +203 -0
- package/orm/tests/query-converter-complex.test.d.ts +1 -0
- package/orm/tests/query-converter-complex.test.js +126 -0
- package/orm/tests/query-converter.test.d.ts +1 -0
- package/orm/tests/query-converter.test.js +123 -0
- package/orm/tests/repository-advanced.test.d.ts +1 -0
- package/orm/tests/repository-advanced.test.js +232 -0
- package/orm/tests/repository-attributes.test.d.ts +1 -0
- package/orm/tests/repository-attributes.test.js +99 -0
- package/orm/tests/repository-comprehensive.test.d.ts +1 -0
- package/orm/tests/repository-comprehensive.test.js +187 -0
- package/orm/tests/repository-coverage.test.d.ts +1 -0
- package/orm/tests/repository-coverage.test.js +303 -0
- package/orm/tests/repository-cti-complex.test.d.ts +1 -0
- package/orm/tests/repository-cti-complex.test.js +170 -0
- package/orm/tests/repository-cti-embedded.test.d.ts +1 -0
- package/orm/tests/repository-cti-embedded.test.js +188 -0
- package/orm/tests/repository-cti-extensive.test.d.ts +1 -0
- package/orm/tests/repository-cti-extensive.test.js +308 -0
- package/orm/tests/repository-cti-mapping.test.d.ts +1 -0
- package/orm/tests/repository-cti-mapping.test.js +121 -0
- package/orm/tests/repository-cti-search.test.d.ts +1 -0
- package/orm/tests/repository-cti-search.test.js +152 -0
- package/orm/tests/repository-cti-soft-delete.test.d.ts +1 -0
- package/orm/tests/repository-cti-soft-delete.test.js +115 -0
- package/orm/tests/repository-cti-transactions.test.d.ts +1 -0
- package/orm/tests/repository-cti-transactions.test.js +126 -0
- package/orm/tests/repository-cti-upsert-many.test.d.ts +1 -0
- package/orm/tests/repository-cti-upsert-many.test.js +127 -0
- package/orm/tests/repository-cti.test.d.ts +1 -0
- package/orm/tests/repository-cti.test.js +456 -0
- package/orm/tests/repository-edge-cases.test.d.ts +1 -0
- package/orm/tests/repository-edge-cases.test.js +216 -0
- package/orm/tests/repository-expiration.test.d.ts +1 -0
- package/orm/tests/repository-expiration.test.js +153 -0
- package/orm/tests/repository-extra-coverage.test.d.ts +1 -0
- package/orm/tests/repository-extra-coverage.test.js +546 -0
- package/orm/tests/repository-mapping.test.d.ts +1 -0
- package/orm/tests/repository-mapping.test.js +71 -0
- package/orm/tests/repository-regression.test.d.ts +1 -0
- package/orm/tests/repository-regression.test.js +330 -0
- package/orm/tests/repository-search-coverage.test.d.ts +1 -0
- package/orm/tests/repository-search-coverage.test.js +129 -0
- package/orm/tests/repository-search.test.d.ts +1 -0
- package/orm/tests/repository-search.test.js +116 -0
- package/orm/tests/repository-soft-delete.test.d.ts +1 -0
- package/orm/tests/repository-soft-delete.test.js +143 -0
- package/orm/tests/repository-transactions-nested.test.d.ts +1 -0
- package/orm/tests/repository-transactions-nested.test.js +202 -0
- package/orm/tests/repository-types.test.d.ts +1 -0
- package/orm/tests/repository-types.test.js +218 -0
- package/orm/tests/schema-converter.test.d.ts +1 -0
- package/orm/tests/schema-converter.test.js +81 -0
- package/orm/tests/schema-generation.test.d.ts +1 -0
- package/orm/tests/schema-generation.test.js +127 -0
- package/orm/tests/sql-helpers.test.d.ts +1 -0
- package/orm/tests/sql-helpers.test.js +67 -0
- package/orm/tests/transaction-safety.test.d.ts +1 -0
- package/orm/tests/transaction-safety.test.js +81 -0
- package/orm/tests/transactional.test.d.ts +1 -0
- package/orm/tests/transactional.test.js +224 -0
- package/orm/tests/utils.test.d.ts +1 -0
- package/orm/tests/utils.test.js +70 -0
- package/orm/utils.d.ts +7 -0
- package/orm/utils.js +26 -6
- package/package.json +12 -7
- package/pool/pool.js +1 -1
- package/rate-limit/index.d.ts +2 -0
- package/rate-limit/index.js +2 -0
- package/rate-limit/postgres/drizzle/0000_watery_rage.sql +7 -0
- package/{queue → rate-limit}/postgres/drizzle/meta/0000_snapshot.json +14 -39
- package/rate-limit/postgres/drizzle/meta/_journal.json +13 -0
- package/{queue → rate-limit}/postgres/drizzle.config.js +1 -1
- package/rate-limit/postgres/index.d.ts +4 -0
- package/rate-limit/postgres/index.js +4 -0
- package/rate-limit/postgres/module.d.ts +12 -0
- package/rate-limit/postgres/module.js +28 -0
- package/rate-limit/postgres/postgres-rate-limiter.d.ts +9 -0
- package/rate-limit/postgres/postgres-rate-limiter.js +56 -0
- package/rate-limit/postgres/rate-limit.model.d.ts +8 -0
- package/rate-limit/postgres/rate-limit.model.js +35 -0
- package/rate-limit/postgres/rate-limiter.provider.d.ts +6 -0
- package/rate-limit/postgres/rate-limiter.provider.js +21 -0
- package/rate-limit/postgres/schemas.d.ts +3 -0
- package/rate-limit/postgres/schemas.js +4 -0
- package/rate-limit/provider.d.ts +9 -0
- package/rate-limit/provider.js +2 -0
- package/rate-limit/rate-limiter.d.ts +35 -0
- package/rate-limit/rate-limiter.js +3 -0
- package/rate-limit/tests/postgres-rate-limiter.test.d.ts +1 -0
- package/rate-limit/tests/postgres-rate-limiter.test.js +92 -0
- package/signals/implementation/configure.d.ts +3 -0
- package/signals/implementation/configure.js +3 -0
- package/sse/data-stream-source.d.ts +1 -1
- package/sse/data-stream-source.js +6 -6
- package/task-queue/enqueue-batch.d.ts +17 -0
- package/task-queue/enqueue-batch.js +24 -0
- package/{queue → task-queue}/index.d.ts +1 -1
- package/{queue → task-queue}/index.js +1 -1
- package/task-queue/postgres/drizzle/0000_thin_black_panther.sql +74 -0
- package/task-queue/postgres/drizzle/meta/0000_snapshot.json +592 -0
- package/task-queue/postgres/drizzle/meta/_journal.json +13 -0
- package/task-queue/postgres/drizzle.config.d.ts +2 -0
- package/task-queue/postgres/drizzle.config.js +11 -0
- package/task-queue/postgres/index.d.ts +4 -0
- package/task-queue/postgres/index.js +4 -0
- package/task-queue/postgres/module.d.ts +12 -0
- package/task-queue/postgres/module.js +28 -0
- package/task-queue/postgres/schemas.d.ts +16 -0
- package/task-queue/postgres/schemas.js +8 -0
- package/task-queue/postgres/task-queue.d.ts +83 -0
- package/task-queue/postgres/task-queue.js +1054 -0
- package/task-queue/postgres/task-queue.provider.d.ts +7 -0
- package/{queue/postgres/queue.provider.js → task-queue/postgres/task-queue.provider.js} +8 -8
- package/task-queue/postgres/task.model.d.ts +39 -0
- package/task-queue/postgres/task.model.js +178 -0
- package/{queue → task-queue}/provider.d.ts +3 -3
- package/task-queue/provider.js +2 -0
- package/{queue → task-queue}/task-context.d.ts +7 -7
- package/{queue → task-queue}/task-context.js +8 -8
- package/{queue/queue.d.ts → task-queue/task-queue.d.ts} +128 -59
- package/task-queue/task-queue.js +200 -0
- package/task-queue/tests/complex.test.d.ts +1 -0
- package/task-queue/tests/complex.test.js +299 -0
- package/task-queue/tests/dependencies.test.d.ts +1 -0
- package/task-queue/tests/dependencies.test.js +174 -0
- package/task-queue/tests/queue.test.d.ts +1 -0
- package/task-queue/tests/queue.test.js +334 -0
- package/task-queue/tests/worker.test.d.ts +1 -0
- package/task-queue/tests/worker.test.js +163 -0
- package/test1.js +1 -1
- package/test4.js +2 -2
- package/unit-test/index.d.ts +1 -0
- package/unit-test/index.js +1 -0
- package/unit-test/integration-setup.d.ts +55 -0
- package/unit-test/integration-setup.js +182 -0
- package/utils/patterns.d.ts +3 -0
- package/utils/patterns.js +6 -1
- package/audit/drizzle/0001_previous_network.sql +0 -2
- package/audit/drizzle/meta/0001_snapshot.json +0 -195
- package/queue/enqueue-batch.d.ts +0 -17
- package/queue/enqueue-batch.js +0 -18
- package/queue/postgres/drizzle/0000_zippy_moondragon.sql +0 -11
- package/queue/postgres/drizzle/0001_certain_wild_pack.sql +0 -2
- package/queue/postgres/drizzle/0002_dear_meggan.sql +0 -2
- package/queue/postgres/drizzle/0003_tricky_venom.sql +0 -30
- package/queue/postgres/drizzle/meta/0001_snapshot.json +0 -103
- package/queue/postgres/drizzle/meta/0002_snapshot.json +0 -90
- package/queue/postgres/drizzle/meta/0003_snapshot.json +0 -288
- package/queue/postgres/drizzle/meta/_journal.json +0 -34
- package/queue/postgres/index.d.ts +0 -4
- package/queue/postgres/index.js +0 -4
- package/queue/postgres/module.d.ts +0 -9
- package/queue/postgres/module.js +0 -29
- package/queue/postgres/queue.d.ts +0 -60
- package/queue/postgres/queue.js +0 -681
- package/queue/postgres/queue.provider.d.ts +0 -7
- package/queue/postgres/schemas.d.ts +0 -14
- package/queue/postgres/schemas.js +0 -6
- package/queue/postgres/task.model.d.ts +0 -24
- package/queue/postgres/task.model.js +0 -115
- package/queue/provider.js +0 -2
- package/queue/queue.js +0 -131
- package/queue/tests/queue.test.js +0 -623
- package/test3.d.ts +0 -1
- package/test3.js +0 -47
- /package/{queue/tests/queue.test.d.ts → api/server/tests/csrf.middleware.test.d.ts} +0 -0
- /package/circuit-breaker/postgres/drizzle/{0000_hard_shocker.sql → 0000_cooing_korath.sql} +0 -0
- /package/{queue → rate-limit}/postgres/drizzle.config.d.ts +0 -0
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
import { SQL, type SQLWrapper } from 'drizzle-orm';
|
|
2
|
-
import type { PgColumn, PgInsertValue, PgSelectBuilder, PgUpdateSetSource, SelectedFields } from 'drizzle-orm/pg-core';
|
|
2
|
+
import type { AnyPgTable, PgColumn, PgInsertValue, PgSelectBuilder, PgUpdateSetSource, SelectedFields } from 'drizzle-orm/pg-core';
|
|
3
3
|
import { afterResolve, resolveArgumentType, type Resolvable } from '../../injector/interfaces.js';
|
|
4
4
|
import type { DeepPartial, Function, OneOrMany, Record, SimplifyObject, Type, TypedOmit } from '../../types/index.js';
|
|
5
5
|
import { Entity, type BaseEntity, type EntityMetadataAttributes, type EntityType } from '../entity.js';
|
|
6
6
|
import type { ParadeSearchQuery, Query, TrigramSearchQuery, TsVectorSearchQuery } from '../query/index.js';
|
|
7
|
-
import type { EntityMetadataUpdate, EntityUpdate, LoadManyOptions, LoadOptions, NewEntity, Order, SearchOptions, SearchResult, TargetColumn, TargetColumnPath } from '../repository.types.js';
|
|
7
|
+
import type { CountOptions, DeleteOptions, EntityMetadataUpdate, EntityUpdate, HasOptions, LoadManyOptions, LoadOptions, NewEntity, Order, SearchOptions, SearchResult, TargetColumn, TargetColumnPath, UpdateOptions } from '../repository.types.js';
|
|
8
8
|
import type { Database } from './database.js';
|
|
9
9
|
import type { PgTransaction } from './transaction.js';
|
|
10
10
|
import { Transactional } from './transactional.js';
|
|
11
11
|
import type { ColumnDefinition, PgTableFromType, TransformContext } from './types.js';
|
|
12
12
|
export declare const repositoryType: unique symbol;
|
|
13
|
-
/**
|
|
14
|
-
* Configuration class for EntityRepository.
|
|
15
|
-
* Specifies the database schema to be used.
|
|
16
|
-
*/
|
|
17
|
-
export declare class EntityRepositoryConfig {
|
|
18
|
-
/** The name of the database schema. */
|
|
19
|
-
schema: string;
|
|
20
|
-
}
|
|
21
13
|
type EntityRepositoryContext = {
|
|
22
14
|
type: EntityType;
|
|
23
15
|
table: PgTableFromType;
|
|
@@ -38,6 +30,11 @@ export declare class EntityRepository<T extends BaseEntity = BaseEntity> extends
|
|
|
38
30
|
get table(): PgTableFromType<EntityType<T>>;
|
|
39
31
|
readonly [resolveArgumentType]: EntityType<T>;
|
|
40
32
|
[afterResolve](): void;
|
|
33
|
+
/**
|
|
34
|
+
* Processes expired entities (soft or hard delete) based on metadata.
|
|
35
|
+
* Exposed primarily for testing, but can be used in other scenarios as needed.
|
|
36
|
+
*/
|
|
37
|
+
processExpirations(): Promise<void>;
|
|
41
38
|
private expirationLoop;
|
|
42
39
|
protected getTransactionalContextData(): EntityRepositoryContext;
|
|
43
40
|
protected tsVectorSearch(options: SearchOptions<T> & {
|
|
@@ -60,17 +57,19 @@ export declare class EntityRepository<T extends BaseEntity = BaseEntity> extends
|
|
|
60
57
|
* Loads a single entity by its ID.
|
|
61
58
|
* Throws `NotFoundError` if the entity is not found.
|
|
62
59
|
* @param id The ID of the entity to load.
|
|
60
|
+
* @param options Optional loading options (e.g., withDeleted).
|
|
63
61
|
* @returns A promise that resolves to the loaded entity.
|
|
64
62
|
* @throws {NotFoundError} If the entity with the given ID is not found.
|
|
65
63
|
*/
|
|
66
|
-
load(id: string): Promise<T>;
|
|
64
|
+
load(id: string, options?: LoadOptions<T>): Promise<T>;
|
|
67
65
|
/**
|
|
68
66
|
* Tries to load a single entity by its ID.
|
|
69
67
|
* Returns `undefined` if the entity is not found.
|
|
70
68
|
* @param id The ID of the entity to load.
|
|
69
|
+
* @param options Optional loading options (e.g., withDeleted).
|
|
71
70
|
* @returns A promise that resolves to the loaded entity or `undefined` if not found.
|
|
72
71
|
*/
|
|
73
|
-
tryLoad(id: string): Promise<T | undefined>;
|
|
72
|
+
tryLoad(id: string, options?: LoadOptions<T>): Promise<T | undefined>;
|
|
74
73
|
/**
|
|
75
74
|
* Loads a single entity based on a query.
|
|
76
75
|
* Throws `NotFoundError` if no entity matches the query.
|
|
@@ -130,27 +129,31 @@ export declare class EntityRepository<T extends BaseEntity = BaseEntity> extends
|
|
|
130
129
|
loadAllCursor(options?: LoadManyOptions<T>): AsyncIterableIterator<T>;
|
|
131
130
|
/**
|
|
132
131
|
* Counts the total number of entities of the repository's type.
|
|
132
|
+
* @param options Optional counting options (e.g., withDeleted).
|
|
133
133
|
* @returns A promise that resolves to the total count.
|
|
134
134
|
*/
|
|
135
|
-
count(): Promise<number>;
|
|
135
|
+
count(options?: CountOptions<T>): Promise<number>;
|
|
136
136
|
/**
|
|
137
137
|
* Counts the number of entities matching a query.
|
|
138
138
|
* @param query The query to filter entities.
|
|
139
|
+
* @param options Optional counting options (e.g., withDeleted).
|
|
139
140
|
* @returns A promise that resolves to the count of matching entities.
|
|
140
141
|
*/
|
|
141
|
-
countByQuery(query: Query<T>): Promise<number>;
|
|
142
|
+
countByQuery(query: Query<T>, options?: CountOptions<T>): Promise<number>;
|
|
142
143
|
/**
|
|
143
144
|
* Checks if an entity with the given ID exists.
|
|
144
145
|
* @param id The ID of the entity to check.
|
|
146
|
+
* @param options Optional counting options (e.g., withDeleted).
|
|
145
147
|
* @returns A promise that resolves to `true` if the entity exists, `false` otherwise.
|
|
146
148
|
*/
|
|
147
|
-
has(id: string): Promise<boolean>;
|
|
149
|
+
has(id: string, options?: HasOptions<T>): Promise<boolean>;
|
|
148
150
|
/**
|
|
149
151
|
* Checks if any entity matches the given query.
|
|
150
152
|
* @param query The query to filter entities.
|
|
153
|
+
* @param options Optional counting options (e.g., withDeleted).
|
|
151
154
|
* @returns A promise that resolves to `true` if at least one entity matches the query, `false` otherwise.
|
|
152
155
|
*/
|
|
153
|
-
hasByQuery(query: Query<T>): Promise<boolean>;
|
|
156
|
+
hasByQuery(query: Query<T>, options?: HasOptions<T>): Promise<boolean>;
|
|
154
157
|
/**
|
|
155
158
|
* Checks if all entities with the given IDs exist.
|
|
156
159
|
* @param ids An array of entity IDs to check.
|
|
@@ -163,6 +166,8 @@ export declare class EntityRepository<T extends BaseEntity = BaseEntity> extends
|
|
|
163
166
|
* @returns entity if inserted, undefined on conflict
|
|
164
167
|
*/
|
|
165
168
|
tryInsert(entity: NewEntity<T>): Promise<T | undefined>;
|
|
169
|
+
private insertCTI;
|
|
170
|
+
private insertManyCTI;
|
|
166
171
|
/**
|
|
167
172
|
* Inserts a new entity into the database.
|
|
168
173
|
* @param entity The entity to insert.
|
|
@@ -191,54 +196,84 @@ export declare class EntityRepository<T extends BaseEntity = BaseEntity> extends
|
|
|
191
196
|
insertManyIfNotExists(target: OneOrMany<TargetColumnPath<T>>, entities: NewEntity<T>[]): Promise<T[]>;
|
|
192
197
|
/**
|
|
193
198
|
* Inserts an entity or updates it if a conflict occurs based on the target columns.
|
|
199
|
+
* Throws an error if the entity is not returned (e.g. because of a condition in `wheres`).
|
|
194
200
|
* @param target The column(s) to use for conflict detection.
|
|
195
201
|
* @param entity The entity to insert.
|
|
196
202
|
* @param update Optional update to apply if a conflict occurs. Defaults to the inserted entity's values.
|
|
203
|
+
* @param wheres Optional conditions for the conflict target and the update.
|
|
197
204
|
* @returns A promise that resolves to the inserted or updated entity.
|
|
198
205
|
*/
|
|
199
|
-
upsert(target: OneOrMany<TargetColumnPath<T>>, entity: NewEntity<T>, update?: EntityUpdate<T
|
|
206
|
+
upsert(target: OneOrMany<TargetColumnPath<T>>, entity: NewEntity<T>, update?: EntityUpdate<T>, wheres?: {
|
|
207
|
+
target?: Query<T>;
|
|
208
|
+
set?: Query<T>;
|
|
209
|
+
}): Promise<T>;
|
|
210
|
+
private tryUpsertCTI;
|
|
211
|
+
/**
|
|
212
|
+
* Tries to insert an entity or update it if a conflict occurs based on the target columns.
|
|
213
|
+
* Returns `undefined` if the entity is not returned (e.g. because of a condition in `wheres`).
|
|
214
|
+
* @param target The column(s) to use for conflict detection.
|
|
215
|
+
* @param entity The entity to insert.
|
|
216
|
+
* @param update Optional update to apply if a conflict occurs. Defaults to the inserted entity's values.
|
|
217
|
+
* @param wheres Optional conditions for the conflict target and the update.
|
|
218
|
+
* @returns A promise that resolves to the inserted or updated entity or `undefined`.
|
|
219
|
+
*/
|
|
220
|
+
tryUpsert(target: OneOrMany<TargetColumnPath<T>>, entity: NewEntity<T>, update?: EntityUpdate<T>, wheres?: {
|
|
221
|
+
target?: Query<T>;
|
|
222
|
+
set?: Query<T>;
|
|
223
|
+
}): Promise<T | undefined>;
|
|
224
|
+
private upsertManyCTI;
|
|
200
225
|
/**
|
|
201
226
|
* Inserts multiple entities or updates them if a conflict occurs based on the target columns.
|
|
202
227
|
* @param target The column(s) to use for conflict detection.
|
|
203
228
|
* @param entities An array of entities to insert.
|
|
204
229
|
* @param update Optional update to apply if a conflict occurs. Defaults to the inserted entity's values.
|
|
230
|
+
* @param wheres Optional conditions for the conflict target and the update.
|
|
205
231
|
* @returns A promise that resolves to an array of the inserted or updated entities.
|
|
206
232
|
*/
|
|
207
|
-
upsertMany(target: OneOrMany<TargetColumnPath<T>>, entities: NewEntity<T>[], update?: EntityUpdate<T
|
|
233
|
+
upsertMany(target: OneOrMany<TargetColumnPath<T>>, entities: NewEntity<T>[], update?: EntityUpdate<T>, wheres?: {
|
|
234
|
+
target?: Query<T>;
|
|
235
|
+
set?: Query<T>;
|
|
236
|
+
}): Promise<T[]>;
|
|
208
237
|
/**
|
|
209
238
|
* Updates an entity by its ID.
|
|
210
239
|
* Throws `NotFoundError` if the entity is not found.
|
|
211
240
|
* @param id The ID of the entity to update.
|
|
212
241
|
* @param update The update to apply to the entity.
|
|
242
|
+
* @param options Optional update options.
|
|
213
243
|
* @returns A promise that resolves to the updated entity.
|
|
214
244
|
* @throws {NotFoundError} If the entity with the given ID is not found.
|
|
215
245
|
*/
|
|
216
|
-
update(id: string, update: EntityUpdate<T>): Promise<T>;
|
|
246
|
+
update(id: string, update: EntityUpdate<T>, options?: UpdateOptions<T>): Promise<T>;
|
|
247
|
+
private tryUpdateCTI;
|
|
248
|
+
private updateManyCTI;
|
|
217
249
|
/**
|
|
218
250
|
* Tries to update an entity by its ID.
|
|
219
251
|
* Returns `undefined` if the entity is not found.
|
|
220
252
|
* @param id The ID of the entity to update.
|
|
221
253
|
* @param update The update to apply to the entity.
|
|
254
|
+
* @param options Optional update options.
|
|
222
255
|
* @returns A promise that resolves to the updated entity or `undefined` if not found.
|
|
223
256
|
*/
|
|
224
|
-
tryUpdate(id: string, update: EntityUpdate<T>): Promise<T | undefined>;
|
|
257
|
+
tryUpdate(id: string, update: EntityUpdate<T>, options?: UpdateOptions<T>): Promise<T | undefined>;
|
|
225
258
|
/**
|
|
226
259
|
* Updates a single entity matching a query.
|
|
227
260
|
* Throws `NotFoundError` if no entity matches the query.
|
|
228
261
|
* @param query The query to filter entities.
|
|
229
262
|
* @param update The update to apply to the entity.
|
|
263
|
+
* @param options Optional update options.
|
|
230
264
|
* @returns A promise that resolves to the updated entity.
|
|
231
265
|
* @throws {NotFoundError} If no entity matches the query.
|
|
232
266
|
*/
|
|
233
|
-
updateByQuery(query: Query<T>, update: EntityUpdate<T>): Promise<T>;
|
|
267
|
+
updateByQuery(query: Query<T>, update: EntityUpdate<T>, options?: UpdateOptions<T>): Promise<T>;
|
|
234
268
|
/**
|
|
235
269
|
* Tries to update a single entity matching a query.
|
|
236
270
|
* Returns `undefined` if no entity matches the query.
|
|
237
271
|
* @param query The query to filter entities.
|
|
238
272
|
* @param update The update to apply to the entity.
|
|
273
|
+
* @param options Optional update options.
|
|
239
274
|
* @returns A promise that resolves to the updated entity or `undefined` if not found.
|
|
240
275
|
*/
|
|
241
|
-
tryUpdateByQuery(query: Query<T>, update: EntityUpdate<T>): Promise<T | undefined>;
|
|
276
|
+
tryUpdateByQuery(query: Query<T>, update: EntityUpdate<T>, options?: UpdateOptions<T>): Promise<T | undefined>;
|
|
242
277
|
/**
|
|
243
278
|
* Updates multiple entities by their IDs.
|
|
244
279
|
* @param ids An array of entity IDs to update.
|
|
@@ -257,92 +292,104 @@ export declare class EntityRepository<T extends BaseEntity = BaseEntity> extends
|
|
|
257
292
|
* Deletes an entity by its ID (soft delete if metadata is available).
|
|
258
293
|
* Throws `NotFoundError` if the entity is not found.
|
|
259
294
|
* @param id The ID of the entity to delete.
|
|
295
|
+
* @param options Optional delete options.
|
|
260
296
|
* @param metadataUpdate Optional metadata update to apply during soft delete.
|
|
261
297
|
* @returns A promise that resolves to the deleted entity.
|
|
262
298
|
* @throws {NotFoundError} If the entity with the given ID is not found.
|
|
263
299
|
*/
|
|
264
|
-
delete(id: string, metadataUpdate?: EntityMetadataUpdate): Promise<T>;
|
|
300
|
+
delete(id: string, options?: DeleteOptions<T>, metadataUpdate?: EntityMetadataUpdate): Promise<T>;
|
|
265
301
|
/**
|
|
266
302
|
* Tries to delete an entity by its ID (soft delete if metadata is available).
|
|
267
303
|
* Returns `undefined` if the entity is not found.
|
|
268
304
|
* @param id The ID of the entity to delete.
|
|
305
|
+
* @param options Optional delete options.
|
|
269
306
|
* @param metadataUpdate Optional metadata update to apply during soft delete.
|
|
270
307
|
* @returns A promise that resolves to the deleted entity or `undefined` if not found.
|
|
271
308
|
*/
|
|
272
|
-
tryDelete(id: string, metadataUpdate?: EntityMetadataUpdate): Promise<T | undefined>;
|
|
309
|
+
tryDelete(id: string, options?: DeleteOptions<T>, metadataUpdate?: EntityMetadataUpdate): Promise<T | undefined>;
|
|
273
310
|
/**
|
|
274
311
|
* Deletes a single entity matching a query (soft delete if metadata is available).
|
|
275
312
|
* Throws `NotFoundError` if no entity matches the query.
|
|
276
313
|
* @param query The query to filter entities.
|
|
314
|
+
* @param options Optional delete options.
|
|
277
315
|
* @param metadataUpdate Optional metadata update to apply during soft delete.
|
|
278
316
|
* @returns A promise that resolves to the deleted entity.
|
|
279
317
|
* @throws {NotFoundError} If no entity matches the query.
|
|
280
318
|
*/
|
|
281
|
-
deleteByQuery(query: Query<T>, metadataUpdate?: EntityMetadataUpdate): Promise<T>;
|
|
319
|
+
deleteByQuery(query: Query<T>, options?: DeleteOptions<T>, metadataUpdate?: EntityMetadataUpdate): Promise<T>;
|
|
282
320
|
/**
|
|
283
321
|
* Tries to delete a single entity matching a query (soft delete if metadata is available).
|
|
284
322
|
* Returns `undefined` if no entity matches the query.
|
|
285
323
|
* @param query The query to filter entities.
|
|
324
|
+
* @param options Optional delete options.
|
|
286
325
|
* @param metadataUpdate Optional metadata update to apply during soft delete.
|
|
287
326
|
* @returns A promise that resolves to the deleted entity or `undefined` if not found.
|
|
288
327
|
*/
|
|
289
|
-
tryDeleteByQuery(query: Query<T>, metadataUpdate?: EntityMetadataUpdate): Promise<T | undefined>;
|
|
328
|
+
tryDeleteByQuery(query: Query<T>, options?: DeleteOptions<T>, metadataUpdate?: EntityMetadataUpdate): Promise<T | undefined>;
|
|
290
329
|
/**
|
|
291
330
|
* Deletes multiple entities by their IDs (soft delete if metadata is available).
|
|
292
331
|
* @param ids An array of entity IDs to delete.
|
|
332
|
+
* @param options Optional delete options.
|
|
293
333
|
* @param metadataUpdate Optional metadata update to apply during soft delete.
|
|
294
334
|
* @returns A promise that resolves to an array of the deleted entities.
|
|
295
335
|
*/
|
|
296
|
-
deleteMany(ids: string[], metadataUpdate?: EntityMetadataUpdate): Promise<T[]>;
|
|
336
|
+
deleteMany(ids: string[], options?: DeleteOptions<T>, metadataUpdate?: EntityMetadataUpdate): Promise<T[]>;
|
|
297
337
|
/**
|
|
298
338
|
* Deletes multiple entities matching a query (soft delete if metadata is available). Already deleted entities are ignored.
|
|
299
339
|
* @param query The query to filter entities.
|
|
340
|
+
* @param options Optional delete options.
|
|
300
341
|
* @param metadataUpdate Optional metadata update to apply during soft delete.
|
|
301
342
|
* @returns A promise that resolves to an array of the deleted entities.
|
|
302
343
|
*/
|
|
303
|
-
deleteManyByQuery(query: Query<T>, metadataUpdate?: EntityMetadataUpdate): Promise<T[]>;
|
|
344
|
+
deleteManyByQuery(query: Query<T>, options?: DeleteOptions<T>, metadataUpdate?: EntityMetadataUpdate): Promise<T[]>;
|
|
304
345
|
/**
|
|
305
346
|
* Hard deletes an entity by its ID (removes from the database).
|
|
306
347
|
* Throws `NotFoundError` if the entity is not found.
|
|
307
348
|
* @param id The ID of the entity to hard delete.
|
|
349
|
+
* @param options Optional delete options.
|
|
308
350
|
* @returns A promise that resolves to the hard deleted entity.
|
|
309
351
|
* @throws {NotFoundError} If the entity with the given ID is not found.
|
|
310
352
|
*/
|
|
311
|
-
hardDelete(id: string): Promise<T>;
|
|
353
|
+
hardDelete(id: string, options?: DeleteOptions<T>): Promise<T>;
|
|
312
354
|
/**
|
|
313
355
|
* Tries to hard delete an entity by its ID (removes from the database).
|
|
314
356
|
* Returns `undefined` if the entity is not found.
|
|
315
357
|
* @param id The ID of the entity to hard delete.
|
|
358
|
+
* @param options Optional delete options.
|
|
316
359
|
* @returns A promise that resolves to the hard deleted entity or `undefined` if not found.
|
|
317
360
|
*/
|
|
318
|
-
tryHardDelete(id: string): Promise<T | undefined>;
|
|
361
|
+
tryHardDelete(id: string, options?: DeleteOptions<T>): Promise<T | undefined>;
|
|
319
362
|
/**
|
|
320
363
|
* Hard deletes a single entity matching a query (removes from the database).
|
|
321
364
|
* Throws `NotFoundError` if no entity matches the query.
|
|
322
365
|
* @param query The query to filter entities.
|
|
366
|
+
* @param options Optional delete options.
|
|
323
367
|
* @returns A promise that resolves to the hard deleted entity.
|
|
324
368
|
* @throws {NotFoundError} If no entity matches the query.
|
|
325
369
|
*/
|
|
326
|
-
hardDeleteByQuery(query: Query<T>): Promise<T>;
|
|
370
|
+
hardDeleteByQuery(query: Query<T>, options?: DeleteOptions<T>): Promise<T>;
|
|
327
371
|
/**
|
|
328
372
|
* Tries to hard delete a single entity matching a query (removes from the database).
|
|
329
373
|
* Returns `undefined` if no entity matches the query.
|
|
330
374
|
* @param query The query to filter entities.
|
|
375
|
+
* @param options Optional delete options.
|
|
331
376
|
* @returns A promise that resolves to the hard deleted entity or `undefined` if not found.
|
|
332
377
|
*/
|
|
333
|
-
tryHardDeleteByQuery(query: Query<T>): Promise<T | undefined>;
|
|
378
|
+
tryHardDeleteByQuery(query: Query<T>, options?: DeleteOptions<T>): Promise<T | undefined>;
|
|
334
379
|
/**
|
|
335
380
|
* Hard deletes multiple entities by their IDs (removes from the database).
|
|
336
381
|
* @param ids An array of entity IDs to hard delete.
|
|
382
|
+
* @param options Optional delete options.
|
|
337
383
|
* @returns A promise that resolves to an array of the hard deleted entities.
|
|
338
384
|
*/
|
|
339
|
-
hardDeleteMany(ids: string[]): Promise<T[]>;
|
|
385
|
+
hardDeleteMany(ids: string[], options?: DeleteOptions<T>): Promise<T[]>;
|
|
340
386
|
/**
|
|
341
387
|
* Hard deletes multiple entities matching a query (removes from the database).
|
|
342
388
|
* @param query The query to filter entities.
|
|
389
|
+
* @param options Optional delete options.
|
|
343
390
|
* @returns A promise that resolves to an array of the hard deleted entities.
|
|
344
391
|
*/
|
|
345
|
-
hardDeleteManyByQuery(query: Query<T>): Promise<T[]>;
|
|
392
|
+
hardDeleteManyByQuery(query: Query<T>, options?: DeleteOptions<T>): Promise<T[]>;
|
|
346
393
|
/**
|
|
347
394
|
* Resolves a target column from an object path or column definition to a Drizzle SQL wrapper.
|
|
348
395
|
* @param target The object path or column definition.
|
|
@@ -376,18 +423,26 @@ export declare class EntityRepository<T extends BaseEntity = BaseEntity> extends
|
|
|
376
423
|
convertQuery(query: Query<T>, options?: {
|
|
377
424
|
withDeleted?: boolean;
|
|
378
425
|
}): SQL;
|
|
426
|
+
private _convertQuery;
|
|
427
|
+
private filterQuery;
|
|
379
428
|
/**
|
|
380
429
|
* Maps multiple database rows to an array of entities.
|
|
381
430
|
* @param columns An array of database rows.
|
|
431
|
+
* @param options Optional options, including `includeSubclasses` for polymorphic loading.
|
|
382
432
|
* @returns A promise that resolves to an array of entities.
|
|
383
433
|
*/
|
|
384
|
-
mapManyToEntity(columns: InferSelect[]
|
|
434
|
+
mapManyToEntity(columns: InferSelect[], options?: {
|
|
435
|
+
includeSubclasses?: boolean | EntityType[];
|
|
436
|
+
}): Promise<T[]>;
|
|
385
437
|
/**
|
|
386
438
|
* Maps a single database row to an entity.
|
|
387
439
|
* @param columns A database row.
|
|
440
|
+
* @param options Optional options, including `includeSubclasses` for polymorphic loading.
|
|
388
441
|
* @returns A promise that resolves to an entity.
|
|
389
442
|
*/
|
|
390
|
-
mapToEntity(columns: InferSelect
|
|
443
|
+
mapToEntity(columns: InferSelect, options?: {
|
|
444
|
+
includeSubclasses?: boolean | EntityType[];
|
|
445
|
+
}): Promise<T>;
|
|
391
446
|
/**
|
|
392
447
|
* Maps multiple entity-like objects to database column values for insertion or update.
|
|
393
448
|
* @param objects An array of entity-like objects.
|
|
@@ -422,9 +477,12 @@ export declare class EntityRepository<T extends BaseEntity = BaseEntity> extends
|
|
|
422
477
|
* Gets a Drizzle select query for the ID of a single entity matching the provided query, limited to 1 result.
|
|
423
478
|
* Useful for subqueries in update/delete operations targeting a single entity.
|
|
424
479
|
* @param query The query to filter entities.
|
|
480
|
+
* @param options Optional options (e.g., withDeleted).
|
|
425
481
|
* @returns A Drizzle select query for the entity ID.
|
|
426
482
|
*/
|
|
427
|
-
getIdLimitQuery(query: Query<T
|
|
483
|
+
getIdLimitQuery(query: Query<T>, options?: {
|
|
484
|
+
withDeleted?: boolean;
|
|
485
|
+
}): import("drizzle-orm/pg-core").PgSelectBase<string, {
|
|
428
486
|
id: PgColumn<{
|
|
429
487
|
name: string;
|
|
430
488
|
tableName: string;
|
|
@@ -442,7 +500,7 @@ export declare class EntityRepository<T extends BaseEntity = BaseEntity> extends
|
|
|
442
500
|
identity: undefined;
|
|
443
501
|
generated: undefined;
|
|
444
502
|
}, {}, {}>;
|
|
445
|
-
}, "partial", globalThis.Record<string, "not-null">,
|
|
503
|
+
}, "partial", globalThis.Record<string, "not-null">, true, never, {
|
|
446
504
|
id: string;
|
|
447
505
|
}[], {
|
|
448
506
|
id: PgColumn<{
|
|
@@ -462,20 +520,36 @@ export declare class EntityRepository<T extends BaseEntity = BaseEntity> extends
|
|
|
462
520
|
identity: undefined;
|
|
463
521
|
generated: undefined;
|
|
464
522
|
}, {}, {}>;
|
|
465
|
-
}
|
|
523
|
+
}>;
|
|
466
524
|
applySelect<TApplyTo extends Record<'select' | 'selectDistinct' | 'selectDistinctOn', Function<any[], PgSelectBuilder<any, any>>>>(applyTo: TApplyTo, distinct?: boolean | TargetColumn<T>[]): PgSelectBuilder<undefined, ReturnType<TApplyTo['selectDistinct']> extends PgSelectBuilder<any, infer TResult> ? TResult : never>;
|
|
467
525
|
applySelect<TApplyTo extends Record<'select' | 'selectDistinct' | 'selectDistinctOn', Function<any[], PgSelectBuilder<any, any>>>, TSelection extends SelectedFields>(applyTo: TApplyTo, selection: TSelection, distinct?: boolean | TargetColumn<T>[]): PgSelectBuilder<TSelection, ReturnType<TApplyTo['selectDistinct']> extends PgSelectBuilder<any, infer TResult> ? TResult : never>;
|
|
468
526
|
protected getAttributesUpdate(attributes: SQL | EntityMetadataAttributes | undefined): SQL<unknown> | undefined;
|
|
469
|
-
|
|
470
|
-
|
|
527
|
+
private applyJoins;
|
|
528
|
+
private getTablesChain;
|
|
529
|
+
protected _mapManyToEntity(columns: InferSelect[], transformContext: TransformContext, includeSubclasses?: boolean | EntityType[]): Promise<T[]>;
|
|
530
|
+
protected _mapToEntity(columns: InferSelect, transformContext: TransformContext, includeSubclasses?: boolean | EntityType[]): Promise<T>;
|
|
471
531
|
protected _mapManyToColumns(objects: (DeepPartial<T> | NewEntity<T>)[], transformContext: TransformContext): Promise<PgInsertValue<PgTableFromType>[]>;
|
|
472
|
-
protected
|
|
532
|
+
protected _mapToTableColumns(obj: DeepPartial<T> | NewEntity<T>, transformContext: TransformContext, definitions?: ColumnDefinition[]): Promise<PgInsertValue<PgTableFromType>>;
|
|
533
|
+
protected _mapToTableInsertColumns(obj: DeepPartial<T> | NewEntity<T>, transformContext: TransformContext, table: PgTableFromType, definitions?: ColumnDefinition[]): Promise<PgInsertValue<PgTableFromType>>;
|
|
473
534
|
protected _mapManyToInsertColumns(objects: (DeepPartial<T> | NewEntity<T>)[], transformContext: TransformContext): Promise<PgInsertValue<PgTableFromType>[]>;
|
|
474
535
|
protected _mapToInsertColumns(obj: DeepPartial<T> | NewEntity<T>, transformContext: TransformContext): Promise<PgInsertValue<PgTableFromType>>;
|
|
536
|
+
protected _mapToTableUpdate(update: EntityUpdate<T>, transformContext: TransformContext, table: AnyPgTable, definitions?: ColumnDefinition[]): Promise<PgUpdateSetSource<PgTableFromType>>;
|
|
475
537
|
protected _mapUpdate(update: EntityUpdate<T>, transformContext: TransformContext): Promise<PgUpdateSetSource<PgTableFromType>>;
|
|
476
538
|
protected _getMetadataUpdate(update?: EntityUpdate<T>): PgUpdateSetSource<PgTableFromType<EntityType<Entity>>> | undefined;
|
|
539
|
+
private prepareSubclassJoins;
|
|
540
|
+
private addSubclassColumnsToSelection;
|
|
541
|
+
private applySubclassJoins;
|
|
542
|
+
protected createBaseQuery(options?: TypedOmit<LoadManyOptions<T>, 'order'>, extraSelection?: SelectedFields): import("drizzle-orm/pg-core").PgSelectBase<string, {
|
|
543
|
+
[x: string]: SQL<unknown> | SQL.Aliased<unknown> | import("drizzle-orm").Subquery<string, globalThis.Record<string, unknown>> | PgColumn<import("drizzle-orm").ColumnBaseConfig<import("drizzle-orm").ColumnDataType, string>, {}, {}> | import("drizzle-orm/pg-core").PgTable<import("drizzle-orm/pg-core").TableConfig> | import("drizzle-orm").SelectedFieldsFlat<PgColumn<import("drizzle-orm").ColumnBaseConfig<import("drizzle-orm").ColumnDataType, string>, {}, {}>>;
|
|
544
|
+
}, "partial", globalThis.Record<string, "not-null">, true, never, {
|
|
545
|
+
[x: string]: unknown;
|
|
546
|
+
}[], {
|
|
547
|
+
[x: string]: never;
|
|
548
|
+
}>;
|
|
477
549
|
protected getTransformContext(): Promise<TransformContext>;
|
|
478
|
-
protected _mapSearchResults(rows: Record[], scoreTransformer?: (rawScore: any) => number | undefined
|
|
550
|
+
protected _mapSearchResults(rows: Record[], scoreTransformer?: (rawScore: any) => number | undefined, options?: {
|
|
551
|
+
includeSubclasses?: boolean | EntityType[];
|
|
552
|
+
}): Promise<SearchResult<T>[]>;
|
|
479
553
|
}
|
|
480
554
|
/**
|
|
481
555
|
* Injects an EntityRepository instance for the specified entity type.
|