@holo-js/db 0.2.5 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ export { HoloDatabaseConfig, HoloDatabaseConnectionConfig, NormalizedHoloDatabaseConfig, defineDatabaseConfig, holoDatabaseDefaults, normalizeDatabaseConfig } from './config.js';
2
+ import '@holo-js/kernel';
3
+
1
4
  /**
2
5
  * Capability flags exposed by a driver+dialect pair.
3
6
  *
@@ -242,14 +245,22 @@ declare class QueryScheduler {
242
245
  private readonly concurrentState;
243
246
  private readonly serializedState;
244
247
  private readonly workerState;
248
+ private activeOperations;
249
+ private exclusiveActive;
250
+ private exclusivePending;
251
+ private readonly operationWaiters;
252
+ private readonly exclusiveWaiters;
253
+ private readonly exclusiveScope;
245
254
  constructor(options: QuerySchedulerOptions);
246
255
  schedule<T>(options: {
247
256
  transactional: boolean;
248
257
  preferWorkerThreads?: boolean;
258
+ withinExclusive?: boolean;
249
259
  }, callback: (schedulingMode: SchedulingMode) => Promise<T>): Promise<{
250
260
  result: T;
251
261
  schedulingMode: SchedulingMode;
252
262
  }>;
263
+ exclusive<T>(callback: () => Promise<T>): Promise<T>;
253
264
  preview(options: {
254
265
  transactional: boolean;
255
266
  preferWorkerThreads?: boolean;
@@ -258,6 +269,9 @@ declare class QueryScheduler {
258
269
  private resolveState;
259
270
  private waitForSlot;
260
271
  private wakeNext;
272
+ private acquireOperation;
273
+ private releaseOperation;
274
+ private wakeGate;
261
275
  }
262
276
  declare function createQueryScheduler(options: QuerySchedulerOptions): QueryScheduler;
263
277
 
@@ -334,6 +348,7 @@ interface DriverExecutionResult {
334
348
  lastInsertId?: number | string;
335
349
  }
336
350
  interface DriverAdapter {
351
+ readonly supportsConcurrentTransactionScopes?: boolean;
337
352
  initialize(): Promise<void>;
338
353
  disconnect(): Promise<void>;
339
354
  isConnected(): boolean;
@@ -599,11 +614,13 @@ interface InsertQueryPlan {
599
614
  readonly kind: 'insert';
600
615
  readonly source: QuerySource;
601
616
  readonly ignoreConflicts: boolean;
617
+ readonly returning?: boolean;
602
618
  readonly values: readonly Record<string, unknown>[];
603
619
  }
604
620
  interface UpsertQueryPlan {
605
621
  readonly kind: 'upsert';
606
622
  readonly source: QuerySource;
623
+ readonly returning?: boolean;
607
624
  readonly values: readonly Record<string, unknown>[];
608
625
  readonly uniqueBy: readonly string[];
609
626
  readonly updateColumns: readonly string[];
@@ -612,12 +629,14 @@ interface UpdateQueryPlan {
612
629
  readonly kind: 'update';
613
630
  readonly source: QuerySource;
614
631
  readonly predicates: readonly QueryPredicateNode[];
632
+ readonly returning?: boolean;
615
633
  readonly values: Readonly<Record<string, QueryUpdateValue>>;
616
634
  }
617
635
  interface DeleteQueryPlan {
618
636
  readonly kind: 'delete';
619
637
  readonly source: QuerySource;
620
638
  readonly predicates: readonly QueryPredicateNode[];
639
+ readonly returning?: boolean;
621
640
  }
622
641
  type QueryPlan = SelectQueryPlan | InsertQueryPlan | UpsertQueryPlan | UpdateQueryPlan | DeleteQueryPlan;
623
642
  interface QueryJsonUpdateOperation {
@@ -635,9 +654,14 @@ declare function withLimit(plan: SelectQueryPlan, limit?: number): SelectQueryPl
635
654
  declare function withOffset(plan: SelectQueryPlan, offset?: number): SelectQueryPlan;
636
655
  declare function createInsertQueryPlan(source: QuerySource, values: readonly Record<string, unknown>[], options?: {
637
656
  ignoreConflicts?: boolean;
657
+ returning?: boolean;
638
658
  }): InsertQueryPlan;
639
- declare function createUpdateQueryPlan(source: QuerySource, predicates: readonly QueryPredicateNode[], values: Readonly<Record<string, unknown>>): UpdateQueryPlan;
640
- declare function createDeleteQueryPlan(source: QuerySource, predicates: readonly QueryPredicateNode[]): DeleteQueryPlan;
659
+ declare function createUpdateQueryPlan(source: QuerySource, predicates: readonly QueryPredicateNode[], values: Readonly<Record<string, unknown>>, options?: {
660
+ readonly returning?: boolean;
661
+ }): UpdateQueryPlan;
662
+ declare function createDeleteQueryPlan(source: QuerySource, predicates: readonly QueryPredicateNode[], options?: {
663
+ readonly returning?: boolean;
664
+ }): DeleteQueryPlan;
641
665
 
642
666
  type QueryCacheTtlInput = number | Date;
643
667
  type QueryCacheFlexibleTtlInput = readonly [fresh: number, stale: number] | {
@@ -682,9 +706,189 @@ interface DatabaseDependencyCollectionResult<TValue> {
682
706
  readonly value: TValue;
683
707
  readonly dependencies: readonly string[];
684
708
  }
709
+ interface DatabaseQueryPredicateObservation {
710
+ readonly column: string;
711
+ readonly operator: QueryOperator;
712
+ readonly value: unknown;
713
+ }
714
+ interface DatabaseQueryOrderObservation {
715
+ readonly column: string;
716
+ readonly direction: 'asc' | 'desc';
717
+ }
718
+ interface DatabaseQueryAggregateObservation {
719
+ readonly column?: string;
720
+ readonly count?: number;
721
+ readonly currentValueCount?: number;
722
+ readonly kind: 'avg' | 'count' | 'max' | 'min' | 'sum';
723
+ readonly output?: 'boolean' | 'inverseBoolean';
724
+ readonly sum?: number;
725
+ readonly valueCounts?: readonly DatabaseQueryAggregateValueCountObservation[];
726
+ }
727
+ interface DatabaseQueryAggregateValueCountObservation {
728
+ readonly count: number;
729
+ readonly value: number;
730
+ }
731
+ interface DatabaseQuerySelectionObservation {
732
+ readonly column: string;
733
+ readonly resultKey: string;
734
+ }
735
+ interface DatabaseQueryGroupedAggregateObservation {
736
+ readonly aggregateColumn?: string;
737
+ readonly aggregateResultKey: string;
738
+ readonly aggregateStates?: readonly DatabaseQueryGroupedAggregateStateObservation[];
739
+ readonly averageStates?: readonly DatabaseQueryGroupedAverageStateObservation[];
740
+ readonly groupColumn: string;
741
+ readonly groupResultKey: string;
742
+ readonly having?: DatabaseQueryGroupedAggregateHavingObservation;
743
+ readonly kind: 'avg' | 'count' | 'max' | 'min' | 'sum';
744
+ }
745
+ interface DatabaseQueryGroupedAggregateStateObservation {
746
+ readonly aggregateValue: number;
747
+ readonly groupValue: unknown;
748
+ readonly rowCount: number;
749
+ readonly valueCounts?: readonly DatabaseQueryGroupedAggregateValueCountObservation[];
750
+ }
751
+ interface DatabaseQueryGroupedAggregateValueCountObservation {
752
+ readonly count: number;
753
+ readonly value: number;
754
+ }
755
+ interface DatabaseQueryGroupedAverageStateObservation {
756
+ readonly count: number;
757
+ readonly groupValue: unknown;
758
+ readonly rowCount: number;
759
+ readonly sum: number;
760
+ }
761
+ interface DatabaseQueryGroupedAggregateHavingObservation {
762
+ readonly operator: Extract<QueryOperator, '<' | '<=' | '=' | '>' | '>='>;
763
+ readonly value: number;
764
+ }
765
+ type DatabaseQueryPaginationObservation = DatabaseQueryStandardPaginationObservation | DatabaseQuerySimplePaginationObservation | DatabaseQueryCursorPaginationObservation;
766
+ interface DatabaseQueryStandardPaginationObservation {
767
+ readonly currentPage: number;
768
+ readonly kind: 'standard';
769
+ readonly pageName: string;
770
+ readonly perPage: number;
771
+ readonly total: number;
772
+ }
773
+ interface DatabaseQuerySimplePaginationObservation {
774
+ readonly currentPage: number;
775
+ readonly hasMorePages: boolean;
776
+ readonly kind: 'simple';
777
+ readonly pageName: string;
778
+ readonly perPage: number;
779
+ readonly rowCount: number;
780
+ }
781
+ interface DatabaseQueryCursorPaginationObservation {
782
+ readonly cursorName: string;
783
+ readonly hasMorePages: boolean;
784
+ readonly kind: 'cursor';
785
+ readonly nextCursor: string | null;
786
+ readonly perPage: number;
787
+ readonly prevCursor: string | null;
788
+ readonly rows: readonly Readonly<Record<string, unknown>>[];
789
+ readonly rowCount: number;
790
+ }
791
+ type DatabaseQueryResultPathSegment = string | number;
792
+ interface DatabaseQueryObservation {
793
+ readonly aggregate?: DatabaseQueryAggregateObservation;
794
+ readonly belongsToHydrations?: readonly DatabaseQueryBelongsToHydrationObservation[];
795
+ readonly connectionName: string;
796
+ readonly cursorRowCount?: number;
797
+ readonly cursorRows?: readonly Readonly<Record<string, unknown>>[];
798
+ readonly tableName: string;
799
+ readonly dependencies: readonly string[];
800
+ readonly emptyRecordValue?: null;
801
+ readonly groupedAggregate?: DatabaseQueryGroupedAggregateObservation;
802
+ readonly limit?: number;
803
+ readonly offset?: number;
804
+ readonly orderBy: readonly DatabaseQueryOrderObservation[];
805
+ readonly patchable: boolean;
806
+ readonly pagination?: DatabaseQueryPaginationObservation;
807
+ readonly predicates: readonly DatabaseQueryPredicateObservation[];
808
+ readonly relation?: DatabaseQueryRelationObservation;
809
+ readonly result?: unknown;
810
+ readonly resultPath?: readonly DatabaseQueryResultPathSegment[];
811
+ readonly scalarColumn?: string;
812
+ readonly scalarListColumn?: string;
813
+ readonly scalarListRows?: readonly Readonly<Record<string, unknown>>[];
814
+ readonly relatedHydrations?: readonly DatabaseQueryRelatedHydrationObservation[];
815
+ readonly selections: readonly DatabaseQuerySelectionObservation[];
816
+ }
817
+ interface DatabaseQueryBelongsToHydrationObservation {
818
+ readonly foreignKey: string;
819
+ readonly ownerKey: string;
820
+ readonly relationKey: string;
821
+ readonly relatedConnectionName: string;
822
+ readonly relatedTableName: string;
823
+ }
824
+ interface DatabaseQueryRelatedHydrationObservation {
825
+ readonly foreignKey: string;
826
+ readonly kind: 'hasMany' | 'hasOne';
827
+ readonly localKey: string;
828
+ readonly orderBy: readonly DatabaseQueryOrderObservation[];
829
+ readonly predicates: readonly DatabaseQueryPredicateObservation[];
830
+ readonly relationKey: string;
831
+ readonly relatedConnectionName: string;
832
+ readonly relatedTableName: string;
833
+ }
834
+ type DatabaseQueryRelationObservation = DatabaseQueryBelongsToManyRelationObservation | DatabaseQueryBelongsToParentKeyRelationObservation;
835
+ interface DatabaseQueryBelongsToManyRelationObservation {
836
+ readonly foreignPivotKey: string;
837
+ readonly kind: 'belongsToMany';
838
+ readonly pivotAccessor: string;
839
+ readonly pivotColumns: readonly string[];
840
+ readonly pivotOrderBy: readonly DatabaseQueryOrderObservation[];
841
+ readonly relatedConnectionName: string;
842
+ readonly relatedKey: string;
843
+ readonly relatedPivotKey: string;
844
+ readonly relatedTableName: string;
845
+ }
846
+ interface DatabaseQueryBelongsToParentKeyRelationObservation {
847
+ readonly foreignKey: string;
848
+ readonly kind: 'belongsToParentKey';
849
+ readonly ownerKey: string;
850
+ readonly relationKey: string;
851
+ readonly relatedConnectionName: string;
852
+ readonly relatedTableName: string;
853
+ }
854
+ interface DatabaseMutationEvent {
855
+ readonly connectionName: string;
856
+ readonly tableName: string;
857
+ readonly kind: 'insert' | 'update' | 'delete' | 'upsert';
858
+ readonly predicates: readonly DatabaseQueryPredicateObservation[];
859
+ readonly previousRows?: readonly Readonly<Record<string, unknown>>[];
860
+ readonly rows?: readonly Readonly<Record<string, unknown>>[];
861
+ readonly values?: Readonly<Record<string, unknown>>;
862
+ }
863
+ type DatabaseDependencyPredicateMetadata = {
864
+ readonly tableKey: string;
865
+ readonly columnName: string;
866
+ readonly encodedValue: string;
867
+ };
868
+ type DatabaseDependencyInvalidationMetadata = {
869
+ readonly directDependencies: readonly string[];
870
+ readonly exactPredicates: readonly DatabaseDependencyPredicateMetadata[];
871
+ readonly hasMutationDependency: boolean;
872
+ readonly predicates: readonly DatabaseDependencyPredicateMetadata[];
873
+ readonly tableDependencies: readonly string[];
874
+ };
875
+ type DatabaseDependencyInvalidationEventWithMutations = DatabaseDependencyInvalidationEvent & {
876
+ readonly mutations?: readonly DatabaseMutationEvent[];
877
+ };
878
+ type DatabaseDependencyInvalidationEventInternal = DatabaseDependencyInvalidationEventWithMutations & {
879
+ readonly __holoDatabaseDependencyMetadata__?: DatabaseDependencyInvalidationMetadata;
880
+ };
881
+ type DatabaseDependencyInvalidationListenerInternal = (event: DatabaseDependencyInvalidationEventInternal) => void | Promise<void>;
882
+ type DatabaseDependencyCollectionResultInternal<TValue> = DatabaseDependencyCollectionResult<TValue> & {
883
+ readonly queries: readonly DatabaseQueryObservation[];
884
+ };
885
+ type DatabaseDependencyInvalidationPlan = {
886
+ readonly dependencies: readonly string[];
887
+ readonly metadata?: DatabaseDependencyInvalidationMetadata;
888
+ };
685
889
  declare function getQueryCacheBridgeState(): {
686
890
  bridge?: DatabaseQueryCacheBridge;
687
- dependencyInvalidationListeners?: Set<DatabaseDependencyInvalidationListener>;
891
+ dependencyInvalidationListeners?: Set<DatabaseDependencyInvalidationListenerInternal>;
688
892
  };
689
893
  declare function configureDatabaseQueryCacheBridge(bridge?: DatabaseQueryCacheBridge): void;
690
894
  declare function getDatabaseQueryCacheBridge(): DatabaseQueryCacheBridge | undefined;
@@ -692,27 +896,41 @@ declare function resetDatabaseQueryCacheBridge(): void;
692
896
  declare function onDatabaseDependencyInvalidated(listener: DatabaseDependencyInvalidationListener): () => void;
693
897
  declare function resetDatabaseDependencyInvalidationListeners(): void;
694
898
  declare function collectDatabaseQueryDependencies<TValue>(callback: () => TValue | Promise<TValue>): Promise<DatabaseDependencyCollectionResult<TValue>>;
899
+ declare function collectDatabaseQueryDependenciesInternal<TValue>(callback: () => TValue | Promise<TValue>): Promise<DatabaseDependencyCollectionResultInternal<TValue>>;
695
900
  declare function hasActiveDatabaseDependencyCollector(): boolean;
696
901
  declare function recordDatabaseQueryDependencies(dependencies: readonly string[] | undefined): void;
902
+ declare function recordDatabaseQueryObservation(observation: DatabaseQueryObservation | undefined): void;
903
+ declare function rebindDatabaseQueryObservationResult(source: unknown, result: unknown): void;
904
+ declare function disableDatabaseQueryObservationPatching(source: unknown): void;
905
+ declare function rebindDatabaseQueryObservationScalar(source: unknown, result: unknown, column: string): void;
906
+ declare function rebindDatabaseQueryObservationScalarList(rows: readonly Readonly<Record<string, unknown>>[], result: readonly unknown[], column: string): void;
697
907
  declare function hasDatabaseDependencyInvalidationListeners(): boolean;
698
- declare function notifyDatabaseDependencyInvalidationListeners(event: DatabaseDependencyInvalidationEvent): Promise<void>;
908
+ declare function notifyDatabaseDependencyInvalidationListeners(event: DatabaseDependencyInvalidationEventInternal): Promise<void>;
699
909
  declare function normalizeQueryCacheConfig(input: QueryCacheTtlInput | QueryCacheConfig): NormalizedQueryCacheConfig;
700
910
  declare function createDeterministicQueryCacheKey(statement: CompiledStatement, connectionName: string): string;
701
911
  declare function resolveQueryCacheKey(statement: CompiledStatement, connectionName: string, config: NormalizedQueryCacheConfig): string;
702
912
  declare function createTableCacheDependency(connectionName: string, tableName: string): string;
703
913
  declare function createTableRowCacheDependency(connectionName: string, tableName: string, columnName: string, value: unknown): string | undefined;
704
914
  declare function createTableRowWildcardCacheDependency(connectionName: string, tableName: string): string;
915
+ declare function createTablePredicateCacheDependency(connectionName: string, tableName: string, columnName: string, value: unknown): string | undefined;
705
916
  declare function normalizeQueryCacheDependencies(connectionName: string, dependencies: readonly string[]): readonly string[];
706
917
  declare function supportsAutomaticPredicateInvalidation(predicate: QueryPredicateNode): boolean;
918
+ declare function createDatabaseQueryObservation(plan: SelectQueryPlan, connectionName: string, dependencies: readonly string[], result?: unknown, groupedAverageStates?: readonly DatabaseQueryGroupedAverageStateObservation[], groupedAggregateStates?: readonly DatabaseQueryGroupedAggregateStateObservation[]): DatabaseQueryObservation | undefined;
919
+ declare function createDatabaseMutationEvent(kind: DatabaseMutationEvent['kind'], connectionName: string, tableName: string, predicates?: readonly QueryPredicateNode[], values?: Readonly<Record<string, unknown>>, rows?: readonly Readonly<Record<string, unknown>>[], previousRows?: readonly Readonly<Record<string, unknown>>[]): DatabaseMutationEvent;
707
920
  declare function supportsAutomaticQueryCacheInvalidation(plan: SelectQueryPlan): boolean;
708
921
  declare function inferAutomaticQueryCacheDependencies(plan: SelectQueryPlan, connectionName: string): readonly string[] | undefined;
709
- declare function inferAutomaticQueryCacheInvalidationDependencies(plan: SelectQueryPlan, connectionName: string): readonly string[];
922
+ declare function inferAutomaticQueryCacheInvalidationDependencies(plan: SelectQueryPlan, connectionName: string, values?: Readonly<Record<string, unknown>>): readonly string[];
923
+ declare function inferAutomaticQueryCacheInvalidationPlan(plan: SelectQueryPlan, connectionName: string, values?: Readonly<Record<string, unknown>>, includeMetadata?: boolean): DatabaseDependencyInvalidationPlan;
710
924
  declare function inferAutomaticInsertCacheInvalidationDependencies(connectionName: string, tableName: string, rows: readonly Readonly<Record<string, unknown>>[], lastInsertId?: number | string): readonly string[];
925
+ declare function inferAutomaticInsertCacheInvalidationPlan(connectionName: string, tableName: string, rows: readonly Readonly<Record<string, unknown>>[], lastInsertId?: number | string, includeMetadata?: boolean): DatabaseDependencyInvalidationPlan;
711
926
  declare function resolveQueryCacheDependencies(plan: SelectQueryPlan, connectionName: string, explicit?: readonly string[]): readonly string[] | undefined;
712
927
  declare const queryCacheInternals: {
713
- collectDatabaseQueryDependencies: typeof collectDatabaseQueryDependencies;
928
+ collectDatabaseQueryDependencies: typeof collectDatabaseQueryDependenciesInternal;
714
929
  configureDatabaseQueryCacheBridge: typeof configureDatabaseQueryCacheBridge;
930
+ createDatabaseMutationEvent: typeof createDatabaseMutationEvent;
931
+ createDatabaseQueryObservation: typeof createDatabaseQueryObservation;
715
932
  createDeterministicQueryCacheKey: typeof createDeterministicQueryCacheKey;
933
+ createTablePredicateCacheDependency: typeof createTablePredicateCacheDependency;
716
934
  createTableCacheDependency: typeof createTableCacheDependency;
717
935
  createTableRowCacheDependency: typeof createTableRowCacheDependency;
718
936
  createTableRowWildcardCacheDependency: typeof createTableRowWildcardCacheDependency;
@@ -720,13 +938,20 @@ declare const queryCacheInternals: {
720
938
  hasActiveDatabaseDependencyCollector: typeof hasActiveDatabaseDependencyCollector;
721
939
  hasDatabaseDependencyInvalidationListeners: typeof hasDatabaseDependencyInvalidationListeners;
722
940
  inferAutomaticInsertCacheInvalidationDependencies: typeof inferAutomaticInsertCacheInvalidationDependencies;
941
+ inferAutomaticInsertCacheInvalidationPlan: typeof inferAutomaticInsertCacheInvalidationPlan;
723
942
  inferAutomaticQueryCacheDependencies: typeof inferAutomaticQueryCacheDependencies;
724
943
  inferAutomaticQueryCacheInvalidationDependencies: typeof inferAutomaticQueryCacheInvalidationDependencies;
944
+ inferAutomaticQueryCacheInvalidationPlan: typeof inferAutomaticQueryCacheInvalidationPlan;
725
945
  normalizeQueryCacheConfig: typeof normalizeQueryCacheConfig;
726
946
  normalizeQueryCacheDependencies: typeof normalizeQueryCacheDependencies;
727
947
  notifyDatabaseDependencyInvalidationListeners: typeof notifyDatabaseDependencyInvalidationListeners;
948
+ disableDatabaseQueryObservationPatching: typeof disableDatabaseQueryObservationPatching;
949
+ rebindDatabaseQueryObservationResult: typeof rebindDatabaseQueryObservationResult;
950
+ rebindDatabaseQueryObservationScalar: typeof rebindDatabaseQueryObservationScalar;
951
+ rebindDatabaseQueryObservationScalarList: typeof rebindDatabaseQueryObservationScalarList;
728
952
  onDatabaseDependencyInvalidated: typeof onDatabaseDependencyInvalidated;
729
953
  recordDatabaseQueryDependencies: typeof recordDatabaseQueryDependencies;
954
+ recordDatabaseQueryObservation: typeof recordDatabaseQueryObservation;
730
955
  resolveQueryCacheDependencies: typeof resolveQueryCacheDependencies;
731
956
  resolveQueryCacheKey: typeof resolveQueryCacheKey;
732
957
  resetDatabaseDependencyInvalidationListeners: typeof resetDatabaseDependencyInvalidationListeners;
@@ -995,6 +1220,15 @@ declare class TableQueryBuilder<TTableOrName extends TableReference = string, TS
995
1220
  dump(): TableQueryBuilder<TTableOrName, TSelectedRow>;
996
1221
  cache(config: QueryCacheTtlInput | QueryCacheConfig): TableQueryBuilder<TTableOrName, TSelectedRow>;
997
1222
  get<TRow extends Record<string, unknown> = TSelectedRow>(): Promise<TRow[]>;
1223
+ private recordCollectedQueryObservation;
1224
+ private readGroupedAverageStates;
1225
+ private readGroupedAggregateStates;
1226
+ private readGroupedAggregateValueCounts;
1227
+ private pushGroupedAggregateValueCount;
1228
+ private readGroupedAggregateValueCountsForGroup;
1229
+ private createGroupedAggregateStateValueSelection;
1230
+ private normalizeGroupedAggregateStateValue;
1231
+ private normalizeAggregateMetadataNumber;
998
1232
  first<TRow extends Record<string, unknown> = TSelectedRow>(): Promise<TRow | undefined>;
999
1233
  sole<TRow extends Record<string, unknown> = TSelectedRow>(): Promise<TRow>;
1000
1234
  paginate<TRow extends Record<string, unknown> = TSelectedRow>(perPage?: number, page?: number, options?: PaginationOptions): Promise<PaginatedResult<TRow>>;
@@ -1029,6 +1263,20 @@ declare class TableQueryBuilder<TTableOrName extends TableReference = string, TS
1029
1263
  unsafeQuery<TRow extends Record<string, unknown> = Record<string, unknown>>(statement: Omit<UnsafeStatement, 'source'>): Promise<DriverQueryResult<TRow>>;
1030
1264
  unsafeExecute(statement: Omit<UnsafeStatement, 'source'>): Promise<DriverExecutionResult>;
1031
1265
  private clone;
1266
+ private captureUpdatedMutationRows;
1267
+ private captureDeletedMutationRows;
1268
+ private applyCapturedUpdateValues;
1269
+ private applyCapturedUpdateValue;
1270
+ private applyCapturedJsonUpdateOperation;
1271
+ private isCapturedJsonUpdateOperation;
1272
+ private applyCapturedJsonPathValue;
1273
+ private isJsonRecord;
1274
+ private captureUpsertPreviousRows;
1275
+ private rowsMatchUniqueBy;
1276
+ private shouldUseReturningMutationRows;
1277
+ private queryReturningMutationRows;
1278
+ private freezeMutationRows;
1279
+ private readReturnedLastInsertId;
1032
1280
  private invalidateInsertQueries;
1033
1281
  private invalidateMutationQueries;
1034
1282
  private getCompiler;
@@ -1118,6 +1366,9 @@ declare function getModelDefinition<TTable extends TableDefinition>(reference: M
1118
1366
  declare class ModelRepository<TTable extends TableDefinition = TableDefinition> {
1119
1367
  private readonly connection;
1120
1368
  readonly definition: ModelDefinition<TTable>;
1369
+ private readonly eventDispatcher;
1370
+ private readonly relationAggregateCalculator;
1371
+ private readonly valueTransformer;
1121
1372
  constructor(definition: ModelDefinition<TTable>, connection: DatabaseContext);
1122
1373
  static from<TTable extends TableDefinition>(reference: ModelDefinitionLike | ModelDefinition<TTable> | ModelReference<TTable>, connection?: DatabaseContext): ModelRepository<TTable>;
1123
1374
  getConnection(): DatabaseContext;
@@ -1155,6 +1406,24 @@ declare class ModelRepository<TTable extends TableDefinition = TableDefinition>
1155
1406
  applyRelationExistenceFilter(query: TableQueryBuilder<TTable, Record<string, unknown>>, filter: RelationFilter$1): TableQueryBuilder<TTable, Record<string, unknown>>;
1156
1407
  loadMorphRelations(entities: readonly Entity<TTable>[], relationName: string, mapping: Readonly<Record<string, string | readonly string[] | Readonly<Record<string, RelationConstraint$1>>>>): Promise<void>;
1157
1408
  loadRelationAggregates(entities: readonly Entity<TTable>[], aggregates: readonly AggregateLoad$1[]): Promise<void>;
1409
+ recordRelationAggregateObservations(entities: readonly Entity<TTable>[], aggregates: readonly AggregateLoad$1[], createPath: (index: number, key: string) => readonly DatabaseQueryResultPathSegment[]): void;
1410
+ recordRelationObservations(entities: readonly Entity<TTable>[], relations: readonly (string | EagerLoad$1)[], createPath: (index: number, relationName: string) => readonly DatabaseQueryResultPathSegment[]): void;
1411
+ private recordHasManyRelationObservations;
1412
+ private recordHasOneRelationObservations;
1413
+ private recordBelongsToRelationObservations;
1414
+ private createBelongsToParentKeyRelationObservation;
1415
+ private createNullableSingleRecordRelationObservation;
1416
+ private rememberHasManyRelationObservation;
1417
+ private rememberBelongsToRelationObservation;
1418
+ private getRelationQueryObservation;
1419
+ private createHasManyRelationObservation;
1420
+ private createBelongsToRelationObservation;
1421
+ private recordBelongsToManyRelationObservations;
1422
+ private createBelongsToManyRelatedObservationMetadata;
1423
+ private createRelationAggregateObservation;
1424
+ private setRelationAggregateObservationMetadata;
1425
+ private getRelationAggregateObservationMetadata;
1426
+ private createRelationAggregateObservationTarget;
1158
1427
  create(values: Partial<ModelRecord<TTable>>): Promise<Entity<TTable>>;
1159
1428
  createQuietly(values: Partial<ModelRecord<TTable>>): Promise<Entity<TTable>>;
1160
1429
  createMany(values: readonly Partial<ModelRecord<TTable>>[]): Promise<ModelCollection<TTable>>;
@@ -1228,10 +1497,7 @@ declare class ModelRepository<TTable extends TableDefinition = TableDefinition>
1228
1497
  private applyExistsBooleanGroup;
1229
1498
  private qualifyParentColumn;
1230
1499
  private getRelationParentValue;
1231
- private getAggregateAttributeKey;
1232
1500
  private getRelationAggregateValues;
1233
- private computeAggregateValue;
1234
- private assertNumericAggregateValue;
1235
1501
  private getRelatedEntitiesByParentKey;
1236
1502
  attachCollection(entities: readonly Entity<TTable>[]): readonly Entity<TTable>[];
1237
1503
  resolveRelationProperty(entity: Entity<TTable>, relationName: string): unknown;
@@ -1266,6 +1532,7 @@ declare class ModelRepository<TTable extends TableDefinition = TableDefinition>
1266
1532
  private getMorphToManyEntitiesByParentKey;
1267
1533
  private getMorphedByManyEntitiesByParentKey;
1268
1534
  private createBelongsToManyPivotQuery;
1535
+ private resolvePivotTableName;
1269
1536
  private createMorphToManyPivotQuery;
1270
1537
  private createMorphedByManyPivotQuery;
1271
1538
  private applyPivotQueryConfig;
@@ -1292,33 +1559,17 @@ declare class ModelRepository<TTable extends TableDefinition = TableDefinition>
1292
1559
  private getPivotRelatedIdColumn;
1293
1560
  private getReservedPivotColumns;
1294
1561
  private buildPivotInsertPayload;
1295
- private applyGeneratedUniqueIds;
1296
- private applyPendingAttributes;
1297
- private getObserverInstances;
1298
1562
  private dispatchCancelableEvent;
1299
1563
  private dispatchEvent;
1300
1564
  private dispatchSyncEvent;
1301
1565
  resolveAttribute(key: string, entity: Entity<TTable>, value: unknown): unknown;
1302
1566
  shouldPreventAccessingMissingAttributes(key: string): boolean;
1303
1567
  serializeEntity(entity: Entity<TTable>): Record<string, unknown>;
1304
- private serializeRelationValue;
1305
- private serializeOutputValue;
1306
1568
  serializeAttributeValue(key: string, value: unknown): unknown;
1307
1569
  private normalizeFromStorage;
1308
1570
  private applyTimestampDefaults;
1309
1571
  private normalizeForStorage;
1310
- private applySchemaReadNormalization;
1311
- private applySchemaWriteNormalization;
1312
- private getSchemaDialectName;
1313
1572
  private applyCastGet;
1314
- private applyCastSet;
1315
- private resolveCastDefinition;
1316
- private parseBuiltInCast;
1317
- private parseVectorValue;
1318
- private serializeVectorValue;
1319
- private parseVectorString;
1320
- private parseVectorDimensions;
1321
- private formatDateCast;
1322
1573
  }
1323
1574
 
1324
1575
  type BuilderCallback<TBuilder> = (query: TBuilder) => unknown;
@@ -1535,6 +1786,7 @@ declare class ModelQueryBuilder<TTable extends TableDefinition = TableDefinition
1535
1786
  dump(): ModelQueryBuilder<TTable, TRelations, TLoaded>;
1536
1787
  cache(config: QueryCacheTtlInput | QueryCacheConfig): ModelQueryBuilder<TTable, TRelations, TLoaded>;
1537
1788
  get(): Promise<ModelCollection<TTable, TRelations, EntityWithLoaded<TTable, TRelations, TLoaded>>>;
1789
+ private hydrateRows;
1538
1790
  getJson(): Promise<SerializedEntityWithLoaded<TTable, TLoaded>[]>;
1539
1791
  first(): Promise<EntityWithLoaded<TTable, TRelations, TLoaded> | undefined>;
1540
1792
  firstJson(): Promise<SerializedEntityWithLoaded<TTable, TLoaded> | undefined>;
@@ -1610,6 +1862,23 @@ declare class ModelQueryBuilder<TTable extends TableDefinition = TableDefinition
1610
1862
  private resolveBelongsToRelationName;
1611
1863
  private extractNumericValues;
1612
1864
  private getUnpaginatedEntities;
1865
+ private getUnpaginatedRowsAndEntities;
1866
+ private getRowsAndEntities;
1867
+ private recordCollectionRelationAggregateObservations;
1868
+ private recordCollectionRelationObservations;
1869
+ private recordSingleRelationObservations;
1870
+ private recordPaginatedRelationObservations;
1871
+ private recordSingleRelationAggregateObservations;
1872
+ private recordPaginatedRelationAggregateObservations;
1873
+ private canBindRowsToSerializedResultBase;
1874
+ private canBindRowsToSerializedResult;
1875
+ private createPatchableEagerRelationHydrations;
1876
+ private createPatchableRelatedHydrationQuery;
1877
+ private isQueryableModelReference;
1878
+ private rebindRowsToSerializedResult;
1879
+ private rebindRowsToPaginatedResult;
1880
+ private rebindRowsToSimplePaginatedResult;
1881
+ private rebindRowsToCursorPaginatedResult;
1613
1882
  private prepareCursorPaginationQuery;
1614
1883
  private resolveCursorOrders;
1615
1884
  private readCursorColumnValue;
@@ -2997,6 +3266,49 @@ declare class DatabaseContext {
2997
3266
  }
2998
3267
  declare function createDatabase(options: DatabaseContextOptions): DatabaseContext;
2999
3268
 
3269
+ type DatabaseDriverConnection = {
3270
+ readonly url?: string;
3271
+ readonly host?: string;
3272
+ readonly port?: number;
3273
+ readonly username?: string;
3274
+ readonly password?: string;
3275
+ readonly database?: string;
3276
+ readonly ssl?: boolean | Record<string, unknown>;
3277
+ };
3278
+ type DatabaseDriverFactory = {
3279
+ readonly driver: string;
3280
+ readonly supportsConcurrentTransactionScopes?: boolean;
3281
+ create(connection: DatabaseDriverConnection): DriverAdapter;
3282
+ };
3283
+ declare function registerDatabaseDriverFactory(factory: DatabaseDriverFactory): void;
3284
+ declare function getDatabaseDriverFactory(driver: string): DatabaseDriverFactory | undefined;
3285
+ declare function unregisterDatabaseDriverFactory(factory: DatabaseDriverFactory): void;
3286
+ declare class DeferredDatabaseDriverAdapter implements DriverAdapter {
3287
+ private readonly driver;
3288
+ private readonly connection;
3289
+ private adapter?;
3290
+ private pending?;
3291
+ constructor(driver: string, connection: DatabaseDriverConnection);
3292
+ get supportsConcurrentTransactionScopes(): boolean;
3293
+ private resolve;
3294
+ initialize(): Promise<void>;
3295
+ disconnect(): Promise<void>;
3296
+ isConnected(): boolean;
3297
+ ensureDatabaseExists(): Promise<void>;
3298
+ isDatabaseMissingError(error: unknown): boolean;
3299
+ runWithTransactionScope<T>(callback: () => Promise<T>): Promise<T>;
3300
+ introspect<TRow extends Record<string, unknown> = Record<string, unknown>>(sql: string, bindings?: readonly unknown[], options?: DatabaseOperationOptions): Promise<DriverQueryResult<TRow>>;
3301
+ query<TRow extends Record<string, unknown> = Record<string, unknown>>(sql: string, bindings?: readonly unknown[], options?: DatabaseOperationOptions): Promise<DriverQueryResult<TRow>>;
3302
+ execute(sql: string, bindings?: readonly unknown[], options?: DatabaseOperationOptions): Promise<DriverExecutionResult>;
3303
+ beginTransaction(options?: DatabaseTransactionOptions): Promise<void>;
3304
+ commit(options?: DatabaseOperationOptions): Promise<void>;
3305
+ rollback(options?: DatabaseOperationOptions): Promise<void>;
3306
+ createSavepoint(name: string, options?: DatabaseOperationOptions): Promise<void>;
3307
+ rollbackToSavepoint(name: string, options?: DatabaseOperationOptions): Promise<void>;
3308
+ releaseSavepoint(name: string, options?: DatabaseOperationOptions): Promise<void>;
3309
+ }
3310
+ declare function createDeferredDatabaseDriverAdapter(driver: string, connection: DatabaseDriverConnection): DriverAdapter;
3311
+
3000
3312
  declare function unsafeSql(sql: string, bindings?: readonly unknown[], source?: string): UnsafeStatement;
3001
3313
 
3002
3314
  declare class DatabaseError extends Error {
@@ -3091,137 +3403,6 @@ declare class AsyncConnectionContext {
3091
3403
  }
3092
3404
  declare const connectionAsyncContext: AsyncConnectionContext;
3093
3405
 
3094
- declare abstract class LazyDriverAdapter implements DriverAdapter {
3095
- private adapter?;
3096
- private pending?;
3097
- protected connected: boolean;
3098
- protected abstract readonly driverLabel: string;
3099
- protected abstract createConcreteAdapter(): Promise<DriverAdapter>;
3100
- protected resolveAdapter(): Promise<DriverAdapter>;
3101
- initialize(): Promise<void>;
3102
- disconnect(): Promise<void>;
3103
- isConnected(): boolean;
3104
- ensureDatabaseExists(): Promise<void>;
3105
- isDatabaseMissingError(error: unknown): boolean;
3106
- runWithTransactionScope<T>(callback: () => Promise<T>): Promise<T>;
3107
- introspect<TRow extends Record<string, unknown> = Record<string, unknown>>(sql: string, bindings?: readonly unknown[], options?: DatabaseOperationOptions): Promise<DriverQueryResult<TRow>>;
3108
- query<TRow extends Record<string, unknown> = Record<string, unknown>>(sql: string, bindings?: readonly unknown[], options?: DatabaseOperationOptions): Promise<DriverQueryResult<TRow>>;
3109
- execute(sql: string, bindings?: readonly unknown[], options?: DatabaseOperationOptions): Promise<DriverExecutionResult>;
3110
- beginTransaction(options?: DatabaseTransactionOptions): Promise<void>;
3111
- commit(options?: DatabaseOperationOptions): Promise<void>;
3112
- rollback(options?: DatabaseOperationOptions): Promise<void>;
3113
- createSavepoint(name: string, options?: DatabaseOperationOptions): Promise<void>;
3114
- rollbackToSavepoint(name: string, options?: DatabaseOperationOptions): Promise<void>;
3115
- releaseSavepoint(name: string, options?: DatabaseOperationOptions): Promise<void>;
3116
- }
3117
- interface SQLiteStatementLike {
3118
- all(...params: readonly unknown[]): Record<string, unknown>[];
3119
- run(...params: readonly unknown[]): {
3120
- changes?: number;
3121
- lastInsertRowid?: unknown;
3122
- };
3123
- }
3124
- interface SQLiteDatabaseLike {
3125
- prepare(sql: string): SQLiteStatementLike;
3126
- exec(sql: string): unknown;
3127
- close(): unknown;
3128
- }
3129
- interface SQLiteAdapterOptions {
3130
- filename?: string;
3131
- database?: SQLiteDatabaseLike;
3132
- createDatabase?: (filename: string) => SQLiteDatabaseLike;
3133
- }
3134
- declare class SQLiteAdapter extends LazyDriverAdapter {
3135
- private readonly options;
3136
- protected readonly driverLabel = "SQLiteAdapter";
3137
- readonly filename: string;
3138
- constructor(options?: SQLiteAdapterOptions);
3139
- protected createConcreteAdapter(): Promise<DriverAdapter>;
3140
- createSavepoint(name: string, options?: DatabaseOperationOptions): Promise<void>;
3141
- rollbackToSavepoint(name: string, options?: DatabaseOperationOptions): Promise<void>;
3142
- releaseSavepoint(name: string, options?: DatabaseOperationOptions): Promise<void>;
3143
- }
3144
- declare function createSQLiteAdapter(options?: SQLiteAdapterOptions): SQLiteAdapter;
3145
- interface PostgresQueryableLike {
3146
- query(sql: string, bindings?: readonly unknown[]): Promise<{
3147
- rows: Record<string, unknown>[];
3148
- rowCount?: number | null;
3149
- }>;
3150
- }
3151
- interface PostgresClientLike extends PostgresQueryableLike {
3152
- release?(): void;
3153
- end?(): Promise<void>;
3154
- }
3155
- interface PostgresPoolLike extends PostgresQueryableLike {
3156
- connect(): Promise<PostgresClientLike>;
3157
- end(): Promise<void>;
3158
- }
3159
- interface PostgresConnectionConfig {
3160
- connectionString?: string;
3161
- host?: string;
3162
- port?: number;
3163
- user?: string;
3164
- password?: string;
3165
- database?: string;
3166
- ssl?: boolean | Record<string, unknown>;
3167
- }
3168
- interface PostgresAdapterOptions<TConfig extends PostgresConnectionConfig = PostgresConnectionConfig> {
3169
- connectionString?: string;
3170
- config?: TConfig;
3171
- client?: PostgresClientLike;
3172
- pool?: PostgresPoolLike;
3173
- createPool?: (config?: TConfig) => PostgresPoolLike;
3174
- }
3175
- declare class PostgresAdapter<TConfig extends PostgresConnectionConfig = PostgresConnectionConfig> extends LazyDriverAdapter {
3176
- private readonly options;
3177
- protected readonly driverLabel = "PostgresAdapter";
3178
- readonly config?: TConfig;
3179
- constructor(options?: PostgresAdapterOptions<TConfig>);
3180
- protected createConcreteAdapter(): Promise<DriverAdapter>;
3181
- createSavepoint(name: string, options?: DatabaseOperationOptions): Promise<void>;
3182
- rollbackToSavepoint(name: string, options?: DatabaseOperationOptions): Promise<void>;
3183
- releaseSavepoint(name: string, options?: DatabaseOperationOptions): Promise<void>;
3184
- }
3185
- declare function createPostgresAdapter<TConfig extends PostgresConnectionConfig = PostgresConnectionConfig>(options?: PostgresAdapterOptions<TConfig>): PostgresAdapter<TConfig>;
3186
- interface MySQLQueryableLike {
3187
- query(sql: string, bindings?: readonly unknown[]): Promise<readonly [unknown, unknown]>;
3188
- }
3189
- interface MySQLClientLike extends MySQLQueryableLike {
3190
- release?(): void;
3191
- end?(): Promise<void>;
3192
- }
3193
- interface MySQLPoolLike extends MySQLQueryableLike {
3194
- getConnection(): Promise<MySQLClientLike>;
3195
- end(): Promise<void>;
3196
- }
3197
- interface MySQLConnectionConfig {
3198
- host?: string;
3199
- port?: number;
3200
- user?: string;
3201
- password?: string;
3202
- database?: string;
3203
- ssl?: unknown;
3204
- uri?: string;
3205
- }
3206
- interface MySQLAdapterOptions<TConfig extends MySQLConnectionConfig = MySQLConnectionConfig> {
3207
- uri?: string;
3208
- config?: TConfig;
3209
- client?: MySQLClientLike;
3210
- pool?: MySQLPoolLike;
3211
- createPool?: (config: TConfig) => MySQLPoolLike;
3212
- }
3213
- declare class MySQLAdapter<TConfig extends MySQLConnectionConfig = MySQLConnectionConfig> extends LazyDriverAdapter {
3214
- private readonly options;
3215
- protected readonly driverLabel = "MySQLAdapter";
3216
- readonly config: TConfig;
3217
- constructor(options?: MySQLAdapterOptions<TConfig>);
3218
- protected createConcreteAdapter(): Promise<DriverAdapter>;
3219
- createSavepoint(name: string, options?: DatabaseOperationOptions): Promise<void>;
3220
- rollbackToSavepoint(name: string, options?: DatabaseOperationOptions): Promise<void>;
3221
- releaseSavepoint(name: string, options?: DatabaseOperationOptions): Promise<void>;
3222
- }
3223
- declare function createMySQLAdapter<TConfig extends MySQLConnectionConfig = MySQLConnectionConfig>(options?: MySQLAdapterOptions<TConfig>): MySQLAdapter<TConfig>;
3224
-
3225
3406
  type SupportedDatabaseDriver = 'sqlite' | 'postgres' | 'mysql';
3226
3407
  interface RuntimeConnectionConfig {
3227
3408
  driver?: SupportedDatabaseDriver | string;
@@ -3261,7 +3442,7 @@ type RuntimeAdapterConnectionConfig = {
3261
3442
  declare function isSupportedDatabaseDriver(value: string): value is SupportedDatabaseDriver;
3262
3443
  declare function parseDatabaseDriver(value: string | undefined, fallback: SupportedDatabaseDriver): SupportedDatabaseDriver;
3263
3444
  declare function createDialect(driver: SupportedDatabaseDriver): Dialect;
3264
- declare function createAdapter(driver: SupportedDatabaseDriver, connection: string | RuntimeAdapterConnectionConfig): SQLiteAdapter | PostgresAdapter<PostgresConnectionConfig> | MySQLAdapter<MySQLConnectionConfig>;
3445
+ declare function createAdapter(driver: SupportedDatabaseDriver, connection: string | RuntimeAdapterConnectionConfig): DriverAdapter;
3265
3446
  declare function createRuntimeLogger(enabled: boolean): DatabaseLogger | undefined;
3266
3447
  declare function createRuntimeConnectionOptions(driver: SupportedDatabaseDriver, connection: string | RuntimeAdapterConnectionConfig, dbLogging: boolean, schemaName?: string, connectionName?: string): DatabaseContextOptions;
3267
3448
  declare function resolveRuntimeConnectionManagerOptions(config: RuntimeConfigInput): ConnectionManager;
@@ -3303,6 +3484,7 @@ declare class SQLQueryCompiler {
3303
3484
  protected compileInsertPrefix(_plan: InsertQueryPlan): string;
3304
3485
  protected compileInsertSuffix(_plan: InsertQueryPlan): string;
3305
3486
  protected compileUpsertSuffix(plan: UpsertQueryPlan, _insertColumns: readonly string[]): string;
3487
+ protected compileReturningClause(returning: boolean): string;
3306
3488
  protected compileHavingExpression(expression: string): string;
3307
3489
  protected compileColumnReference(reference: string): string;
3308
3490
  protected compileTableReference(reference: string): string;
@@ -3881,53 +4063,4 @@ declare function HasUuids<TTable extends TableDefinition = TableDefinition>(opti
3881
4063
  declare function HasUlids<TTable extends TableDefinition = TableDefinition>(options?: Omit<UniqueIdTraitOptions<TTable>, 'generator'>): UniqueIdTrait<TTable>;
3882
4064
  declare function HasSnowflakes<TTable extends TableDefinition = TableDefinition>(options?: Omit<UniqueIdTraitOptions<TTable>, 'generator'>): UniqueIdTrait<TTable>;
3883
4065
 
3884
- interface HoloProjectPaths {
3885
- models: string;
3886
- migrations: string;
3887
- generatedSchema: string;
3888
- seeders: string;
3889
- observers: string;
3890
- factories: string;
3891
- commands: string;
3892
- jobs: string;
3893
- events: string;
3894
- listeners: string;
3895
- authorizationPolicies: string;
3896
- authorizationAbilities: string;
3897
- }
3898
- interface HoloProjectConnectionConfig {
3899
- driver?: SupportedDatabaseDriver;
3900
- url?: string;
3901
- host?: string;
3902
- port?: number | string;
3903
- username?: string;
3904
- password?: string;
3905
- database?: string;
3906
- filename?: string;
3907
- schema?: string;
3908
- ssl?: boolean | Record<string, unknown>;
3909
- logging?: boolean;
3910
- }
3911
- interface HoloProjectDatabaseConfig {
3912
- defaultConnection?: string;
3913
- connections?: Record<string, HoloProjectConnectionConfig | string>;
3914
- }
3915
- interface HoloProjectConfig {
3916
- paths?: Partial<HoloProjectPaths>;
3917
- database?: HoloProjectDatabaseConfig;
3918
- models?: readonly string[];
3919
- migrations?: readonly string[];
3920
- seeders?: readonly string[];
3921
- }
3922
- declare const DEFAULT_HOLO_PROJECT_PATHS: Readonly<HoloProjectPaths>;
3923
- interface NormalizedHoloProjectConfig {
3924
- readonly paths: Readonly<HoloProjectPaths>;
3925
- readonly database?: HoloProjectDatabaseConfig;
3926
- readonly models: readonly string[];
3927
- readonly migrations: readonly string[];
3928
- readonly seeders: readonly string[];
3929
- }
3930
- declare function normalizeHoloProjectConfig(config?: HoloProjectConfig): NormalizedHoloProjectConfig;
3931
- declare function defineHoloProject<TConfig extends HoloProjectConfig>(config: TConfig): NormalizedHoloProjectConfig & TConfig;
3932
-
3933
- export { type AddColumnOperation, type AlterColumnOperation, type AnyColumnDefinition, type AnyModelDefinition, AsyncConnectionContext, type BelongsToManyRelationDefinition, type BelongsToManyRelationMethods, type BelongsToRelationDefinition, type BelongsToRelationMethods, type BoundTableDefinition, type BuiltInCastName, type BuiltInCastString, CapabilityError, type CastableDefinition, ColumnBuilder, type ColumnDefinition, type CompiledStatement, CompilerError, type ConcurrencyOptions, ConfigurationError, ConnectionManager, type ConnectionManagerOptions, type CreateForeignKeyOperation, type CreateIndexOperation, type CreateTableOperation, type CursorPaginatedResult, type CursorPaginationOptions, DB, type DDLOperation, type DDLStatement, DEFAULT_CAPABILITIES, DEFAULT_HOLO_PROJECT_PATHS, DEFAULT_SECURITY_POLICY, DIALECT_ID_STRATEGY_MAP, DIALECT_LOGICAL_TYPE_MAP, DIALECT_VECTOR_SUPPORT, type DatabaseCapabilities, DatabaseContext, type DatabaseContextOptions, type DatabaseDependencyCollectionResult, type DatabaseDependencyInvalidationEvent, type DatabaseDependencyInvalidationListener, type DatabaseDriverName, DatabaseError, type DatabaseLogger, type DatabaseOperationOptions, type DatabaseQueryCacheBridge, type DatabaseTransactionOptions, type DefineModelOptions, type DefineTableOptions, type DeleteQueryPlan, type Dialect, type DriverAdapter, type DriverExecutionResult, type DriverQueryResult, type DropColumnOperation, type DropForeignKeyOperation, type DropIndexOperation, type DropTableOperation, type DynamicRelationResolver, type EmptyScopeMap, Entity, type EntityWithLoaded, type EnumCastDefinition, Factory, type FactoryAttributes, type FactoryContext, type FactoryDefinition, type FactoryHook, type FactoryModelReference, FactoryService, type FactoryStateDefinition, type ForeignKeyReference, type GeneratedMigrationTemplate, type GeneratedSchemaTable, type GeneratedSchemaTableName, type GeneratedSchemaTables, type HasManyRelationDefinition, type HasManyRelationMethods, type HasManyThroughRelationDefinition, type HasOneOfManyRelationDefinition, type HasOneRelationDefinition, type HasOneRelationMethods, type HasOneThroughRelationDefinition, HasSnowflakes, HasUlids, HasUniqueIds, HasUuids, type HoloProjectConfig, type HoloProjectConnectionConfig, type HoloProjectDatabaseConfig, type HoloProjectPaths, HydrationError, type IdGenerationStrategy, type InferInsert, type InferSelect, type InferUpdate, type InsertQueryPlan, type IntrospectedColumn, type IntrospectedForeignKey, type IntrospectedIndex, type LogicalColumnKind, type MigrateOptions, type MigrationContext, type MigrationDefinition, type MigrationErrorLog, type MigrationExecutionPolicy, MigrationService, type MigrationSquashPlan, type MigrationStartLog, type MigrationStatus, type MigrationSuccessLog, type MigrationTemplateKind, type MigrationTemplateOptions, type ModelAttributeKey, type ModelCastDefinition, type ModelCollection, type ModelDefinition, type ModelDefinitionLike, ModelEventService, type ModelInsertPayload, ModelNotFoundException, ModelQueryBuilder, type ModelRecord, type ModelReference, ModelRegistry, type ModelRelationPath, ModelRepository, type ModelRepositoryLike, type ModelScopeArgs, type ModelScopeMap, type ModelTrait, type ModelUpdatePayload, type MorphManyRelationDefinition, type MorphOneOfManyRelationDefinition, type MorphOneRelationDefinition, type MorphToManyRelationDefinition, type MorphToRelationDefinition, type MorphedByManyRelationDefinition, MySQLAdapter, type MySQLAdapterOptions, type MySQLClientLike, type MySQLPoolLike, MySQLQueryCompiler, type MySQLQueryableLike, MySQLSchemaCompiler, type NormalizedHoloProjectConfig, type PaginatedResult, type PaginationMeta, type PaginationOptions, type PivotRelationMethods, PostgresAdapter, type PostgresAdapterOptions, type PostgresClientLike, type PostgresPoolLike, PostgresQueryCompiler, type PostgresQueryableLike, PostgresSchemaCompiler, type QueryCacheConfig, type QueryCacheFlexibleTtlInput, type QueryCacheTtlInput, type QueryDirection, type QueryOperator, type QueryOrderBy, type QueryPlan, type QueryPredicate, QueryScheduler, type QuerySelection, type QuerySource, type RegisteredModelName, type RegisteredModelReference, type RegisteredModels, type RelatedColumnNameForRelationPath, type RelationConstraintDefinition, type RelationDefinition, RelationError, type RelationMap, type RenameColumnOperation, type RenameIndexOperation, type RenameTableOperation, type ResolveEagerLoadPath, type ResolveEagerLoadUnion, type ResolveEagerLoads, type RollbackOptions, type RuntimeConfigInput, type RuntimeConnectionConfig, type RuntimeDatabaseConfig, type RuntimeHoloConfig, SQLQueryCompiler, SQLSchemaCompiler, SQLiteAdapter, type SQLiteAdapterOptions, type SQLiteDatabaseLike, SQLiteQueryCompiler, SQLiteSchemaCompiler, type SQLiteStatementLike, type SchemaColumnMismatch, type SchemaDefaultDialectName, type SchemaDialectName, type SchemaDiff, SchemaError, type SchemaForeignKeyMismatch, type SchemaIndexMismatch, SchemaRegistry, SchemaService, type SchemaSyncPlan, SecurityError, type SecurityPolicy, type SeedOptions, type SeederContext, type SeederDefinition, type SeederErrorLog, SeederService, type SeederStartLog, type SeederSuccessLog, type SelectQueryPlan, SerializationError, type SerializeLoaded, type SerializeModels, type SerializedEntityWithLoaded, type SimplePaginatedResult, type SimplePaginationMeta, type StaticModelApi, type SupportedDatabaseDriver, type TableColumnsShape, type TableDefinition, TableDefinitionBuilder, type TableIndexDefinition, TableMutationBuilder, TableQueryBuilder, type TableSchemaDiff, type TransactionCallback, TransactionError, type TransactionMode, type UniqueIdRuntimeConfig, type UniqueIdTrait, type UniqueIdTraitKind, type UnsafeStatement, type UpdateQueryPlan, type VectorValue, addColumnOperation, alterColumnOperation, belongsTo, belongsToMany, binaryCast, clearGeneratedTables, collectDatabaseQueryDependencies, column, compileDialectDefaultLiteral, configureDB, configureDatabaseQueryCacheBridge, connectionAsyncContext, createAdapter, createCapabilities, createConnectionManager, createCursorPaginator, createDatabase, createDeleteQueryPlan, createDialect, createFactoryService, createForeignKeyOperation, createIndexOperation, createInsertQueryPlan, createMigrationFileName, createMigrationService, createMigrationTimestamp, createModelCollection, createModelEventService, createModelRegistry, createMySQLAdapter, createPaginator, createPostgresAdapter, createQueryScheduler, createRuntimeConnectionOptions, createRuntimeLogger, createSQLiteAdapter, diffSchema as createSchemaDiff, createSchemaRegistry, createSchemaService, createSecurityPolicy, createSeederService, createSelectQueryPlan, createSimplePaginator, createTableOperation, createTableSource, createUpdateQueryPlan, defineFactory, defineGeneratedTable, defineHoloProject, defineMigration, defineModel, defineSeeder, diffSchema, dropColumnOperation, dropForeignKeyOperation, dropIndexOperation, dropTableOperation, encryptedCast, enumCast, generateMigrationTemplate, generateSnowflake, generateUlid, generateUuidV7, getDatabaseQueryCacheBridge, getGeneratedTableDefinition, getModelDefinition, hasMany, hasManyThrough, hasOne, hasOneThrough, inferMigrationTableName, inferMigrationTemplateKind, isSupportedDatabaseDriver, latestMorphOne, latestOfMany, listGeneratedTableDefinitions, morphMany, morphOfMany, morphOne, morphTo, morphToMany, morphedByMany, normalizeDialectReadValue, normalizeDialectWriteValue, normalizeHoloProjectConfig, normalizeMigrationSlug, ofMany, oldestMorphOne, oldestOfMany, onDatabaseDependencyInvalidated, parseDatabaseDriver, queryCacheInternals, recordDatabaseQueryDependencies, redactBindings, redactSql, registerGeneratedTables, renameColumnOperation, renameIndexOperation, renameTableOperation, renderGeneratedSchemaModule, renderGeneratedSchemaPlaceholder, renderGeneratedSchemaRuntimeModule, resetDB, resetDatabaseDependencyInvalidationListeners, resetDatabaseQueryCacheBridge, resetGlobalModelRegistry, resetMorphRegistry, resolveDialectColumnType, resolveDialectIdStrategyType, resolveGeneratedTableDefinition, resolveMorphModel, resolveRuntimeConnectionManagerOptions, scopeRelation, serializeModels, uniqueSlug, unsafeSql, validateQueryPlan, withLimit, withOffset, withOrderBy, withPredicate, withSelections };
4066
+ export { type AddColumnOperation, type AlterColumnOperation, type AnyColumnDefinition, type AnyModelDefinition, AsyncConnectionContext, type BelongsToManyRelationDefinition, type BelongsToManyRelationMethods, type BelongsToRelationDefinition, type BelongsToRelationMethods, type BoundTableDefinition, type BuiltInCastName, type BuiltInCastString, CapabilityError, type CastableDefinition, ColumnBuilder, type ColumnDefinition, type CompiledStatement, CompilerError, type ConcurrencyOptions, ConfigurationError, ConnectionManager, type ConnectionManagerOptions, type CreateForeignKeyOperation, type CreateIndexOperation, type CreateTableOperation, type CursorPaginatedResult, type CursorPaginationOptions, DB, type DDLOperation, type DDLStatement, DEFAULT_CAPABILITIES, DEFAULT_SECURITY_POLICY, DIALECT_ID_STRATEGY_MAP, DIALECT_LOGICAL_TYPE_MAP, DIALECT_VECTOR_SUPPORT, type DatabaseCapabilities, DatabaseContext, type DatabaseContextOptions, type DatabaseDependencyCollectionResult, type DatabaseDependencyInvalidationEvent, type DatabaseDependencyInvalidationListener, type DatabaseDriverConnection, type DatabaseDriverFactory, type DatabaseDriverName, DatabaseError, type DatabaseLogger, type DatabaseOperationOptions, type DatabaseQueryCacheBridge, type DatabaseTransactionOptions, DeferredDatabaseDriverAdapter, type DefineModelOptions, type DefineTableOptions, type DeleteQueryPlan, type Dialect, type DriverAdapter, type DriverExecutionResult, type DriverQueryResult, type DropColumnOperation, type DropForeignKeyOperation, type DropIndexOperation, type DropTableOperation, type DynamicRelationResolver, type EmptyScopeMap, Entity, type EntityWithLoaded, type EnumCastDefinition, Factory, type FactoryAttributes, type FactoryContext, type FactoryDefinition, type FactoryHook, type FactoryModelReference, FactoryService, type FactoryStateDefinition, type ForeignKeyReference, type GeneratedMigrationTemplate, type GeneratedSchemaTable, type GeneratedSchemaTableName, type GeneratedSchemaTables, type HasManyRelationDefinition, type HasManyRelationMethods, type HasManyThroughRelationDefinition, type HasOneOfManyRelationDefinition, type HasOneRelationDefinition, type HasOneRelationMethods, type HasOneThroughRelationDefinition, HasSnowflakes, HasUlids, HasUniqueIds, HasUuids, HydrationError, type IdGenerationStrategy, type InferInsert, type InferSelect, type InferUpdate, type InsertQueryPlan, type IntrospectedColumn, type IntrospectedForeignKey, type IntrospectedIndex, type LogicalColumnKind, type MigrateOptions, type MigrationContext, type MigrationDefinition, type MigrationErrorLog, type MigrationExecutionPolicy, MigrationService, type MigrationSquashPlan, type MigrationStartLog, type MigrationStatus, type MigrationSuccessLog, type MigrationTemplateKind, type MigrationTemplateOptions, type ModelAttributeKey, type ModelCastDefinition, type ModelCollection, type ModelDefinition, type ModelDefinitionLike, ModelEventService, type ModelInsertPayload, ModelNotFoundException, ModelQueryBuilder, type ModelRecord, type ModelReference, ModelRegistry, type ModelRelationPath, ModelRepository, type ModelRepositoryLike, type ModelScopeArgs, type ModelScopeMap, type ModelTrait, type ModelUpdatePayload, type MorphManyRelationDefinition, type MorphOneOfManyRelationDefinition, type MorphOneRelationDefinition, type MorphToManyRelationDefinition, type MorphToRelationDefinition, type MorphedByManyRelationDefinition, MySQLQueryCompiler, MySQLSchemaCompiler, type PaginatedResult, type PaginationMeta, type PaginationOptions, type PivotRelationMethods, PostgresQueryCompiler, PostgresSchemaCompiler, type QueryCacheConfig, type QueryCacheFlexibleTtlInput, type QueryCacheTtlInput, type QueryDirection, type QueryOperator, type QueryOrderBy, type QueryPlan, type QueryPredicate, QueryScheduler, type QuerySelection, type QuerySource, type RegisteredModelName, type RegisteredModelReference, type RegisteredModels, type RelatedColumnNameForRelationPath, type RelationConstraintDefinition, type RelationDefinition, RelationError, type RelationMap, type RenameColumnOperation, type RenameIndexOperation, type RenameTableOperation, type ResolveEagerLoadPath, type ResolveEagerLoadUnion, type ResolveEagerLoads, type RollbackOptions, type RuntimeConfigInput, type RuntimeConnectionConfig, type RuntimeDatabaseConfig, type RuntimeHoloConfig, SQLQueryCompiler, SQLSchemaCompiler, SQLiteQueryCompiler, SQLiteSchemaCompiler, type SchemaColumnMismatch, type SchemaDefaultDialectName, type SchemaDialectName, type SchemaDiff, SchemaError, type SchemaForeignKeyMismatch, type SchemaIndexMismatch, SchemaRegistry, SchemaService, type SchemaSyncPlan, SecurityError, type SecurityPolicy, type SeedOptions, type SeederContext, type SeederDefinition, type SeederErrorLog, SeederService, type SeederStartLog, type SeederSuccessLog, type SelectQueryPlan, SerializationError, type SerializeLoaded, type SerializeModels, type SerializedEntityWithLoaded, type SimplePaginatedResult, type SimplePaginationMeta, type StaticModelApi, type SupportedDatabaseDriver, type TableColumnsShape, type TableDefinition, TableDefinitionBuilder, type TableIndexDefinition, TableMutationBuilder, TableQueryBuilder, type TableSchemaDiff, type TransactionCallback, TransactionError, type TransactionMode, type UniqueIdRuntimeConfig, type UniqueIdTrait, type UniqueIdTraitKind, type UnsafeStatement, type UpdateQueryPlan, type VectorValue, addColumnOperation, alterColumnOperation, belongsTo, belongsToMany, binaryCast, clearGeneratedTables, collectDatabaseQueryDependencies, column, compileDialectDefaultLiteral, configureDB, configureDatabaseQueryCacheBridge, connectionAsyncContext, createAdapter, createCapabilities, createConnectionManager, createCursorPaginator, createDatabase, createDeferredDatabaseDriverAdapter, createDeleteQueryPlan, createDialect, createFactoryService, createForeignKeyOperation, createIndexOperation, createInsertQueryPlan, createMigrationFileName, createMigrationService, createMigrationTimestamp, createModelCollection, createModelEventService, createModelRegistry, createPaginator, createQueryScheduler, createRuntimeConnectionOptions, createRuntimeLogger, diffSchema as createSchemaDiff, createSchemaRegistry, createSchemaService, createSecurityPolicy, createSeederService, createSelectQueryPlan, createSimplePaginator, createTableOperation, createTableSource, createUpdateQueryPlan, defineFactory, defineGeneratedTable, defineMigration, defineModel, defineSeeder, diffSchema, dropColumnOperation, dropForeignKeyOperation, dropIndexOperation, dropTableOperation, encryptedCast, enumCast, generateMigrationTemplate, generateSnowflake, generateUlid, generateUuidV7, getDatabaseDriverFactory, getDatabaseQueryCacheBridge, getGeneratedTableDefinition, getModelDefinition, hasMany, hasManyThrough, hasOne, hasOneThrough, inferMigrationTableName, inferMigrationTemplateKind, isSupportedDatabaseDriver, latestMorphOne, latestOfMany, listGeneratedTableDefinitions, morphMany, morphOfMany, morphOne, morphTo, morphToMany, morphedByMany, normalizeDialectReadValue, normalizeDialectWriteValue, normalizeMigrationSlug, ofMany, oldestMorphOne, oldestOfMany, onDatabaseDependencyInvalidated, parseDatabaseDriver, queryCacheInternals, recordDatabaseQueryDependencies, redactBindings, redactSql, registerDatabaseDriverFactory, registerGeneratedTables, renameColumnOperation, renameIndexOperation, renameTableOperation, renderGeneratedSchemaModule, renderGeneratedSchemaPlaceholder, renderGeneratedSchemaRuntimeModule, resetDB, resetDatabaseDependencyInvalidationListeners, resetDatabaseQueryCacheBridge, resetGlobalModelRegistry, resetMorphRegistry, resolveDialectColumnType, resolveDialectIdStrategyType, resolveGeneratedTableDefinition, resolveMorphModel, resolveRuntimeConnectionManagerOptions, scopeRelation, serializeModels, uniqueSlug, unregisterDatabaseDriverFactory, unsafeSql, validateQueryPlan, withLimit, withOffset, withOrderBy, withPredicate, withSelections };