Skip to main content
Version: 6.3

@mikro-orm/core

Index

Classes

Enumerations

Functions

Interfaces

Type Aliases

Variables

Type Aliases

AnyEntity

AnyEntity<T>: Partial<T>

Type parameters

  • T = any

AutoPath

AutoPath<O, P, E, D>: P extends boolean ? P : [D] extends [never] ? never : P extends any ? P extends string ? ((P & `${string}.`) extends never ? P : P & `${string}.`) extends infer Q ? Q extends `${infer A}.${infer B}` ? A extends StringKeys<O, E> ? `${A}.${AutoPath<NonNullable<GetStringKey<..., ..., ...>>, B, E, Prev[D]>}` : never : Q extends StringKeys<O, E> ? (NonNullable<...> extends unknown ? Exclude<..., ...> : never) | (StringKeys<..., ...> extends never ? never : `${...}.`) : StringKeys<O, E> | `${CollectionKeys<O>}:ref` : never : never : never

Type parameters

  • O
  • P: string | boolean
  • E: string = never
  • D: Prev[number] = 9

Cast

Cast<T, R>: T extends R ? T : R

Type parameters

  • T
  • R

CheckCallback

CheckCallback<T>: (columns: Record<keyof T, string>) => string

Type parameters

  • T

Type declaration

    • (columns: Record<keyof T, string>): string
    • Parameters

      • columns: Record<keyof T, string>

      Returns string

CheckOptions

CheckOptions<T>: CheckConstraint<T>

Type parameters

  • T = any

ConnectionType

ConnectionType: read | write

Constructor

Constructor<T>: new (...args: any[]) => T

Type parameters

  • T = unknown

Type declaration

    • new (...args: any[]): T
    • Parameters

      • rest...args: any[]

      Returns T

DeepPartial

DeepPartial<T>: T & { [ P in keyof T ]?: T[P] extends infer U[] ? DeepPartial<U>[] : T[P] extends Readonly<infer U>[] ? Readonly<DeepPartial<U>>[] : DeepPartial<T[P]> }

Type parameters

  • T

DefineConfig

DefineConfig<T>: T & { [___config]?: 1 }

Type parameters

Dictionary

Dictionary<T>: {}

Type parameters

  • T = any

Type declaration

  • [k string]: T

EmbeddableOptions

EmbeddableOptions: { abstract?: boolean; discriminatorColumn?: string; discriminatorMap?: Dictionary<string>; discriminatorValue?: number | string }

Type declaration

  • optionalabstract?: boolean
  • optionaldiscriminatorColumn?: string
  • optionaldiscriminatorMap?: Dictionary<string>
  • optionaldiscriminatorValue?: number | string

EmbeddedOptions

EmbeddedOptions: { array?: boolean; entity?: string | () => AnyEntity | AnyEntity[]; groups?: string[]; hidden?: boolean; nullable?: boolean; object?: boolean; persist?: boolean; prefix?: string | boolean; serializedName?: string; serializer?: (value: any) => any; type?: string }

Type declaration

  • optionalarray?: boolean
  • optionalentity?: string | () => AnyEntity | AnyEntity[]
  • optionalgroups?: string[]
  • optionalhidden?: boolean
  • optionalnullable?: boolean
  • optionalobject?: boolean
  • optionalpersist?: boolean
  • optionalprefix?: string | boolean
  • optionalserializedName?: string
  • optionalserializer?: (value: any) => any
      • (value: any): any
      • Parameters

        • value: any

        Returns any

  • optionaltype?: string

EntityClass

EntityClass<T>: Function & { prototype: T }

Type parameters

  • T

EntityClassGroup

EntityClassGroup<T>: { entity: EntityClass<T>; schema: EntityMetadata<T> | EntitySchema<T> }

Type parameters

  • T

Type declaration

EntityDTO

EntityDTO<T, C>: { [ K in keyof T as DTORequiredKeys<T, K> ]: EntityDTOProp<T, T[K], C> | AddOptional<T[K]> } & { [ K in keyof T as DTOOptionalKeys<T, K> ]?: EntityDTOProp<T, T[K], C> | AddOptional<T[K]> }

Type parameters

EntityData

EntityData<T, C>: { [ K in EntityKey<T> ]?: EntityDataItem<T[K], C> }

Type parameters

  • T
  • C: boolean = false

EntityDictionary

EntityDictionary<T>: EntityData<T> & Record<any, any>

Type parameters

  • T

EntityField

EntityField<T, P>: keyof T | PopulatePath.ALL | AutoPath<T, P, `${PopulatePath.ALL}`>

Type parameters

  • T
  • P: string = PopulatePath.ALL

EntityKey

EntityKey<T, B>: string & { [ K in keyof T ]-?: CleanKeys<T, K, B> extends never ? never : K }[keyof T]

Type parameters

  • T = unknown
  • B: boolean = false

EntityLoaderOptions

EntityLoaderOptions<Entity, Fields, Excludes>: { connectionType?: ConnectionType; convertCustomTypes?: boolean; exclude?: readonly EntityField<Entity, Excludes>[]; fields?: readonly EntityField<Entity, Fields>[]; filters?: Dictionary<boolean | Dictionary> | string[] | boolean; ignoreLazyScalarProperties?: boolean; lockMode?: Exclude<LockMode, LockMode.OPTIMISTIC>; logging?: LoggingOptions; lookup?: boolean; orderBy?: QueryOrderMap<Entity> | QueryOrderMap<Entity>[]; populateWhere?: PopulateHint | `${PopulateHint}`; refresh?: boolean; schema?: string; strategy?: LoadStrategy; validate?: boolean; where?: FilterQuery<Entity> }

Type parameters

  • Entity
  • Fields: string = PopulatePath.ALL
  • Excludes: string = never

Type declaration

EntityName

EntityName<T>: string | EntityClass<T> | EntitySchema<T, any> | { name: string }

Type parameters

  • T

EntityOptions

EntityOptions<T>: { abstract?: boolean; collection?: string; comment?: string; discriminatorColumn?: string; discriminatorMap?: Dictionary<string>; discriminatorValue?: number | string; expression?: string | (em: any, where: FilterQuery<T>, options: FindOptions<T, any, any, any>) => object; forceConstructor?: boolean; readonly?: boolean; repository?: () => Constructor; schema?: string; tableName?: string; virtual?: boolean }

Type parameters

  • T

Type declaration

  • optionalabstract?: boolean
  • optionalcollection?: string
  • optionalcomment?: string
  • optionaldiscriminatorColumn?: string
  • optionaldiscriminatorMap?: Dictionary<string>
  • optionaldiscriminatorValue?: number | string
  • optionalexpression?: string | (em: any, where: FilterQuery<T>, options: FindOptions<T, any, any, any>) => object
  • optionalforceConstructor?: boolean
  • optionalreadonly?: boolean
  • optionalrepository?: () => Constructor
  • optionalschema?: string
  • optionaltableName?: string
  • optionalvirtual?: boolean

EntityProps

EntityProps<T>: { -readonly [ K in EntityKey<T> ]?: T[K] }

Type parameters

  • T

EntityRef

EntityRef<T>: true extends IsUnknown<PrimaryProperty<T>> ? Reference<T> : IsAny<T> extends true ? Reference<T> : { [ K in PrimaryProperty<T> & keyof T ]: T[K] } & Reference<T>

Alias for Reference<T> & { id: number } (see Ref).


Type parameters

  • T: object

EntitySchemaMetadata

EntitySchemaMetadata<Entity, Base>: Omit<Partial<EntityMetadata<Entity>>, name | properties | extends> & ({ name: string } | { class: EntityClass<Entity>; name?: string }) & { extends?: string | EntitySchema<Base> } & { properties?: { [ Key in keyof OmitBaseProps<Entity, Base> as CleanKeys<OmitBaseProps<Entity, Base>, Key> ]-?: EntitySchemaProperty<ExpandProperty<NonNullable<Entity[Key]>>, Entity> } }

Type parameters

  • Entity
  • Base = never

EntitySchemaProperty

EntitySchemaProperty<Target, Owner>: ({ kind: ReferenceKind.MANY_TO_ONE | m:1 } & TypeDef<Target> & ManyToOneOptions<Owner, Target>) | ({ kind: ReferenceKind.ONE_TO_ONE | 1:1 } & TypeDef<Target> & OneToOneOptions<Owner, Target>) | ({ kind: ReferenceKind.ONE_TO_MANY | 1:m } & TypeDef<Target> & OneToManyOptions<Owner, Target>) | ({ kind: ReferenceKind.MANY_TO_MANY | m:n } & TypeDef<Target> & ManyToManyOptions<Owner, Target>) | ({ kind: ReferenceKind.EMBEDDED | embedded } & EmbeddedTypeDef<Target> & EmbeddedOptions & PropertyOptions<Owner>) | ({ enum: true } & EnumOptions<Owner>) | (TypeDef<Target> & PropertyOptions<Owner>)

Type parameters

  • Target
  • Owner

EntityType

EntityType<T>: T | LoadedEntityType<T>

Type parameters

  • T

EntityValue

EntityValue<T>: T[EntityKey<T>]

Type parameters

  • T

ExpandHint

ExpandHint<T, L>: L | AddEager<T>

Type parameters

  • T
  • L: string

ExpandProperty

ExpandProperty<T>: T extends Reference<infer U> ? NonNullable<U> : T extends Collection<infer U, any> ? NonNullable<U> : T extends infer U[] ? NonNullable<U> : NonNullable<T>

Type parameters

  • T

ExpandQuery

ExpandQuery<T>: T extends object ? T extends Scalar ? never : FilterQuery<T> : FilterValue<T>

Type parameters

  • T

ExpandScalar

ExpandScalar<T>: null | (T extends string ? T | RegExp : T extends Date ? Date | string : T extends bigint ? bigint | string | number : T)

Type parameters

  • T

FilterItemValue

FilterItemValue<T>: T | ExpandScalar<T> | Primary<T>

Type parameters

  • T

FilterKey

FilterKey<T>: keyof FilterQuery<T>

Type parameters

  • T

FilterObject

FilterObject<T>: { -readonly [ K in EntityKey<T> ]?: ExpandQuery<ExpandProperty<T[K]>> | FilterValue<ExpandProperty<T[K]>> | null }

Type parameters

  • T

FilterOptions

FilterOptions: Dictionary<boolean | Dictionary> | string[] | boolean

FilterQuery

FilterQuery<T>: ObjectQuery<T> | NonNullable<ExpandScalar<Primary<T>>> | NonNullable<EntityProps<T> & OperatorMap<T>> | FilterQuery<T>[]

Type parameters

  • T

FilterValue

FilterValue<T>: OperatorMap<FilterItemValue<T>> | FilterItemValue<T> | FilterItemValue<T>[] | null

Type parameters

  • T

FromEntityType

FromEntityType<T>: T extends LoadedEntityType<infer U> ? U : T

Type parameters

  • T

GetRepository

GetRepository<Entity, Fallback>: Entity[typeof EntityRepositoryType] extends EntityRepository<Entity> | undefined ? NonNullable<Entity[typeof EntityRepositoryType]> : Fallback

Type parameters

  • Entity: {}
  • Fallback

Hidden

Hidden<T>: T & { [___hidden]?: 1 }

Type parameters

  • T = unknown

IPrimaryKey

IPrimaryKey<T>: T

Type parameters

  • T: IPrimaryKeyValue = IPrimaryKeyValue

IType

IType<Runtime, Raw, Serialized>: Runtime & { __raw?: Raw; __runtime?: Runtime; __serialized?: Serialized }

Type parameters

  • Runtime
  • Raw
  • Serialized = Raw

ImportsResolver

ImportsResolver: (alias: string, basePath: string, extension: .js | , originFileName: string) => { name: string; path: string } | undefined

Type declaration

    • (alias: string, basePath: string, extension: .js | , originFileName: string): { name: string; path: string } | undefined
    • Parameters

      • alias: string
      • basePath: string
      • extension: .js |
      • originFileName: string

      Returns { name: string; path: string } | undefined

IsSubset

IsSubset<T, U>: keyof U extends keyof T ? {} : Dictionary extends U ? {} : { [ K in keyof U as K extends keyof T ? never : CleanKeys<U, K> ]: never }

Type parameters

  • T
  • U

IsUnknown

IsUnknown<T>: T extends unknown ? unknown extends T ? true : never : never

Type parameters

  • T

Loaded

Loaded<T, L, F, E>: LoadedInternal<T, L, F, E> & { [___loadedType]?: T }

Represents entity with its loaded relations (populate hint) and selected properties (fields hint).


Type parameters

  • T
  • L: string = never
  • F: string = *
  • E: string = never

LoggerNamespace

LoggerNamespace: query | query-params | schema | discovery | info

LoggingOptions

LoggingOptions: Pick<LogContext, label | enabled | debugMode>

Logger options to modify format output and overrides, including a label and additional properties that can be accessed by custom loggers.

Differs from LoggerOptions in terms of how they are used; this type is primarily a public type meant to be used within methods like em.find().

@example
await em.findOne(User, 1, { logger: { label: 'user middleware' } };
// [query] (user middleware) select * from user where id = 1;

MergeLoaded

MergeLoaded<T, U, P, F, E, R>: T extends Loaded<U, infer PP, infer FF, infer EE> ? string extends FF ? Loaded<T, P, F, AnyStringToNever<EE> | E> : string extends P ? Loaded<U, never, F | (FF & string), MergeExcludes<F | (FF & string), EE | E>> : Loaded<U, P | AnyStringToNever<PP>, MergeFields<F, AnyStringToNever<FF>, P, PP>, MergeExcludes<MergeFields<F, AnyStringToNever<FF>, P, PP>, (R extends true ? never : EE) | E>> : Loaded<T, P, F>

Type parameters

  • T
  • U
  • P: string
  • F: string
  • E: string
  • R: boolean = false

MergeSelected

MergeSelected<T, U, F>: T extends Loaded<infer TT, infer P, infer FF, infer E> ? IsNever<Exclude<E, F>> extends true ? Loaded<TT, P, AnyStringToNever<F> | AnyStringToNever<FF>> : Loaded<TT, AnyStringToNever<P>, AnyStringToNever<FF>, AnyStringToNever<Exclude<E, F>>> : T

Type parameters

  • T
  • U
  • F: string

MetadataProcessor

MetadataProcessor: (metadata: EntityMetadata[], platform: Platform) => MaybePromise<void>

Type declaration

MigrateOptions

MigrateOptions: { from?: string | number; migrations?: string[]; to?: string | number; transaction?: Transaction }

Type declaration

  • optionalfrom?: string | number
  • optionalmigrations?: string[]
  • optionalto?: string | number
  • optionaltransaction?: Transaction

MigrationResult

MigrationResult: { code: string; diff: MigrationDiff; fileName: string }

Type declaration

MigrationRow

MigrationRow: { executed_at: Date; name: string }

Type declaration

  • executed_at: Date
  • name: string

MigrationsOptions

MigrationsOptions: { allOrNothing?: boolean; disableForeignKeys?: boolean; dropTables?: boolean; emit?: js | ts | cjs; fileName?: (timestamp: string, name?: string) => string; generator?: Constructor<IMigrationGenerator>; glob?: string; migrationsList?: MigrationObject[]; path?: string; pathTs?: string; safe?: boolean; silent?: boolean; snapshot?: boolean; snapshotName?: string; tableName?: string; transactional?: boolean }

Type declaration

  • optionalallOrNothing?: boolean
  • optionaldisableForeignKeys?: boolean
  • optionaldropTables?: boolean
  • optionalemit?: js | ts | cjs
  • optionalfileName?: (timestamp: string, name?: string) => string
      • (timestamp: string, name?: string): string
      • Parameters

        • timestamp: string
        • optionalname: string

        Returns string

  • optionalgenerator?: Constructor<IMigrationGenerator>
  • optionalglob?: string
  • optionalmigrationsList?: MigrationObject[]
  • optionalpath?: string
  • optionalpathTs?: string
  • optionalsafe?: boolean
  • optionalsilent?: boolean
  • optionalsnapshot?: boolean
  • optionalsnapshotName?: string
  • optionaltableName?: string
  • optionaltransactional?: boolean

New

New<T, P>: Loaded<T, P>

Type parameters

  • T
  • P: string = string

NoInfer

NoInfer<T>: [T][T extends any ? 0 : never]

Type parameters

  • T

ObjectQuery

ObjectQuery<T>: OperatorMap<T> & FilterObject<T>

Type parameters

  • T

OneToManyOptions

OneToManyOptions<Owner, Target>: ReferenceOptions<Owner, Target> & { entity?: string | () => EntityName<Target>; inverseJoinColumn?: string; inverseJoinColumns?: string[]; joinColumn?: string; joinColumns?: string[]; mappedBy: (string & keyof Target) | (e: Target) => any; orderBy?: QueryOrderMap<Target> | QueryOrderMap<Target>[]; orphanRemoval?: boolean; referenceColumnName?: string; where?: FilterQuery<Target> }

Type parameters

  • Owner
  • Target

Opt

Opt<T>: T & { [___optional]?: 1 }

Type parameters

  • T = unknown

Options

Options<D, EM>: Pick<MikroORMOptions<D, EM>, Exclude<keyof MikroORMOptions<D, EM>, keyof typeof Configuration.DEFAULTS>> & Partial<MikroORMOptions<D, EM>>

OrderDefinition

OrderDefinition<T>: (QueryOrderMap<T> & { 0?: never }) | QueryOrderMap<T>[]

Type parameters

  • T

Populate

Populate<T, P>: readonly AutoPath<T, P, `${PopulatePath}`>[] | false

Type parameters

  • T
  • P: string = never

PopulateOptions

PopulateOptions<T>: { all?: boolean; children?: PopulateOptions<T[keyof T]>[]; field: EntityKey<T>; filter?: boolean; strategy?: LoadStrategy }

Type parameters

  • T

Type declaration

Primary

Primary<T>: IsAny<T> extends true ? any : T extends { [PrimaryKeyProp]?: infer PK } ? PK extends keyof T ? ReadonlyPrimary<UnwrapPrimary<T[PK]>> : PK extends keyof T[] ? ReadonlyPrimary<PrimaryPropToType<T, PK>> : PK : T extends { _id?: infer PK } ? ReadonlyPrimary<PK> | string : T extends { uuid?: infer PK } ? ReadonlyPrimary<PK> : T extends { id?: infer PK } ? ReadonlyPrimary<PK> : T

Type parameters

  • T

PrimaryProperty

PrimaryProperty<T>: T extends { [PrimaryKeyProp]?: infer PK } ? PK extends keyof T ? PK : PK extends any[] ? PK[number] : never : T extends { _id?: any } ? T extends { id?: any } ? id | _id : _id : T extends { uuid?: any } ? uuid : T extends { id?: any } ? id : never

Type parameters

  • T

PropertyOptions

PropertyOptions<Owner>: { autoincrement?: boolean; check?: string | CheckCallback<Owner>; columnType?: ColumnType | AnyString; comment?: string; concurrencyCheck?: boolean; customOrder?: string[] | number[] | boolean[]; default?: string | string[] | number | number[] | boolean | null; defaultRaw?: string; extra?: string; fieldName?: string; fieldNames?: string[]; formula?: string | (alias: string) => string; generated?: string | GeneratedColumnCallback<Owner>; getter?: boolean; groups?: string[]; hidden?: boolean; hydrate?: boolean; ignoreSchemaChanges?: (type | extra | default)[]; index?: boolean | string; lazy?: boolean; length?: number; name?: string; nullable?: boolean; onCreate?: (entity: Owner, em: EntityManager) => any; onUpdate?: (entity: Owner, em: EntityManager) => any; persist?: boolean; precision?: number; primary?: boolean; ref?: boolean; returning?: boolean; runtimeType?: string; scale?: number; serializedName?: string; serializedPrimaryKey?: boolean; serializer?: (value: any) => any; setter?: boolean; trackChanges?: boolean; type?: keyof typeof types | ObjectId | Date | Constructor<AnyEntity> | Constructor<Type<any>> | Type<any> | () => unknown | ColumnType | AnyString; unique?: boolean | string; unsigned?: boolean; version?: boolean }

Type parameters

  • Owner

Type declaration

  • optionalautoincrement?: boolean

    Explicitly specify the auto increment of the primary key.

  • optionalcheck?: string | CheckCallback<Owner>

    Specify column with check constraints. (Postgres driver only)

    @see
  • optionalcolumnType?: ColumnType | AnyString

    Specify exact database column type for Generator. (SQL only)

  • optionalcomment?: string

    Specify comment of column for Generator. (SQL only)

  • optionalconcurrencyCheck?: boolean

    Set to true to enable Locking via concurrency fields.

  • optionalcustomOrder?: string[] | number[] | boolean[]

    Specify a custom order based on the values. (SQL only)

  • optionaldefault?: string | string[] | number | number[] | boolean | null

    Specify default column value for Generator. This is a runtime value, assignable to the entity property. (SQL only)

  • optionaldefaultRaw?: string

    Specify SQL functions for Generator. (SQL only) Since v4 you should use defaultRaw for SQL functions. e.g. now()

  • optionalextra?: string

    mysql only

  • optionalfieldName?: string

    Specify database column name for this property.

    @see
  • optionalfieldNames?: string[]

    Specify database column names for this property. Same as fieldName but for composite FKs.

    @see
  • optionalformula?: string | (alias: string) => string

    Set to map some SQL snippet for the entity.

    @see
  • optionalgenerated?: string | GeneratedColumnCallback<Owner>

    For generated columns. This will be appended to the column type after the generated always clause.

  • optionalgetter?: boolean

    Set true to define the properties as getter. (virtual)

    @example
    @Property({ getter: true })
    get fullName() {
    return this.firstName + this.lastName;
    }
  • optionalgroups?: string[]

    Specify serialization groups for serialize() calls. If a property does not specify any group, it will be included, otherwise only properties with a matching group are included.

  • optionalhidden?: boolean

    Set to true to omit the property when Serializing.

  • optionalhydrate?: boolean

    Set false to disable hydration of this property. Useful for persisted getters.

  • optionalignoreSchemaChanges?: (type | extra | default)[]

    Set to avoid a perpetual diff from the Generator when columns are generated.

    @see
  • optionalindex?: boolean | string

    Explicitly specify index on a property.

  • optionallazy?: boolean

    Set to omit the property from the select clause for lazy loading.

    @see
  • optionallength?: number

    Set length of database column, used for datetime/timestamp/varchar column types for Generator. (SQL only)

  • optionalname?: string

    Alias for fieldName.

  • optionalnullable?: boolean

    Set column as nullable for Generator.

  • optionalonCreate?: (entity: Owner, em: EntityManager) => any

    Automatically set the property value when entity gets created, executed during flush operation.

  • optionalonUpdate?: (entity: Owner, em: EntityManager) => any

    Automatically update the property value every time entity gets updated, executed during flush operation.

  • optionalpersist?: boolean

    Set false to define Property.

  • optionalprecision?: number

    Set precision of database column to represent the number of significant digits. (SQL only)

  • optionalprimary?: boolean

    Set true to define entity's unique primary key identifier. Alias for @PrimaryKey() decorator

    @see
  • optionalref?: boolean

    Enable ScalarReference wrapper for lazy values. Use this in combination with lazy: true to have a type-safe accessor object in place of the value.

  • optionalreturning?: boolean

    Add the property to the returning statement.

  • optionalruntimeType?: string

    Runtime type of the property. This is the JS type that your property is mapped to, e.g. string or number, and is normally inferred automatically via reflect-metadata. In some cases, the inference won't work, and you might need to specify the runtimeType explicitly - the most common one is when you use a union type with null like foo: number | null.

  • optionalscale?: number

    Set scale of database column to represents the number of digits after the decimal point. (SQL only)

  • optionalserializedName?: string

    Specify name of key for the serialized value.

  • optionalserializedPrimaryKey?: boolean

    Set to define serialized primary key for MongoDB. (virtual) Alias for @SerializedPrimaryKey() decorator.

    @see
  • optionalserializer?: (value: any) => any

    Set to use serialize property. Allow to specify a callback that will be used when serializing a property.

    @see
      • (value: any): any
      • Parameters

        • value: any

        Returns any

  • optionalsetter?: boolean

    Set true to define the properties as setter. (virtual)

    @example
    @Property({ setter: true })
    set address(value: string) {
    this._address = value.toLocaleLowerCase();
    }
  • optionaltrackChanges?: boolean

    Set false to disable change tracking on a property level.

    @see
  • optionaltype?: keyof typeof types | ObjectId | Date | Constructor<AnyEntity> | Constructor<Type<any>> | Type<any> | () => unknown | ColumnType | AnyString
  • optionalunique?: boolean | string

    Set column as unique for Generator. (SQL only)

  • optionalunsigned?: boolean

    Set column as unsigned for Generator. (SQL only)

  • optionalversion?: boolean

    Set to true to enable Locking via version field. (SQL only)

QBFilterQuery

QBFilterQuery<T>: ObjectQuery<T> | Dictionary

Type parameters

  • T = any

QBQueryOrderMap

QBQueryOrderMap<T>: QueryOrderMap<T> | Dictionary

Type parameters

  • T

QueryOrderKeys

QueryOrderKeys<T>: QueryOrderKeysFlat | QueryOrderMap<T>

Type parameters

  • T

QueryOrderKeysFlat

QueryOrderKeysFlat: QueryOrder | QueryOrderNumeric | keyof typeof QueryOrder

QueryOrderMap

QueryOrderMap<T>: { [ K in EntityKey<T> ]?: QueryOrderKeys<ExpandProperty<T[K]>> }

Type parameters

  • T

Ref

Ref<T>: T extends any ? IsAny<T> extends true ? Reference<T & object> : T extends Scalar ? ScalarReference<T> : EntityRef<T & object> : never

Ref type represents a Reference instance, and adds the primary keys to its prototype automatically, so you can do ref.id instead of ref.unwrap().id. It resolves to either ScalarRef or EntityRef, based on the type argument.


Type parameters

  • T

Rel

Rel<T>: T

Identity type that can be used to get around issues with cycles in bidirectional relations. It will disable reflect-metadata inference.


Type parameters

  • T

RequiredEntityData

RequiredEntityData<T, I, C>: { [ K in keyof T as RequiredKeys<T, K, I> ]: T[K] | RequiredEntityDataProp<T[K], T, C> | Primary<T[K]> } & { [ K in keyof T as OptionalKeys<T, K, I> ]?: T[K] | RequiredEntityDataProp<T[K], T, C> | Primary<T[K]> | null }

Type parameters

  • T
  • I = never
  • C: boolean = false

Scalar

Scalar: boolean | number | string | bigint | symbol | Date | RegExp | Uint8Array | { toHexString: any }

ScalarRef

ScalarRef<T>: ScalarReference<T>

Alias for ScalarReference (see Ref).


Type parameters

  • T

Selected

Selected<T, L, F>: { [ K in keyof T as IsPrefixed<T, K, L | F | AddEager<T>> ]: LoadedProp<NonNullable<T[K]>, Suffix<K, L, true>, Suffix<K, F, true>> | AddOptional<T[K]> } & { [ K in keyof T as FunctionKeys<T, K> ]: T[K] } & { [___selectedType]?: T }

Type parameters

  • T
  • L: string = never
  • F: string = *

Transaction

Transaction<T>: T

Type parameters

  • T = any

TransactionEventType

TransactionEventType: EventType.beforeTransactionStart | EventType.afterTransactionStart | EventType.beforeTransactionCommit | EventType.afterTransactionCommit | EventType.beforeTransactionRollback | EventType.afterTransactionRollback

UmzugMigration

UmzugMigration: { name: string; path?: string }

Type declaration

  • name: string
  • optionalpath?: string

UnboxArray

UnboxArray<T>: T extends any[] ? ArrayElement<T> : T

Type parameters

  • T

Variables

constARRAY_OPERATORS

ARRAY_OPERATORS: string[] = ...

constConfig

Config: typeof Config = ...

constEagerProps

EagerProps: typeof EagerProps = ...

constEntityManagerType

EntityManagerType: typeof EntityManagerType = ...

constEntityRepositoryType

EntityRepositoryType: typeof EntityRepositoryType = ...

constEventTypeMap

EventTypeMap: Record<EventType, number> = ...

constHiddenProps

HiddenProps: typeof HiddenProps = ...

constJSON_KEY_OPERATORS

JSON_KEY_OPERATORS: string[] = ...

constJsonProperty

JsonProperty: typeof JsonProperty = ...

constObjectBindingPattern

ObjectBindingPattern: typeof ObjectBindingPattern = ...

constOptionalProps

OptionalProps: typeof OptionalProps = ...

constPrimaryKeyProp

PrimaryKeyProp: typeof PrimaryKeyProp = ...

constSCALAR_TYPES

SCALAR_TYPES: string[] = ...

constt

t: { array: typeof ArrayType; bigint: typeof BigIntType; blob: typeof BlobType; boolean: typeof BooleanType; character: typeof CharacterType; date: typeof DateType; datetime: typeof DateTimeType; decimal: typeof DecimalType; double: typeof DoubleType; enum: typeof EnumType; enumArray: typeof EnumArrayType; float: typeof FloatType; integer: typeof IntegerType; interval: typeof IntervalType; json: typeof JsonType; mediumint: typeof MediumIntType; smallint: typeof SmallIntType; string: typeof StringType; text: typeof TextType; time: typeof TimeType; tinyint: typeof TinyIntType; uint8array: typeof Uint8ArrayType; unknown: typeof UnknownType; uuid: typeof UuidType } = types

Type declaration

consttypes

types: { array: typeof ArrayType; bigint: typeof BigIntType; blob: typeof BlobType; boolean: typeof BooleanType; character: typeof CharacterType; date: typeof DateType; datetime: typeof DateTimeType; decimal: typeof DecimalType; double: typeof DoubleType; enum: typeof EnumType; enumArray: typeof EnumArrayType; float: typeof FloatType; integer: typeof IntegerType; interval: typeof IntervalType; json: typeof JsonType; mediumint: typeof MediumIntType; smallint: typeof SmallIntType; string: typeof StringType; text: typeof TextType; time: typeof TimeType; tinyint: typeof TinyIntType; uint8array: typeof Uint8ArrayType; unknown: typeof UnknownType; uuid: typeof UuidType } = ...

Type declaration