metal-orm 1.0.118 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -14
- package/dist/index.cjs +728 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +419 -7
- package/dist/index.d.ts +419 -7
- package/dist/index.js +720 -17
- package/dist/index.js.map +1 -1
- package/package.json +7 -2
- package/src/cache/adapters/index.ts +2 -0
- package/src/cache/adapters/keyv-cache-adapter.ts +81 -0
- package/src/cache/adapters/memory-cache-adapter.ts +127 -0
- package/src/cache/cache-interfaces.ts +70 -0
- package/src/cache/duration-utils.ts +82 -0
- package/src/cache/index.ts +28 -0
- package/src/cache/query-cache-manager.ts +130 -0
- package/src/cache/strategies/cache-strategy.ts +29 -0
- package/src/cache/strategies/default-cache-strategy.ts +96 -0
- package/src/cache/strategies/index.ts +2 -0
- package/src/cache/tag-index.ts +128 -0
- package/src/core/dialect/abstract.ts +565 -565
- package/src/core/dialect/mssql/index.ts +68 -3
- package/src/core/dialect/postgres/index.ts +1 -1
- package/src/core/dialect/sqlite/index.ts +1 -1
- package/src/core/execution/db-executor.ts +107 -103
- package/src/core/execution/executors/mysql-executor.ts +9 -2
- package/src/index.ts +3 -0
- package/src/orm/orm-session.ts +616 -563
- package/src/orm/orm.ts +108 -71
- package/src/orm/unit-of-work.ts +22 -4
- package/src/query-builder/select/cache-facet.ts +67 -0
- package/src/query-builder/select.ts +125 -57
package/dist/index.d.cts
CHANGED
|
@@ -1847,7 +1847,7 @@ declare abstract class Dialect implements SelectCompiler, InsertCompiler, Update
|
|
|
1847
1847
|
compileInsert(ast: InsertQueryNode): CompiledQuery;
|
|
1848
1848
|
compileUpdate(ast: UpdateQueryNode): CompiledQuery;
|
|
1849
1849
|
compileDelete(ast: DeleteQueryNode): CompiledQuery;
|
|
1850
|
-
|
|
1850
|
+
supportsDmlReturningClause(): boolean;
|
|
1851
1851
|
/**
|
|
1852
1852
|
* Compiles SELECT query AST to SQL (to be implemented by concrete dialects)
|
|
1853
1853
|
* @param ast - Query AST
|
|
@@ -2693,6 +2693,10 @@ type NormalizedRelationIncludeTree = Record<string, NormalizedRelationIncludeNod
|
|
|
2693
2693
|
type QueryResult = {
|
|
2694
2694
|
columns: string[];
|
|
2695
2695
|
values: unknown[][];
|
|
2696
|
+
meta?: {
|
|
2697
|
+
insertId?: number | string;
|
|
2698
|
+
rowsAffected?: number;
|
|
2699
|
+
};
|
|
2696
2700
|
};
|
|
2697
2701
|
interface DbExecutor {
|
|
2698
2702
|
/** Capability flags so the runtime can make correct decisions without relying on optional methods. */
|
|
@@ -3006,6 +3010,313 @@ declare class InterceptorPipeline {
|
|
|
3006
3010
|
run(ctx: QueryContext, executor: DbExecutor): Promise<QueryResult[]>;
|
|
3007
3011
|
}
|
|
3008
3012
|
|
|
3013
|
+
/**
|
|
3014
|
+
* Interfaces segregadas para cache (ISP - Interface Segregation Principle)
|
|
3015
|
+
*/
|
|
3016
|
+
/**
|
|
3017
|
+
* Leitura de cache - pode ser implementada por read-replicas
|
|
3018
|
+
*/
|
|
3019
|
+
interface CacheReader {
|
|
3020
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
3021
|
+
has(key: string): Promise<boolean>;
|
|
3022
|
+
}
|
|
3023
|
+
/**
|
|
3024
|
+
* Escrita em cache - pode ser implementada por write-nodes
|
|
3025
|
+
*/
|
|
3026
|
+
interface CacheWriter {
|
|
3027
|
+
set<T>(key: string, value: T, ttlMs?: number): Promise<void>;
|
|
3028
|
+
delete(key: string): Promise<void>;
|
|
3029
|
+
}
|
|
3030
|
+
/**
|
|
3031
|
+
* Invalidação em massa - separada pois nem todo cache suporta tags
|
|
3032
|
+
*/
|
|
3033
|
+
interface CacheInvalidator {
|
|
3034
|
+
invalidate(key: string): Promise<void>;
|
|
3035
|
+
invalidateTags(tags: string[]): Promise<void>;
|
|
3036
|
+
invalidatePrefix(prefix: string): Promise<void>;
|
|
3037
|
+
}
|
|
3038
|
+
/**
|
|
3039
|
+
* Interface completa para implementações full-featured
|
|
3040
|
+
*/
|
|
3041
|
+
interface CacheProvider extends CacheReader, CacheWriter, CacheInvalidator {
|
|
3042
|
+
readonly name: string;
|
|
3043
|
+
dispose?(): Promise<void>;
|
|
3044
|
+
}
|
|
3045
|
+
/**
|
|
3046
|
+
* TTL human-readable: '1d', '2h', '30m', '15s', '1w'
|
|
3047
|
+
* Ou número em milissegundos
|
|
3048
|
+
*/
|
|
3049
|
+
type Duration = number | `${number}${'s' | 'm' | 'h' | 'd' | 'w'}`;
|
|
3050
|
+
/**
|
|
3051
|
+
* Opções de cache para uma query
|
|
3052
|
+
*/
|
|
3053
|
+
interface CacheOptions {
|
|
3054
|
+
key: string;
|
|
3055
|
+
ttl: Duration;
|
|
3056
|
+
tags?: string[];
|
|
3057
|
+
autoInvalidate?: boolean;
|
|
3058
|
+
condition?: (result: unknown) => boolean;
|
|
3059
|
+
}
|
|
3060
|
+
/**
|
|
3061
|
+
* Estratégias de invalidação disponíveis
|
|
3062
|
+
*/
|
|
3063
|
+
type InvalidationStrategy = 'tags' | 'entity' | 'prefix' | 'key' | 'ttl';
|
|
3064
|
+
/**
|
|
3065
|
+
* Estado interno do cache no query builder
|
|
3066
|
+
*/
|
|
3067
|
+
interface CacheState {
|
|
3068
|
+
options?: CacheOptions;
|
|
3069
|
+
}
|
|
3070
|
+
|
|
3071
|
+
/**
|
|
3072
|
+
* Estratégia de cache - define como chaves são geradas,
|
|
3073
|
+
* dados são serializados/desserializados e se devem ser cacheados
|
|
3074
|
+
*/
|
|
3075
|
+
interface CacheStrategy {
|
|
3076
|
+
readonly name: string;
|
|
3077
|
+
/**
|
|
3078
|
+
* Gera chave de cache considerando tenant
|
|
3079
|
+
*/
|
|
3080
|
+
generateKey(queryKey: string, tenantId?: string | number): string;
|
|
3081
|
+
/**
|
|
3082
|
+
* Decide se o resultado deve ser cacheado
|
|
3083
|
+
*/
|
|
3084
|
+
shouldCache(result: unknown, options: CacheOptions): boolean;
|
|
3085
|
+
/**
|
|
3086
|
+
* Serializa dados para armazenamento
|
|
3087
|
+
*/
|
|
3088
|
+
serialize<T>(data: T): unknown;
|
|
3089
|
+
/**
|
|
3090
|
+
* Desserializa dados do cache
|
|
3091
|
+
*/
|
|
3092
|
+
deserialize<T>(data: unknown): T;
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
/**
|
|
3096
|
+
* Gerenciador de cache para queries
|
|
3097
|
+
* Responsabilidade única: orquestrar leitura/escrita no cache (SRP)
|
|
3098
|
+
*/
|
|
3099
|
+
declare class QueryCacheManager {
|
|
3100
|
+
private provider;
|
|
3101
|
+
private strategy;
|
|
3102
|
+
private defaultTtl;
|
|
3103
|
+
constructor(provider?: CacheProvider, strategy?: CacheStrategy, defaultTtl?: Duration);
|
|
3104
|
+
/**
|
|
3105
|
+
* Executa com cache - padrão execute-around
|
|
3106
|
+
* @returns Resultado da execução (do cache ou da função)
|
|
3107
|
+
*/
|
|
3108
|
+
getOrExecute<T>(options: CacheOptions, executor: () => Promise<T>, tenantId?: string | number): Promise<T>;
|
|
3109
|
+
/**
|
|
3110
|
+
* Invalida uma chave específica
|
|
3111
|
+
*/
|
|
3112
|
+
invalidateKey(key: string, tenantId?: string | number): Promise<void>;
|
|
3113
|
+
/**
|
|
3114
|
+
* Invalida por tags
|
|
3115
|
+
*/
|
|
3116
|
+
invalidateTags(tags: string[]): Promise<void>;
|
|
3117
|
+
/**
|
|
3118
|
+
* Invalida por prefixo (útil para multi-tenancy)
|
|
3119
|
+
*/
|
|
3120
|
+
invalidatePrefix(prefix: string): Promise<void>;
|
|
3121
|
+
/**
|
|
3122
|
+
* Limpa todo o cache (cuidado!)
|
|
3123
|
+
*/
|
|
3124
|
+
clear(): Promise<void>;
|
|
3125
|
+
/**
|
|
3126
|
+
* Retorna estatísticas do cache (se disponível)
|
|
3127
|
+
*/
|
|
3128
|
+
getStats(): {
|
|
3129
|
+
size: number;
|
|
3130
|
+
tags: number;
|
|
3131
|
+
} | undefined;
|
|
3132
|
+
/**
|
|
3133
|
+
* Libera recursos do cache
|
|
3134
|
+
*/
|
|
3135
|
+
dispose(): Promise<void>;
|
|
3136
|
+
/**
|
|
3137
|
+
* Registra tags para uma chave
|
|
3138
|
+
*/
|
|
3139
|
+
private registerTags;
|
|
3140
|
+
/**
|
|
3141
|
+
* Converte duração para milissegundos
|
|
3142
|
+
*/
|
|
3143
|
+
private parseDuration;
|
|
3144
|
+
}
|
|
3145
|
+
|
|
3146
|
+
/**
|
|
3147
|
+
* Parse de duração human-readable para milissegundos
|
|
3148
|
+
* @param duration - Número (ms) ou string no formato '30s', '10m', '2h', '1d', '1w'
|
|
3149
|
+
* @returns Tempo em milissegundos
|
|
3150
|
+
* @throws Error se o formato for inválido
|
|
3151
|
+
*
|
|
3152
|
+
* @example
|
|
3153
|
+
* parseDuration(60000) // 60000
|
|
3154
|
+
* parseDuration('30s') // 30000
|
|
3155
|
+
* parseDuration('10m') // 600000
|
|
3156
|
+
* parseDuration('2h') // 7200000
|
|
3157
|
+
* parseDuration('1d') // 86400000
|
|
3158
|
+
* parseDuration('1w') // 604800000
|
|
3159
|
+
*/
|
|
3160
|
+
declare function parseDuration(duration: Duration): number;
|
|
3161
|
+
/**
|
|
3162
|
+
* Converte milissegundos para formato human-readable
|
|
3163
|
+
* @param ms - Tempo em milissegundos
|
|
3164
|
+
* @returns String no formato mais apropriado
|
|
3165
|
+
*
|
|
3166
|
+
* @example
|
|
3167
|
+
* formatDuration(30000) // '30s'
|
|
3168
|
+
* formatDuration(600000) // '10m'
|
|
3169
|
+
* formatDuration(7200000) // '2h'
|
|
3170
|
+
*/
|
|
3171
|
+
declare function formatDuration(ms: number): string;
|
|
3172
|
+
/**
|
|
3173
|
+
* Valida se uma string é uma duração válida
|
|
3174
|
+
* @param value - Valor a ser validado
|
|
3175
|
+
* @returns true se for uma duração válida
|
|
3176
|
+
*/
|
|
3177
|
+
declare function isValidDuration(value: unknown): value is Duration;
|
|
3178
|
+
|
|
3179
|
+
/**
|
|
3180
|
+
* Implementação padrão da estratégia de cache
|
|
3181
|
+
* Suporta serialização de Date, BigInt e multi-tenancy
|
|
3182
|
+
*/
|
|
3183
|
+
declare class DefaultCacheStrategy implements CacheStrategy {
|
|
3184
|
+
readonly name = "default";
|
|
3185
|
+
/**
|
|
3186
|
+
* Gera chave de cache com prefixo de tenant se houver
|
|
3187
|
+
*/
|
|
3188
|
+
generateKey(queryKey: string, tenantId?: string | number): string;
|
|
3189
|
+
/**
|
|
3190
|
+
* Verifica se deve cachear baseado na condição configurada
|
|
3191
|
+
*/
|
|
3192
|
+
shouldCache(result: unknown, options: CacheOptions): boolean;
|
|
3193
|
+
/**
|
|
3194
|
+
* Serializa com suporte a tipos especiais
|
|
3195
|
+
*/
|
|
3196
|
+
serialize<T>(data: T): unknown;
|
|
3197
|
+
/**
|
|
3198
|
+
* Desserializa restaurando tipos especiais
|
|
3199
|
+
*/
|
|
3200
|
+
deserialize<T>(data: unknown): T;
|
|
3201
|
+
}
|
|
3202
|
+
|
|
3203
|
+
/**
|
|
3204
|
+
* Implementação em memória do cache provider
|
|
3205
|
+
* Útil para testes e ambientes de desenvolvimento
|
|
3206
|
+
*/
|
|
3207
|
+
declare class MemoryCacheAdapter implements CacheProvider {
|
|
3208
|
+
readonly name = "memory";
|
|
3209
|
+
private storage;
|
|
3210
|
+
private tagIndex;
|
|
3211
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
3212
|
+
has(key: string): Promise<boolean>;
|
|
3213
|
+
set<T>(key: string, value: T, ttlMs?: number): Promise<void>;
|
|
3214
|
+
delete(key: string): Promise<void>;
|
|
3215
|
+
invalidate(key: string): Promise<void>;
|
|
3216
|
+
invalidateTags(tags: string[]): Promise<void>;
|
|
3217
|
+
invalidatePrefix(prefix: string): Promise<void>;
|
|
3218
|
+
/**
|
|
3219
|
+
* Registra uma chave com tags (para invalidação)
|
|
3220
|
+
*/
|
|
3221
|
+
registerTags(key: string, tags: string[]): void;
|
|
3222
|
+
/**
|
|
3223
|
+
* Limpa todo o cache
|
|
3224
|
+
*/
|
|
3225
|
+
clear(): void;
|
|
3226
|
+
/**
|
|
3227
|
+
* Retorna estatísticas do cache
|
|
3228
|
+
*/
|
|
3229
|
+
getStats(): {
|
|
3230
|
+
size: number;
|
|
3231
|
+
tags: number;
|
|
3232
|
+
};
|
|
3233
|
+
dispose(): Promise<void>;
|
|
3234
|
+
}
|
|
3235
|
+
|
|
3236
|
+
/**
|
|
3237
|
+
* Interface mínima para Keyv
|
|
3238
|
+
* Usa unknown para permitir diferentes versões do Keyv
|
|
3239
|
+
*/
|
|
3240
|
+
interface KeyvInstance {
|
|
3241
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
3242
|
+
set<T>(key: string, value: T, ttl?: number): Promise<boolean | void>;
|
|
3243
|
+
delete(key: string): Promise<boolean>;
|
|
3244
|
+
iterator?: unknown;
|
|
3245
|
+
disconnect?(): Promise<void>;
|
|
3246
|
+
}
|
|
3247
|
+
/**
|
|
3248
|
+
* Adapter para Keyv (Redis, SQLite, etc.)
|
|
3249
|
+
* Keyv deve ser instalado separadamente:
|
|
3250
|
+
* npm install keyv @keyv/redis
|
|
3251
|
+
*/
|
|
3252
|
+
declare class KeyvCacheAdapter implements CacheProvider {
|
|
3253
|
+
private keyv;
|
|
3254
|
+
readonly name = "keyv";
|
|
3255
|
+
constructor(keyv: KeyvInstance);
|
|
3256
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
3257
|
+
has(key: string): Promise<boolean>;
|
|
3258
|
+
set<T>(key: string, value: T, ttlMs?: number): Promise<void>;
|
|
3259
|
+
delete(key: string): Promise<void>;
|
|
3260
|
+
invalidate(key: string): Promise<void>;
|
|
3261
|
+
invalidateTags(_tags: string[]): Promise<void>;
|
|
3262
|
+
invalidatePrefix(prefix: string): Promise<void>;
|
|
3263
|
+
dispose(): Promise<void>;
|
|
3264
|
+
}
|
|
3265
|
+
|
|
3266
|
+
/**
|
|
3267
|
+
* Indexa chaves por tags para invalidação em massa
|
|
3268
|
+
* Implementação em memória (pode ser persistida no Redis)
|
|
3269
|
+
*/
|
|
3270
|
+
declare class TagIndex {
|
|
3271
|
+
private tagToKeys;
|
|
3272
|
+
private keyToTags;
|
|
3273
|
+
/**
|
|
3274
|
+
* Registra que uma chave pertence a determinadas tags
|
|
3275
|
+
*/
|
|
3276
|
+
register(key: string, tags: string[]): void;
|
|
3277
|
+
/**
|
|
3278
|
+
* Remove uma chave do índice
|
|
3279
|
+
*/
|
|
3280
|
+
unregister(key: string): void;
|
|
3281
|
+
/**
|
|
3282
|
+
* Obtém todas as chaves de uma tag
|
|
3283
|
+
*/
|
|
3284
|
+
getKeysByTag(tag: string): string[];
|
|
3285
|
+
/**
|
|
3286
|
+
* Obtém todas as tags de uma chave
|
|
3287
|
+
*/
|
|
3288
|
+
getTagsByKey(key: string): string[];
|
|
3289
|
+
/**
|
|
3290
|
+
* Invalida todas as chaves de um conjunto de tags
|
|
3291
|
+
* Retorna as chaves afetadas
|
|
3292
|
+
*/
|
|
3293
|
+
invalidateTags(tags: string[]): string[];
|
|
3294
|
+
/**
|
|
3295
|
+
* Invalida por prefixo (útil para multi-tenancy)
|
|
3296
|
+
* Retorna as chaves afetadas
|
|
3297
|
+
*/
|
|
3298
|
+
invalidatePrefix(prefix: string): string[];
|
|
3299
|
+
/**
|
|
3300
|
+
* Retorna todas as tags registradas
|
|
3301
|
+
*/
|
|
3302
|
+
getAllTags(): string[];
|
|
3303
|
+
/**
|
|
3304
|
+
* Retorna todas as chaves registradas
|
|
3305
|
+
*/
|
|
3306
|
+
getAllKeys(): string[];
|
|
3307
|
+
/**
|
|
3308
|
+
* Limpa todo o índice
|
|
3309
|
+
*/
|
|
3310
|
+
clear(): void;
|
|
3311
|
+
/**
|
|
3312
|
+
* Retorna estatísticas do índice
|
|
3313
|
+
*/
|
|
3314
|
+
getStats(): {
|
|
3315
|
+
tags: number;
|
|
3316
|
+
keys: number;
|
|
3317
|
+
};
|
|
3318
|
+
}
|
|
3319
|
+
|
|
3009
3320
|
/**
|
|
3010
3321
|
* Options for creating an ORM instance.
|
|
3011
3322
|
*/
|
|
@@ -3018,6 +3329,19 @@ interface OrmOptions {
|
|
|
3018
3329
|
interceptors?: InterceptorPipeline;
|
|
3019
3330
|
/** Optional naming strategy */
|
|
3020
3331
|
namingStrategy?: NamingStrategy;
|
|
3332
|
+
/** Optional cache configuration */
|
|
3333
|
+
cache?: OrmCacheOptions;
|
|
3334
|
+
}
|
|
3335
|
+
/**
|
|
3336
|
+
* Cache configuration options for ORM
|
|
3337
|
+
*/
|
|
3338
|
+
interface OrmCacheOptions {
|
|
3339
|
+
/** Cache provider (e.g., MemoryCacheAdapter, KeyvCacheAdapter) */
|
|
3340
|
+
provider: CacheProvider;
|
|
3341
|
+
/** Optional cache strategy (defaults to DefaultCacheStrategy) */
|
|
3342
|
+
strategy?: CacheStrategy;
|
|
3343
|
+
/** Default TTL for cached queries (e.g., '1h', '30m') */
|
|
3344
|
+
defaultTtl?: Duration;
|
|
3021
3345
|
}
|
|
3022
3346
|
/**
|
|
3023
3347
|
* Database executor factory interface.
|
|
@@ -3049,6 +3373,8 @@ declare class Orm<E extends DomainEvent = OrmDomainEvent> {
|
|
|
3049
3373
|
readonly interceptors: InterceptorPipeline;
|
|
3050
3374
|
/** The naming strategy */
|
|
3051
3375
|
readonly namingStrategy: NamingStrategy;
|
|
3376
|
+
/** The cache manager (if configured) */
|
|
3377
|
+
readonly cacheManager?: QueryCacheManager;
|
|
3052
3378
|
private readonly executorFactory;
|
|
3053
3379
|
/**
|
|
3054
3380
|
* Creates a new ORM instance.
|
|
@@ -3057,10 +3383,12 @@ declare class Orm<E extends DomainEvent = OrmDomainEvent> {
|
|
|
3057
3383
|
constructor(opts: OrmOptions);
|
|
3058
3384
|
/**
|
|
3059
3385
|
* Creates a new ORM session.
|
|
3060
|
-
* @param options - Optional session options
|
|
3386
|
+
* @param options - Optional session options (e.g., tenantId for multi-tenancy)
|
|
3061
3387
|
* @returns The ORM session
|
|
3062
3388
|
*/
|
|
3063
|
-
createSession(
|
|
3389
|
+
createSession(options?: {
|
|
3390
|
+
tenantId?: string | number;
|
|
3391
|
+
}): OrmSession<E>;
|
|
3064
3392
|
/**
|
|
3065
3393
|
* Executes a function within a transaction.
|
|
3066
3394
|
* @template T - The return type
|
|
@@ -3306,6 +3634,13 @@ declare class UnitOfWork {
|
|
|
3306
3634
|
* @param results - Query results
|
|
3307
3635
|
*/
|
|
3308
3636
|
private applyReturningResults;
|
|
3637
|
+
/**
|
|
3638
|
+
* Applies the driver-provided insertId when no RETURNING clause was used.
|
|
3639
|
+
* Only sets the PK if it is currently absent on the entity.
|
|
3640
|
+
* @param tracked - The tracked entity
|
|
3641
|
+
* @param results - Query results (may contain meta.insertId)
|
|
3642
|
+
*/
|
|
3643
|
+
private applyInsertedIdIfAbsent;
|
|
3309
3644
|
/**
|
|
3310
3645
|
* Normalizes a column name by removing quotes and table prefixes.
|
|
3311
3646
|
* @param column - The column name to normalize
|
|
@@ -3641,6 +3976,10 @@ interface OrmSessionOptions<E extends DomainEvent = OrmDomainEvent> {
|
|
|
3641
3976
|
interceptors?: OrmInterceptor[];
|
|
3642
3977
|
/** Optional domain event handlers */
|
|
3643
3978
|
domainEventHandlers?: InitialHandlers<E, OrmSession<E>>;
|
|
3979
|
+
/** Optional cache manager for query caching */
|
|
3980
|
+
cacheManager?: QueryCacheManager;
|
|
3981
|
+
/** Optional tenant ID for multi-tenancy */
|
|
3982
|
+
tenantId?: string | number;
|
|
3644
3983
|
}
|
|
3645
3984
|
interface SaveGraphSessionOptions extends SaveGraphOptions {
|
|
3646
3985
|
/** Wrap the save operation in a transaction (default: true). */
|
|
@@ -3665,6 +4004,10 @@ declare class OrmSession<E extends DomainEvent = OrmDomainEvent> implements Enti
|
|
|
3665
4004
|
readonly domainEvents: DomainEventBus<E, OrmSession<E>>;
|
|
3666
4005
|
/** The relation change processor */
|
|
3667
4006
|
readonly relationChanges: RelationChangeProcessor;
|
|
4007
|
+
/** The cache manager for query caching */
|
|
4008
|
+
readonly cacheManager?: QueryCacheManager;
|
|
4009
|
+
/** The tenant ID for multi-tenancy support */
|
|
4010
|
+
readonly tenantId?: string | number;
|
|
3668
4011
|
private readonly interceptors;
|
|
3669
4012
|
private saveGraphDefaults?;
|
|
3670
4013
|
/**
|
|
@@ -3863,6 +4206,30 @@ declare class OrmSession<E extends DomainEvent = OrmDomainEvent> implements Enti
|
|
|
3863
4206
|
* @returns The hydration context
|
|
3864
4207
|
*/
|
|
3865
4208
|
getHydrationContext(): HydrationContext<E>;
|
|
4209
|
+
/**
|
|
4210
|
+
* Invalidates cache by specific tags.
|
|
4211
|
+
* @param tags - Tags to invalidate
|
|
4212
|
+
* @throws Error if no cache manager is configured
|
|
4213
|
+
* @example
|
|
4214
|
+
* await session.invalidateCacheTags(['users', 'dashboard']);
|
|
4215
|
+
*/
|
|
4216
|
+
invalidateCacheTags(tags: string[]): Promise<void>;
|
|
4217
|
+
/**
|
|
4218
|
+
* Invalidates cache by key prefix (useful for multi-tenancy).
|
|
4219
|
+
* @param prefix - Prefix to match cache keys
|
|
4220
|
+
* @throws Error if no cache manager is configured
|
|
4221
|
+
* @example
|
|
4222
|
+
* await session.invalidateCachePrefix('tenant:123:');
|
|
4223
|
+
*/
|
|
4224
|
+
invalidateCachePrefix(prefix: string): Promise<void>;
|
|
4225
|
+
/**
|
|
4226
|
+
* Invalidates a specific cache key.
|
|
4227
|
+
* @param key - Cache key to invalidate
|
|
4228
|
+
* @throws Error if no cache manager is configured
|
|
4229
|
+
* @example
|
|
4230
|
+
* await session.invalidateCacheKey('active_users');
|
|
4231
|
+
*/
|
|
4232
|
+
invalidateCacheKey(key: string): Promise<void>;
|
|
3866
4233
|
/**
|
|
3867
4234
|
* Merges session defaults with per-call saveGraph options.
|
|
3868
4235
|
* @param options - Per-call saveGraph options
|
|
@@ -3882,6 +4249,14 @@ interface PaginatedResult<T> {
|
|
|
3882
4249
|
pageSize: number;
|
|
3883
4250
|
}
|
|
3884
4251
|
|
|
4252
|
+
/**
|
|
4253
|
+
* Facet para gerenciar estado de cache no SelectQueryBuilder
|
|
4254
|
+
* Segue o padrão de facets existente no projeto
|
|
4255
|
+
*/
|
|
4256
|
+
interface CacheFacetContext {
|
|
4257
|
+
state: CacheState;
|
|
4258
|
+
}
|
|
4259
|
+
|
|
3885
4260
|
type SelectDialectInput = Dialect | DialectKey;
|
|
3886
4261
|
|
|
3887
4262
|
type ColumnSelectionValue = ColumnDef | FunctionNode | CaseExpressionNode | WindowFunctionNode | TypedExpression<unknown>;
|
|
@@ -3919,6 +4294,8 @@ declare class SelectQueryBuilder<T = EntityInstance<TableDef>, TTable extends Ta
|
|
|
3919
4294
|
private readonly lazyRelationOptions;
|
|
3920
4295
|
private readonly entityConstructor?;
|
|
3921
4296
|
private readonly includeTree;
|
|
4297
|
+
private readonly cacheFacet;
|
|
4298
|
+
private readonly cacheContext;
|
|
3922
4299
|
/**
|
|
3923
4300
|
* Creates a new SelectQueryBuilder instance
|
|
3924
4301
|
* @param table - Table definition to query
|
|
@@ -3926,7 +4303,7 @@ declare class SelectQueryBuilder<T = EntityInstance<TableDef>, TTable extends Ta
|
|
|
3926
4303
|
* @param hydration - Optional hydration manager
|
|
3927
4304
|
* @param dependencies - Optional query builder dependencies
|
|
3928
4305
|
*/
|
|
3929
|
-
constructor(table: TTable, state?: SelectQueryState, hydration?: HydrationManager, dependencies?: Partial<SelectQueryBuilderDependencies>, lazyRelations?: Set<string>, lazyRelationOptions?: Map<string, RelationIncludeOptions>, entityConstructor?: EntityConstructor, includeTree?: NormalizedRelationIncludeTree);
|
|
4306
|
+
constructor(table: TTable, state?: SelectQueryState, hydration?: HydrationManager, dependencies?: Partial<SelectQueryBuilderDependencies>, lazyRelations?: Set<string>, lazyRelationOptions?: Map<string, RelationIncludeOptions>, entityConstructor?: EntityConstructor, includeTree?: NormalizedRelationIncludeTree, cacheContext?: CacheFacetContext);
|
|
3930
4307
|
/**
|
|
3931
4308
|
* Creates a new SelectQueryBuilder instance with updated context and lazy relations
|
|
3932
4309
|
* @param context - Updated query context
|
|
@@ -4247,10 +4624,35 @@ declare class SelectQueryBuilder<T = EntityInstance<TableDef>, TTable extends Ta
|
|
|
4247
4624
|
* Ensures that if no columns are selected, all columns from the table are selected by default.
|
|
4248
4625
|
*/
|
|
4249
4626
|
private ensureDefaultSelection;
|
|
4627
|
+
/**
|
|
4628
|
+
* Configures caching for this query.
|
|
4629
|
+
* @param key - Unique cache key
|
|
4630
|
+
* @param ttl - Time-to-live (e.g., '1h', '30m', '1d') or milliseconds
|
|
4631
|
+
* @param tagsOrConfig - Optional tags for invalidation or configuration object
|
|
4632
|
+
* @returns New query builder instance with cache configuration
|
|
4633
|
+
* @example
|
|
4634
|
+
* // Simple cache with TTL
|
|
4635
|
+
* await selectFrom(User).cache('active_users', '1h').execute(session);
|
|
4636
|
+
*
|
|
4637
|
+
* // Cache with tags for invalidation
|
|
4638
|
+
* await selectFrom(User)
|
|
4639
|
+
* .cache('users_list', '30m', ['users', 'dashboard'])
|
|
4640
|
+
* .execute(session);
|
|
4641
|
+
*
|
|
4642
|
+
* // Cache with auto-invalidation
|
|
4643
|
+
* await selectFrom(User)
|
|
4644
|
+
* .cache('users_list', '1h', { autoInvalidate: true })
|
|
4645
|
+
* .execute(session);
|
|
4646
|
+
*/
|
|
4647
|
+
cache(key: string, ttl: Duration, tagsOrConfig?: string[] | {
|
|
4648
|
+
tags?: string[];
|
|
4649
|
+
autoInvalidate?: boolean;
|
|
4650
|
+
}): SelectQueryBuilder<T, TTable>;
|
|
4250
4651
|
/**
|
|
4251
4652
|
* Executes the query and returns hydrated results.
|
|
4252
4653
|
* If the builder was created with an entity constructor (e.g. via selectFromEntity),
|
|
4253
4654
|
* this will automatically return fully materialized entity instances.
|
|
4655
|
+
* If caching is configured, results will be cached/retrieved from cache.
|
|
4254
4656
|
*
|
|
4255
4657
|
* @param ctx - ORM session context
|
|
4256
4658
|
* @returns Promise of entity instances (or objects if generic T is not an entity)
|
|
@@ -4260,6 +4662,10 @@ declare class SelectQueryBuilder<T = EntityInstance<TableDef>, TTable extends Ta
|
|
|
4260
4662
|
* users[0] instanceof User; // true
|
|
4261
4663
|
*/
|
|
4262
4664
|
execute(ctx: OrmSession): Promise<T[]>;
|
|
4665
|
+
/**
|
|
4666
|
+
* Executa a query sem cache (método interno)
|
|
4667
|
+
*/
|
|
4668
|
+
private executeWithoutCache;
|
|
4263
4669
|
/**
|
|
4264
4670
|
* Executes the query and returns plain row objects (POJOs), ignoring any entity materialization.
|
|
4265
4671
|
* Use this if you want raw data even when using selectFromEntity.
|
|
@@ -5141,9 +5547,15 @@ declare class SqlServerDialect extends SqlDialectBase {
|
|
|
5141
5547
|
*/
|
|
5142
5548
|
protected compileSelectAst(ast: SelectQueryNode, ctx: CompilerContext): string;
|
|
5143
5549
|
protected compileDeleteAst(ast: DeleteQueryNode, ctx: CompilerContext): string;
|
|
5550
|
+
protected compileUpdateAst(ast: UpdateQueryNode, ctx: CompilerContext): string;
|
|
5144
5551
|
private compileSelectCoreForMssql;
|
|
5145
5552
|
private compileOrderBy;
|
|
5146
5553
|
private compilePagination;
|
|
5554
|
+
supportsDmlReturningClause(): boolean;
|
|
5555
|
+
protected compileReturning(returning: ColumnNode[] | undefined, _ctx: CompilerContext): string;
|
|
5556
|
+
private compileOutputClause;
|
|
5557
|
+
protected compileInsertAst(ast: InsertQueryNode, ctx: CompilerContext): string;
|
|
5558
|
+
private compileInsertValues;
|
|
5147
5559
|
private compileCtes;
|
|
5148
5560
|
}
|
|
5149
5561
|
|
|
@@ -5171,7 +5583,7 @@ declare class SqliteDialect extends SqlDialectBase {
|
|
|
5171
5583
|
protected compileQualifiedColumn(column: ColumnNode, _table: TableNode): string;
|
|
5172
5584
|
protected compileReturning(returning: ColumnNode[] | undefined, ctx: CompilerContext): string;
|
|
5173
5585
|
protected formatReturningColumns(returning: ColumnNode[]): string;
|
|
5174
|
-
|
|
5586
|
+
supportsDmlReturningClause(): boolean;
|
|
5175
5587
|
}
|
|
5176
5588
|
|
|
5177
5589
|
/**
|
|
@@ -5197,7 +5609,7 @@ declare class PostgresDialect extends SqlDialectBase {
|
|
|
5197
5609
|
*/
|
|
5198
5610
|
protected compileJsonPath(node: JsonPathNode): string;
|
|
5199
5611
|
protected compileReturning(returning: ColumnNode[] | undefined, ctx: CompilerContext): string;
|
|
5200
|
-
|
|
5612
|
+
supportsDmlReturningClause(): boolean;
|
|
5201
5613
|
/**
|
|
5202
5614
|
* PostgreSQL requires unqualified column names in SET clause
|
|
5203
5615
|
*/
|
|
@@ -9099,4 +9511,4 @@ declare function setTreeBounds(entity: object, config: TreeConfig, lft: number,
|
|
|
9099
9511
|
*/
|
|
9100
9512
|
declare function setTreeParentId(entity: object, config: TreeConfig, parentId: unknown): void;
|
|
9101
9513
|
|
|
9102
|
-
export { type AliasRefNode, Alphanumeric, type AnyDomainEvent, type ApiRouteDefinition, type ApplyFilterOptions, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, type AutoCorrectionResult, type AutoTransformResult, type AutoTransformableValidator, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToReferenceApi, type BelongsToRelation, type BetweenExpressionNode, BigIntTypeStrategy, type BinaryExpressionNode, BinaryTypeStrategy, type BitwiseExpressionNode, type BooleanFilter, BooleanTypeStrategy, CEP, CNPJ, CPF, Capitalize, type CascadeMode, type CaseExpressionNode, type CastExpressionNode, type CheckConstraint, type CollateExpressionNode, Column, type ColumnDef, type ColumnDiff, type ColumnInput, type ColumnNode, type ColumnOptions, type ColumnRef, type ColumnToTs, type ColumnType, type ComponentOptions, type ComponentReference, type CompositeTransformer, ConstructorMaterializationStrategy, type ValidationResult as CountryValidationResult, type CountryValidator, type CountryValidatorFactory, type CreateDto, type CreateTediousClientOptions, DEFAULT_TREE_CONFIG, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DatabaseView, type DateFilter, DateTimeTypeStrategy, type DbExecutor, type DbExecutorFactory, DecimalTypeStrategy, type DecoratedEntityInstance, DefaultBelongsToReference, DefaultEntityMaterializer, DefaultHasManyCollection, DefaultManyToManyCollection, DefaultTypeStrategy, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, type Dto, Email, Entity, type EntityContext, type EntityInstance, type EntityMaterializationStrategy, type EntityMaterializer, type EntityOptions, type PrimaryKey$1 as EntityPrimaryKey, EntityStatus, type ExecutionContext, type ExistsExpressionNode, type ExpressionNode, type ExpressionVisitor, type FieldFilter, type FilterOperator, type FilterValue, type FindChildrenOptions, type FindPathOptions, type ForeignKeyReference, type FunctionNode, type GroupConcatOptions, type HasDomainEvents, HasMany, type HasManyCollection, type HasManyOptions, type HasManyRelation, HasOne, type HasOneOptions, type HasOneReference, type HasOneReferenceApi, type HasOneRelation, type HydrationContext, type HydrationMetadata, type HydrationPivotPlan, type HydrationPlan, type HydrationRelationPlan, type InExpressionNode, type InExpressionRight, type IndexColumn, type IndexDef, type InferRow, type InitialHandlers, InsertQueryBuilder, IntegerTypeStrategy, InterceptorPipeline, type IntrospectOptions, type JsonArray, type JsonObject, type JsonPathNode, type JsonValue, type Jsonify, type JsonifyScalar, Length, type LiteralNode, type LiteralValue, type LogicalExpressionNode, Lower, type ManyToManyCollection, type MoveOptions, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NestedDtoOptions, type NestedSetBounds, type NestedSetRow, NestedSetStrategy, type NodeWithPk, type NullExpressionNode, type NumberFilter, type OpenApiComponent, type OpenApiDialect, type OpenApiDocument, type OpenApiDocumentInfo, type OpenApiDocumentOptions, type OpenApiOperation, type OpenApiParameter, type OpenApiParameterObject, type OpenApiResponseObject, type OpenApiSchema, type OpenApiType, type OperandNode, type OperandVisitor, Orm, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, type PagedResponse, type PaginatedResult, type PaginationParams, type PatchGraphInputPayload, Pattern, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type Primitive, type PropertySanitizer, type PropertyTransformer, type PropertyValidator, PrototypeMaterializationStrategy, type QueryContext, type QueryInterceptor, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type RecoverResult, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationFilter, type RelationKey$1 as RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type SaveGraphSessionOptions, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaGenerateResult, type SchemaIntrospector, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SelectableKeys, type SimpleQueryRunner, type SimpleWhereInput, type Simplify, SqlServerDialect, type SqliteClientLike, SqliteDialect, type StandardColumnType, type StringFilter, StringTypeStrategy, type SynchronizeOptions, type TableDef, type TableHooks, type TableOptions, type TableRef$1 as TableRef, type TargetType, type TediousColumn, type TediousConnectionLike, type TediousModule, type TediousRequest, type TediousRequestCtor, type TediousTypes, type ThreadedNode, Title, type ToJsonOptions, type TrackedEntity, type TransformContext, type TransformerConfig, type TransformerMetadata, Tree, TreeChildren, type TreeColumns, type TreeConfig, type TreeDecoratorOptions, type TreeInsertData, type TreeListEntry, type TreeListOptions, type TreeListSchemaOptions, TreeManager, type TreeManagerOptions, type TreeMetadata, type TreeMoveData, type TreeNode, type TreeNodeResult, type TreeNodeResultSchemaOptions, type TreeNodeSchemaOptions, TreeParent, type TreeQuery, type TreeScope, type TreeValidationResult, Trim, TypeMappingService, type TypeMappingStrategy, TypeScriptGenerator, type TypedExpression, type TypedLike, type UpdateDto, UpdateQueryBuilder, Upper, UuidTypeStrategy, type ValidationOptions, type ValidationResult$1 as ValidationResult, type ValidatorFactoryOptions, type ValueOperandInput, type WhereInput, type WindowFunctionNode, type WithRelations, abs, acos, add, addDomainEvent, age, aliasRef, and, applyFilter, applyNullability, arrayAppend, asType, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bitAnd, bitLength, bitOr, bitXor, bootstrapEntities, buildFilterExpression, buildScopeConditions, calculateRowDepths, calculateTotalPages, canonicalizeSchema, caseWhen, cast, cbrt, ceil, ceiling, char, charLength, chr, clearExpressionDispatchers, clearOperandDispatchers, coalesce, col, collate, columnOperand, columnToFilterSchema, columnToOpenApiSchema, columnTypeToOpenApiFormat, columnTypeToOpenApiType, computePaginationMetadata, computeSchemaHash, concat, concatWs, correlateBy, cos, cot, count, countAll, createApiComponentsSection, createDeterministicNamingState, createDtoToOpenApiSchema, createEntityFromRow, createEntityProxy, createExecutorFromQueryRunner, createMssqlExecutor, createMysqlExecutor, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createRef, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, createTreeManager, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, deepCloneSchema, defineTable, degrees, deleteFrom, denseRank, diffSchema, div, dtoToOpenApiSchema, endOfMonth, entityRef, entityRefs, eq, esel, exclude, executeHydrated, executeHydratedPlain, executeHydratedPlainWithContexts, executeHydratedWithContexts, executeSchemaSql, executeSchemaSqlFor, exists, exp, extract, extractReusableSchemas, extractScopeValues, firstValue, floor, formatTreeList, fromUnixTime, generateComponentSchemas, generateCreateTableSql, generateOpenApiDocument, generateRelationComponents, generateSchemaSql, generateSchemaSqlFor, generateTreeComponents, getColumn, getColumnMap, getColumnType, getDateKind, getDecoratorMetadata, getDeterministicComponentName, getOpenApiVersionForDialect, getRegisteredValidators, getSchemaIntrospector, getTableDefFromEntity, getTreeBounds, getTreeColumns, getTreeConfig, getTreeMetadata, getTreeParentId, greatest, groupConcat, gt, gte, hasMany, hasNextPage as hasNextPageMeta, hasOne, hasPrevPage as hasPrevPageMeta, hasTreeBehavior, hasValidator, hour, hydrateRows, ifNull, inList, inSubquery, initcap, insertInto, instr, introspectSchema, isCaseExpressionNode, isCastExpressionNode, isCollateExpressionNode, isComponentReference, isExpressionSelectionNode, isFunctionNode, isNotNull, isNull, isNullableColumn, isOperandNode, isTableDef, isTreeConfig, isValueOperandInput, isWindowFunctionNode, jsonArrayAgg, jsonContains, jsonLength, jsonPath, jsonSet, jsonify, lag, lastValue, lead, least, left, length, like, ln, loadBelongsToManyRelation, loadBelongsToRelation, loadHasManyRelation, loadHasOneRelation, localTime, localTimestamp, locate, log, log10, log2, logBase, lower, lpad, lt, lte, ltrim, mapFields, materializeAs, max, md5, mergeSchemas, min, minute, mod, month, mul, neq, nestedDtoToOpenApiSchema, nestedWhereInputToOpenApiSchema, normalizeColumnType, notBetween, notExists, notInList, notInSubquery, notLike, now, ntile, nullif, octetLength, or, outerRef, pagedResponseToOpenApiSchema, paginationParamsSchema, parameterToRef, pi, pick, position, pow, power, quarter, radians, rand, random, rank, registerExpressionDispatcher, registerOperandDispatcher, registerSchemaIntrospector, registerValidator, relationFilterToOpenApiSchema, relationLoaderCache, renderColumnDefinition, renderTypeWithArgs, repeat, replace, replaceWithRefs, resolveTreeConfig, resolveValidator, responseToRef, reverse, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, schemaToJson, schemaToRef, second, sel, selectFrom, selectFromEntity, setRelations, setTreeBounds, setTreeMetadata, setTreeParentId, sha1, sha2, shiftLeft, shiftRight, sign, sin, space, sqrt, stddev, sub, substr, sum, synchronizeSchema, tableRef, tan, threadResults, threadedNodeToOpenApiSchema, toColumnRef, toPagedResponse, toPagedResponseBuilder, toPaginationParams, toResponse, toResponseBuilder, toTableRef, treeEntityRegistry, treeListEntryToOpenApiSchema, treeNodeResultToOpenApiSchema, treeNodeToOpenApiSchema, treeQuery, trim, trunc, truncate, typeMappingService, unixTimestamp, update, updateDtoToOpenApiSchema, updateDtoWithRelationsToOpenApiSchema, upper, utcNow, validateTreeTable, valueToOperand, variance, visitExpression, visitOperand, weekOfYear, whereInputToOpenApiSchema, whereInputWithRelationsToOpenApiSchema, windowFunction, withDefaults, withDefaultsBuilder, year };
|
|
9514
|
+
export { type AliasRefNode, Alphanumeric, type AnyDomainEvent, type ApiRouteDefinition, type ApplyFilterOptions, type ArithmeticExpressionNode, type TableRef as AstTableRef, AsyncLocalStorage, type AutoCorrectionResult, type AutoTransformResult, type AutoTransformableValidator, BelongsTo, BelongsToMany, type BelongsToManyOptions, type BelongsToManyRelation, type BelongsToOptions, type BelongsToReference, type BelongsToReferenceApi, type BelongsToRelation, type BetweenExpressionNode, BigIntTypeStrategy, type BinaryExpressionNode, BinaryTypeStrategy, type BitwiseExpressionNode, type BooleanFilter, BooleanTypeStrategy, CEP, CNPJ, CPF, type CacheInvalidator, type CacheOptions, type CacheProvider, type CacheReader, type CacheState, type CacheStrategy, type CacheWriter, Capitalize, type CascadeMode, type CaseExpressionNode, type CastExpressionNode, type CheckConstraint, type CollateExpressionNode, Column, type ColumnDef, type ColumnDiff, type ColumnInput, type ColumnNode, type ColumnOptions, type ColumnRef, type ColumnToTs, type ColumnType, type ComponentOptions, type ComponentReference, type CompositeTransformer, ConstructorMaterializationStrategy, type ValidationResult as CountryValidationResult, type CountryValidator, type CountryValidatorFactory, type CreateDto, type CreateTediousClientOptions, DEFAULT_TREE_CONFIG, type DatabaseCheck, type DatabaseColumn, type DatabaseIndex, type DatabaseSchema, type DatabaseTable, type DatabaseView, type DateFilter, DateTimeTypeStrategy, type DbExecutor, type DbExecutorFactory, DecimalTypeStrategy, type DecoratedEntityInstance, DefaultBelongsToReference, DefaultCacheStrategy, DefaultEntityMaterializer, DefaultHasManyCollection, DefaultManyToManyCollection, DefaultTypeStrategy, type DefaultValue, DeleteQueryBuilder, type DialectName, type DomainEvent, DomainEventBus, type DomainEventHandler, type Dto, type Duration, Email, Entity, type EntityContext, type EntityInstance, type EntityMaterializationStrategy, type EntityMaterializer, type EntityOptions, type PrimaryKey$1 as EntityPrimaryKey, EntityStatus, type ExecutionContext, type ExistsExpressionNode, type ExpressionNode, type ExpressionVisitor, type FieldFilter, type FilterOperator, type FilterValue, type FindChildrenOptions, type FindPathOptions, type ForeignKeyReference, type FunctionNode, type GroupConcatOptions, type HasDomainEvents, HasMany, type HasManyCollection, type HasManyOptions, type HasManyRelation, HasOne, type HasOneOptions, type HasOneReference, type HasOneReferenceApi, type HasOneRelation, type HydrationContext, type HydrationMetadata, type HydrationPivotPlan, type HydrationPlan, type HydrationRelationPlan, type InExpressionNode, type InExpressionRight, type IndexColumn, type IndexDef, type InferRow, type InitialHandlers, InsertQueryBuilder, IntegerTypeStrategy, InterceptorPipeline, type IntrospectOptions, type InvalidationStrategy, type JsonArray, type JsonObject, type JsonPathNode, type JsonValue, type Jsonify, type JsonifyScalar, KeyvCacheAdapter, Length, type LiteralNode, type LiteralValue, type LogicalExpressionNode, Lower, type ManyToManyCollection, MemoryCacheAdapter, type MoveOptions, type MssqlClientLike, MySqlDialect, type MysqlClientLike, type NestedDtoOptions, type NestedSetBounds, type NestedSetRow, NestedSetStrategy, type NodeWithPk, type NullExpressionNode, type NumberFilter, type OpenApiComponent, type OpenApiDialect, type OpenApiDocument, type OpenApiDocumentInfo, type OpenApiDocumentOptions, type OpenApiOperation, type OpenApiParameter, type OpenApiParameterObject, type OpenApiResponseObject, type OpenApiSchema, type OpenApiType, type OperandNode, type OperandVisitor, Orm, type OrmCacheOptions, type OrmDomainEvent, type OrmInterceptor, type OrmOptions, OrmSession, type OrmSessionOptions, type PagedResponse, type PaginatedResult, type PaginationParams, type PatchGraphInputPayload, Pattern, Pool, type PoolAdapter, type PoolLease, type PoolOptions, type PooledConnectionAdapter, type PostgresClientLike, PostgresDialect, PrimaryKey, type Primitive, type PropertySanitizer, type PropertyTransformer, type PropertyValidator, PrototypeMaterializationStrategy, QueryCacheManager, type QueryContext, type QueryInterceptor, type QueryLogEntry, type QueryLogger, type QueryResult, type RawDefaultValue, type RecoverResult, type ReferentialAction, type RelationChange, type RelationChangeEntry, type RelationDef, type RelationFilter, type RelationKey$1 as RelationKey, RelationKinds, type RelationMap, type RelationTargetTable, type RelationType, type RenderColumnOptions, STANDARD_COLUMN_TYPES, type SaveGraphInputPayload, type SaveGraphInputScalar, type SaveGraphJsonScalar, type SaveGraphSessionOptions, type ScalarSubqueryNode, type SchemaChange, type SchemaChangeKind, type SchemaDiffOptions, type SchemaGenerateResult, type SchemaIntrospector, type SchemaPlan, SelectQueryBuilder, type SelectQueryInput, type SelectableKeys, type SimpleQueryRunner, type SimpleWhereInput, type Simplify, SqlServerDialect, type SqliteClientLike, SqliteDialect, type StandardColumnType, type StringFilter, StringTypeStrategy, type SynchronizeOptions, type TableDef, type TableHooks, type TableOptions, type TableRef$1 as TableRef, TagIndex, type TargetType, type TediousColumn, type TediousConnectionLike, type TediousModule, type TediousRequest, type TediousRequestCtor, type TediousTypes, type ThreadedNode, Title, type ToJsonOptions, type TrackedEntity, type TransformContext, type TransformerConfig, type TransformerMetadata, Tree, TreeChildren, type TreeColumns, type TreeConfig, type TreeDecoratorOptions, type TreeInsertData, type TreeListEntry, type TreeListOptions, type TreeListSchemaOptions, TreeManager, type TreeManagerOptions, type TreeMetadata, type TreeMoveData, type TreeNode, type TreeNodeResult, type TreeNodeResultSchemaOptions, type TreeNodeSchemaOptions, TreeParent, type TreeQuery, type TreeScope, type TreeValidationResult, Trim, TypeMappingService, type TypeMappingStrategy, TypeScriptGenerator, type TypedExpression, type TypedLike, type UpdateDto, UpdateQueryBuilder, Upper, UuidTypeStrategy, type ValidationOptions, type ValidationResult$1 as ValidationResult, type ValidatorFactoryOptions, type ValueOperandInput, type WhereInput, type WindowFunctionNode, type WithRelations, abs, acos, add, addDomainEvent, age, aliasRef, and, applyFilter, applyNullability, arrayAppend, asType, ascii, asin, atan, atan2, avg, belongsTo, belongsToMany, between, bitAnd, bitLength, bitOr, bitXor, bootstrapEntities, buildFilterExpression, buildScopeConditions, calculateRowDepths, calculateTotalPages, canonicalizeSchema, caseWhen, cast, cbrt, ceil, ceiling, char, charLength, chr, clearExpressionDispatchers, clearOperandDispatchers, coalesce, col, collate, columnOperand, columnToFilterSchema, columnToOpenApiSchema, columnTypeToOpenApiFormat, columnTypeToOpenApiType, computePaginationMetadata, computeSchemaHash, concat, concatWs, correlateBy, cos, cot, count, countAll, createApiComponentsSection, createDeterministicNamingState, createDtoToOpenApiSchema, createEntityFromRow, createEntityProxy, createExecutorFromQueryRunner, createMssqlExecutor, createMysqlExecutor, createPooledExecutorFactory, createPostgresExecutor, createQueryLoggingExecutor, createRef, createSqliteExecutor, createTediousExecutor, createTediousMssqlClient, createTreeManager, currentDate, currentTime, dateAdd, dateDiff, dateFormat, dateSub, dateTrunc, day, dayOfWeek, deepCloneSchema, defineTable, degrees, deleteFrom, denseRank, diffSchema, div, dtoToOpenApiSchema, endOfMonth, entityRef, entityRefs, eq, esel, exclude, executeHydrated, executeHydratedPlain, executeHydratedPlainWithContexts, executeHydratedWithContexts, executeSchemaSql, executeSchemaSqlFor, exists, exp, extract, extractReusableSchemas, extractScopeValues, firstValue, floor, formatDuration, formatTreeList, fromUnixTime, generateComponentSchemas, generateCreateTableSql, generateOpenApiDocument, generateRelationComponents, generateSchemaSql, generateSchemaSqlFor, generateTreeComponents, getColumn, getColumnMap, getColumnType, getDateKind, getDecoratorMetadata, getDeterministicComponentName, getOpenApiVersionForDialect, getRegisteredValidators, getSchemaIntrospector, getTableDefFromEntity, getTreeBounds, getTreeColumns, getTreeConfig, getTreeMetadata, getTreeParentId, greatest, groupConcat, gt, gte, hasMany, hasNextPage as hasNextPageMeta, hasOne, hasPrevPage as hasPrevPageMeta, hasTreeBehavior, hasValidator, hour, hydrateRows, ifNull, inList, inSubquery, initcap, insertInto, instr, introspectSchema, isCaseExpressionNode, isCastExpressionNode, isCollateExpressionNode, isComponentReference, isExpressionSelectionNode, isFunctionNode, isNotNull, isNull, isNullableColumn, isOperandNode, isTableDef, isTreeConfig, isValidDuration, isValueOperandInput, isWindowFunctionNode, jsonArrayAgg, jsonContains, jsonLength, jsonPath, jsonSet, jsonify, lag, lastValue, lead, least, left, length, like, ln, loadBelongsToManyRelation, loadBelongsToRelation, loadHasManyRelation, loadHasOneRelation, localTime, localTimestamp, locate, log, log10, log2, logBase, lower, lpad, lt, lte, ltrim, mapFields, materializeAs, max, md5, mergeSchemas, min, minute, mod, month, mul, neq, nestedDtoToOpenApiSchema, nestedWhereInputToOpenApiSchema, normalizeColumnType, notBetween, notExists, notInList, notInSubquery, notLike, now, ntile, nullif, octetLength, or, outerRef, pagedResponseToOpenApiSchema, paginationParamsSchema, parameterToRef, parseDuration, pi, pick, position, pow, power, quarter, radians, rand, random, rank, registerExpressionDispatcher, registerOperandDispatcher, registerSchemaIntrospector, registerValidator, relationFilterToOpenApiSchema, relationLoaderCache, renderColumnDefinition, renderTypeWithArgs, repeat, replace, replaceWithRefs, resolveTreeConfig, resolveValidator, responseToRef, reverse, right, round, rowNumber, rowsToQueryResult, rpad, rtrim, schemaToJson, schemaToRef, second, sel, selectFrom, selectFromEntity, setRelations, setTreeBounds, setTreeMetadata, setTreeParentId, sha1, sha2, shiftLeft, shiftRight, sign, sin, space, sqrt, stddev, sub, substr, sum, synchronizeSchema, tableRef, tan, threadResults, threadedNodeToOpenApiSchema, toColumnRef, toPagedResponse, toPagedResponseBuilder, toPaginationParams, toResponse, toResponseBuilder, toTableRef, treeEntityRegistry, treeListEntryToOpenApiSchema, treeNodeResultToOpenApiSchema, treeNodeToOpenApiSchema, treeQuery, trim, trunc, truncate, typeMappingService, unixTimestamp, update, updateDtoToOpenApiSchema, updateDtoWithRelationsToOpenApiSchema, upper, utcNow, validateTreeTable, valueToOperand, variance, visitExpression, visitOperand, weekOfYear, whereInputToOpenApiSchema, whereInputWithRelationsToOpenApiSchema, windowFunction, withDefaults, withDefaultsBuilder, year };
|