@mikro-orm/core
Index
Classes
- AbstractNamingStrategy
- AbstractSchemaGenerator
- ArrayCollection
- ArrayType
- BaseEntity
- BigIntType
- BlobType
- BooleanType
- ChangeSet
- ChangeSetComputer
- ChangeSetPersister
- CheckConstraintViolationException
- Collection
- Configuration
- Connection
- ConnectionException
- ConstraintViolationException
- DatabaseDriver
- DatabaseObjectExistsException
- DatabaseObjectNotFoundException
- DateTimeType
- DateType
- DeadlockException
- DecimalType
- DefaultLogger
- DoubleType
- DriverException
- EntityAssigner
- EntityCaseNamingStrategy
- EntityComparator
- EntityFactory
- EntityHelper
- EntityLoader
- EntityManager
- EntityMetadata
- EntityRepository
- EntitySchema
- EntitySerializer
- EntityTransformer
- EntityValidator
- EnumArrayType
- EnumType
- EventManager
- ExceptionConverter
- FileCacheAdapter
- FloatType
- ForeignKeyConstraintViolationException
- Hydrator
- IdentityMap
- IntegerType
- InvalidFieldNameException
- JavaScriptMetadataProvider
- JsonType
- LockWaitTimeoutException
- MediumIntType
- MemoryCacheAdapter
- MetadataDiscovery
- MetadataError
- MetadataProvider
- MetadataStorage
- MikroORM
- MongoNamingStrategy
- NonUniqueFieldNameException
- NotFoundError
- NotNullConstraintViolationException
- NullCacheAdapter
- NullHighlighter
- ObjectHydrator
- OptimisticLockError
- PlainObject
- Platform
- QueryHelper
- ReadOnlyException
- Reference
- ReflectMetadataProvider
- RequestContext
- SerializationContext
- ServerException
- SimpleLogger
- SmallIntType
- StringType
- SyntaxErrorException
- TableExistsException
- TableNotFoundException
- TextType
- TimeType
- TinyIntType
- TransactionContext
- TransactionEventBroadcaster
- Type
- UnderscoreNamingStrategy
- UniqueConstraintViolationException
- UnitOfWork
- UnknownType
- Utils
- UuidType
- ValidationError
- WrappedEntity
Enumerations
Functions
- AfterCreate
- AfterDelete
- AfterUpdate
- BeforeCreate
- BeforeDelete
- BeforeUpdate
- Check
- Embeddable
- Embedded
- Entity
- Enum
- Filter
- Formula
- Index
- ManyToMany
- ManyToOne
- OnInit
- OnLoad
- OneToMany
- OneToOne
- PrimaryKey
- Property
- SerializedPrimaryKey
- Subscriber
- Unique
- UseRequestContext
- assign
- compareArrays
- compareBooleans
- compareBuffers
- compareObjects
- defineConfig
- equals
- expr
- parseJsonSafe
- ref
- rel
- serialize
- wrap
Interfaces
- AssignOptions
- CacheAdapter
- ConnectionConfig
- ConnectionOptions
- CountOptions
- CreateOptions
- DeleteOptions
- DriverMethodOptions
- DynamicPassword
- Edge
- EntityProperty
- EnumOptions
- EventArgs
- EventSubscriber
- FactoryOptions
- FindOneOptions
- FindOneOrFailOptions
- FindOptions
- FlatQueryOrderMap
- FlushEventArgs
- ForkOptions
- FormulaOptions
- GetReferenceOptions
- Highlighter
- IConfiguration
- IDatabaseDriver
- IEntityGenerator
- IMigrationGenerator
- IMigrator
- ISeedManager
- IWrappedEntity
- IndexOptions
- InitOptions
- LoadCountOptions
- LoadReferenceOptions
- LoadedCollection
- LoadedReference
- LockOptions
- LogContext
- Logger
- LoggerOptions
- ManyToManyOptions
- ManyToOneOptions
- MatchingOptions
- MergeOptions
- MigrationDiff
- MigrationObject
- MikroORMOptions
- NamingStrategy
- NativeDeleteOptions
- NativeInsertUpdateManyOptions
- NativeInsertUpdateOptions
- Node
- OneToOneOptions
- PoolConfig
- PrimaryKeyOptions
- QueryResult
- ReferenceOptions
- RegisterManagedOptions
- SerializeOptions
- SerializedPrimaryKeyOptions
- Settings
- SimpleColumnMeta
- TransactionEventArgs
- TransactionOptions
- TransformContext
- UniqueOptions
- UpdateOptions
Type Aliases
- AnyEntity
- Cast
- CheckCallback
- CheckOptions
- ConnectionType
- Constructor
- DeepPartial
- Dictionary
- EmbeddableOptions
- EmbeddedOptions
- EntityClass
- EntityClassGroup
- EntityDTO
- EntityData
- EntityDictionary
- EntityField
- EntityLoaderOptions
- EntityName
- EntityOptions
- FilterQuery
- GetRepository
- IPrimaryKey
- IdentifiedReference
- IsUnknown
- Loaded
- LoggerNamespace
- MigrationsOptions
- New
- ObjectQuery
- OneToManyOptions
- Options
- Populate
- PopulateOptions
- Primary
- PrimaryProperty
- PropertyOptions
- QBFilterQuery
- QBQueryOrderMap
- QueryOrderKeys
- QueryOrderKeysFlat
- QueryOrderMap
- Ref
- Rel
- RequiredEntityData
- SeederOptions
- Transaction
- TransactionEventType
Variables
Type Aliases
AnyEntity
Type parameters
- T = any
Cast
Type parameters
- T
- R
CheckCallback
Type parameters
- T
Type declaration
Parameters
columns: Record<keyof T, string>
Returns string
CheckOptions
Type parameters
- T = any
ConnectionType
Constructor
Type parameters
- T = unknown
Type declaration
Parameters
rest...args: any[]
Returns T
DeepPartial
Type parameters
- T
Dictionary
Type parameters
- T = any
Type declaration
[k string]: T
EmbeddableOptions
Type declaration
optionalabstract?: boolean
optionaldiscriminatorColumn?: string
optionaldiscriminatorMap?: Dictionary<string>
optionaldiscriminatorValue?: number | string
EmbeddedOptions
Type declaration
optionalarray?: boolean
optionalentity?: string | () => AnyEntity | AnyEntity[]
optionalhidden?: boolean
optionalnullable?: boolean
optionalobject?: boolean
optionalprefix?: string | boolean
optionalserializedName?: string
optionalserializer?: (value: any) => any
Parameters
value: any
Returns any
optionaltype?: string
EntityClass
Type parameters
- T
EntityClassGroup
Type parameters
- T
Type declaration
entity: EntityClass<T>
schema: EntityMetadata<T> | EntitySchema<T>
EntityDTO
Type parameters
- T
EntityData
Type parameters
- T
EntityDictionary
Type parameters
- T
EntityField
Type parameters
- T
- P: string = never
EntityLoaderOptions
Type parameters
- T
- P: string = never
Type declaration
optionalconnectionType?: ConnectionType
optionalconvertCustomTypes?: boolean
optionalfields?: readonly EntityField<T, P>[]
optionalfilters?: Dictionary<boolean | Dictionary> | string[] | boolean
optionalignoreLazyScalarProperties?: boolean
optionallockMode?: Exclude<LockMode, LockMode.OPTIMISTIC>
optionallookup?: boolean
optionalorderBy?: QueryOrderMap<T> | QueryOrderMap<T>[]
optionalpopulateWhere?: PopulateHint
optionalrefresh?: boolean
optionalschema?: string
optionalstrategy?: LoadStrategy
optionalvalidate?: boolean
optionalwhere?: FilterQuery<T>
EntityName
Type parameters
- T
EntityOptions
Type parameters
- T
Type declaration
optionalabstract?: boolean
optionalcollection?: string
optionalcomment?: string
optionalcustomRepository?: () => Constructor
Returns Constructor
optionaldiscriminatorColumn?: string
optionaldiscriminatorMap?: Dictionary<string>
optionaldiscriminatorValue?: number | string
optionalexpression?: string | (em: any, where: FilterQuery<T>, options: FindOptions<T, any>) => object
optionalforceConstructor?: boolean
optionalreadonly?: boolean
optionalrepository?: () => Constructor
Returns Constructor
optionalschema?: string
optionaltableName?: string
optionalvirtual?: boolean
FilterQuery
Type parameters
- T
GetRepository
Type parameters
- Entity: {}
- Fallback
IPrimaryKey
Type parameters
- T: IPrimaryKeyValue = IPrimaryKeyValue
IdentifiedReference
Type parameters
- T
- PK: keyof T | unknown = PrimaryProperty<T>
IsUnknown
Type parameters
- T
Loaded
Type parameters
- T
- L: string = never
LoggerNamespace
MigrationsOptions
Type declaration
optionalallOrNothing?: boolean
optionaldisableForeignKeys?: boolean
optionaldropTables?: boolean
optionalemit?: js | ts | cjs
optionalfileName?: (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
Type parameters
- T
- P: string = string
ObjectQuery
Type parameters
- T
OneToManyOptions
Type parameters
- T
- O
Options
Type parameters
Populate
Type parameters
- T
- P: string = never
PopulateOptions
Type parameters
- T
Type declaration
optionalall?: boolean
optionalchildren?: PopulateOptions<T[keyof T]>[]
field: string
optionalstrategy?: LoadStrategy
Primary
Type parameters
- T
PrimaryProperty
Type parameters
- T
PropertyOptions
Type parameters
- T
Type declaration
optionalautoincrement?: boolean
Explicitly specify the auto increment of the primary key.
optionalcheck?: string | CheckCallback<T>
Specify column with check constraints. (Postgres driver only)
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)
optionalcustomType?: Type<any>
Explicitly specify the mapped type instance for this property.
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.
optionalfieldNames?: string[]
Specify database column names for this property. Same as
fieldName
but for composite FKs.optionalformula?: string | (alias: string) => string
Set to map some SQL snippet for the entity.
optionalgetter?: boolean
Set true to define the properties as getter. (virtual)
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)[]
Set to avoid a perpetual diff from the Generator when columns are generated.
optionalindex?: boolean | string
Explicitly specify index on a property.
optionallazy?: boolean
Set to omit the property from the select clause for lazy loading.
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: T) => any
Automatically set the property value when entity gets created, executed during flush operation.
Parameters
entity: T
Returns any
optionalonUpdate?: (entity: T) => any
Automatically update the property value every time entity gets updated, executed during flush operation.
Parameters
entity: T
Returns any
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()
decoratoroptionalscale?: 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.optionalserializer?: (value: any) => any
Set to use serialize property. Allow to specify a callback that will be used when serializing a property.
Parameters
value: any
Returns any
optionalsetter?: boolean
Set true to define the properties as setter. (virtual)
optionaltrackChanges?: boolean
Set false to disable change tracking on a property level.
optionaltype?: keyof typeof types | ObjectId | Date | Constructor<AnyEntity> | Constructor<Type<any>> | Type<any> | () => unknown | ColumnType | AnyString
Explicitly specify the runtime type.
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
Type parameters
- T = any
QBQueryOrderMap
Type parameters
- T
QueryOrderKeys
Type parameters
- T
QueryOrderKeysFlat
QueryOrderMap
Type parameters
- T
Ref
Rel
Identity type that can be used to get around issues with cycles in bidirectional relations.
Type parameters
- T
RequiredEntityData
Type parameters
- T
SeederOptions
Type declaration
optionaldefaultSeeder?: string
optionalemit?: js | ts
optionalfileName?: (className: string) => string
Parameters
className: string
Returns string
optionalglob?: string
optionalpath?: string
optionalpathTs?: string
Transaction
Type parameters
- T = any
TransactionEventType
Variables
constARRAY_OPERATORS
constEntityManagerType
constEntityRepositoryType
constJsonProperty
constObjectBindingPattern
constOptionalProps
constPrimaryKeyProp
constPrimaryKeyType
constSCALAR_TYPES
constt
Type declaration
array: typeof ArrayType
bigint: typeof BigIntType
blob: typeof BlobType
boolean: typeof BooleanType
date: typeof DateType
datetime: typeof DateTimeType
decimal: typeof DecimalType
double: typeof DoubleType
enum: typeof EnumType
enumArray: typeof EnumArrayType
float: typeof FloatType
integer: typeof IntegerType
json: typeof JsonType
mediumint: typeof MediumIntType
smallint: typeof SmallIntType
string: typeof StringType
text: typeof TextType
time: typeof TimeType
tinyint: typeof TinyIntType
unknown: typeof UnknownType
uuid: typeof UuidType
consttypes
Type declaration
array: typeof ArrayType
bigint: typeof BigIntType
blob: typeof BlobType
boolean: typeof BooleanType
date: typeof DateType
datetime: typeof DateTimeType
decimal: typeof DecimalType
double: typeof DoubleType
enum: typeof EnumType
enumArray: typeof EnumArrayType
float: typeof FloatType
integer: typeof IntegerType
json: typeof JsonType
mediumint: typeof MediumIntType
smallint: typeof SmallIntType
string: typeof StringType
text: typeof TextType
time: typeof TimeType
tinyint: typeof TinyIntType
unknown: typeof UnknownType
uuid: typeof UuidType
shortcut for
customRepository