@mikro-orm/core
Index
Classes
- AbstractNamingStrategy
- AbstractSchemaGenerator
- ArrayCollection
- ArrayType
- BaseEntity
- BigIntType
- BlobType
- BooleanType
- ChangeSet
- ChangeSetComputer
- ChangeSetPersister
- CharacterType
- CheckConstraintViolationException
- Collection
- Configuration
- Connection
- ConnectionException
- ConstraintViolationException
- Cursor
- CursorError
- DatabaseDriver
- DatabaseObjectExistsException
- DatabaseObjectNotFoundException
- DataloaderUtils
- DateTimeType
- DateType
- DeadlockException
- DecimalType
- DefaultLogger
- DoubleType
- DriverException
- EntityAssigner
- EntityCaseNamingStrategy
- EntityComparator
- EntityFactory
- EntityLoader
- EntityManager
- EntityMetadata
- EntityRepository
- EntitySchema
- EntitySerializer
- EntityTransformer
- EntityValidator
- EnumArrayType
- EnumType
- EventManager
- ExceptionConverter
- FileCacheAdapter
- FloatType
- ForeignKeyConstraintViolationException
- GeneratedCacheAdapter
- Hydrator
- IdentityMap
- IntegerType
- IntervalType
- InvalidFieldNameException
- JsonType
- LockWaitTimeoutException
- MediumIntType
- MemoryCacheAdapter
- MetadataDiscovery
- MetadataError
- MetadataProvider
- MetadataStorage
- MikroORM
- MongoNamingStrategy
- NonUniqueFieldNameException
- NotFoundError
- NotNullConstraintViolationException
- NullCacheAdapter
- NullHighlighter
- ObjectHydrator
- OptimisticLockError
- PlainObject
- Platform
- QueryHelper
- RawQueryFragment
- ReadOnlyException
- Reference
- ReflectMetadataProvider
- RequestContext
- ScalarReference
- SerializationContext
- ServerException
- SimpleLogger
- SmallIntType
- StringType
- SyntaxErrorException
- TableExistsException
- TableNotFoundException
- TextType
- TimeType
- TinyIntType
- TransactionContext
- TransactionEventBroadcaster
- Type
- Uint8ArrayType
- UnderscoreNamingStrategy
- UniqueConstraintViolationException
- UnitOfWork
- UnknownType
- Utils
- UuidType
- ValidationError
- WrappedEntity
Enumerations
Functions
- AfterCreate
- AfterDelete
- AfterUpdate
- AfterUpsert
- assign
- BeforeCreate
- BeforeDelete
- BeforeUpdate
- BeforeUpsert
- Check
- compareArrays
- compareBooleans
- compareBuffers
- compareObjects
- CreateRequestContext
- createSqlFunction
- defineConfig
- Embeddable
- Embedded
- EnsureRequestContext
- Entity
- Enum
- equals
- Filter
- Formula
- Index
- ManyToMany
- ManyToOne
- OneToMany
- OneToOne
- OnInit
- OnLoad
- parseJsonSafe
- PrimaryKey
- Property
- raw
- ref
- rel
- serialize
- SerializedPrimaryKey
- sql
- Transactional
- Unique
- wrap
Interfaces
- AssignOptions
- CacheAdapter
- ClearDatabaseOptions
- ConnectionConfig
- ConnectionOptions
- CountOptions
- CreateContextOptions
- CreateOptions
- CreateSchemaOptions
- DeleteOptions
- DriverMethodOptions
- DropSchemaOptions
- DynamicPassword
- Edge
- EnsureDatabaseOptions
- EntityProperty
- EnumOptions
- EventArgs
- EventSubscriber
- FactoryOptions
- FindAllOptions
- FindByCursorOptions
- FindOneOptions
- FindOneOrFailOptions
- FindOptions
- FlatQueryOrderMap
- FlushEventArgs
- ForkOptions
- FormulaOptions
- GenerateOptions
- GetReferenceOptions
- Highlighter
- IConfiguration
- IDatabaseDriver
- IEntityGenerator
- IMigrationGenerator
- IMigrator
- IndexOptions
- InitCollectionOptions
- ISchemaGenerator
- ISeedManager
- IWrappedEntity
- LoadCountOptions
- LoadedCollection
- LoadedReference
- LoadHint
- LoadReferenceOptions
- LoadReferenceOrFailOptions
- LockOptions
- LogContext
- Logger
- LoggerOptions
- ManyToManyOptions
- ManyToOneOptions
- MatchingOptions
- MergeOptions
- MetadataDiscoveryOptions
- MigrationDiff
- MigrationObject
- MikroORMOptions
- NamingStrategy
- NativeDeleteOptions
- NativeInsertUpdateManyOptions
- NativeInsertUpdateOptions
- Node
- OneToManyOptions
- OneToOneOptions
- PoolConfig
- PrimaryKeyOptions
- PropertyOptions
- QueryResult
- ReferenceOptions
- RefreshDatabaseOptions
- RegisterOptions
- SeederOptions
- SerializedPrimaryKeyOptions
- SerializeOptions
- Settings
- SimpleColumnMeta
- SyncCacheAdapter
- TransactionEventArgs
- TransactionOptions
- TransformContext
- TypeConfig
- UniqueOptions
- UpdateOptions
- UpdateSchemaOptions
- UpsertManyOptions
- UpsertOptions
Type Aliases
- AnyEntity
- AutoPath
- Cast
- CheckCallback
- CheckOptions
- ConnectionType
- Constructor
- DeepPartial
- DefineConfig
- Dictionary
- EmbeddableOptions
- EmbeddedOptions
- EmbeddedPrefixMode
- EntityClass
- EntityClassGroup
- EntityData
- EntityDictionary
- EntityDTO
- EntityField
- EntityKey
- EntityLoaderOptions
- EntityName
- EntityOptions
- EntityProps
- EntityRef
- EntitySchemaMetadata
- EntitySchemaProperty
- EntityType
- EntityValue
- ExpandHint
- ExpandProperty
- ExpandQuery
- ExpandScalar
- FilterItemValue
- FilterKey
- FilterObject
- FilterOptions
- FilterQuery
- FilterValue
- FromEntityType
- GetRepository
- Hidden
- ImportsResolver
- IPrimaryKey
- IsSubset
- IsUnknown
- IType
- Loaded
- LoggerNamespace
- LoggingOptions
- MaybePromise
- MergeLoaded
- MergeSelected
- MetadataProcessor
- MigrateOptions
- MigrationResult
- MigrationRow
- MigrationsOptions
- MigratorEvent
- New
- NoInfer
- ObjectQuery
- Opt
- Options
- OrderDefinition
- Populate
- PopulateOptions
- Primary
- PrimaryProperty
- QBFilterQuery
- QBQueryOrderMap
- QueryOrderKeys
- QueryOrderKeysFlat
- QueryOrderMap
- Ref
- Rel
- RequiredEntityData
- Scalar
- ScalarRef
- Selected
- Transaction
- TransactionEventType
- UmzugMigration
- UnboxArray
Variables
Type Aliases
AnyEntity
Type parameters
- T = any
AutoPath
Type parameters
- O
- P: string | boolean
- E: string = never
- D: Prev[number] = 9
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
DefineConfig
Type parameters
- T: TypeConfig
Dictionary
Type parameters
- T = any
Type declaration
EmbeddableOptions
Type declaration
optionalabstract?: boolean
optionaldiscriminatorColumn?: string
optionaldiscriminatorMap?: Dictionary<string>
optionaldiscriminatorValue?: number | string
EmbeddedOptions
Type declaration
optionalarray?: boolean
optionalentity?: string | () => AnyEntity | AnyEntity[]
optionalgroups?: string[]
optionalhidden?: boolean
optionalnullable?: boolean
optionalobject?: boolean
optionalpersist?: boolean
optionalprefix?: string | boolean
optionalprefixMode?: EmbeddedPrefixMode
optionalserializedName?: string
optionalserializer?: (value: any) => any
Parameters
value: any
Returns any
optionaltype?: string
EmbeddedPrefixMode
EntityClass
Type parameters
- T
EntityClassGroup
Type parameters
- T
Type declaration
entity: EntityClass<T>
schema: EntityMetadata<T> | EntitySchema<T>
EntityData
Type parameters
- T
- C: boolean = false
EntityDictionary
Type parameters
- T
EntityDTO
Type parameters
- T
- C: TypeConfig = never
EntityField
Type parameters
- T
- P: string = PopulatePath.ALL
EntityKey
Type parameters
- T = unknown
- B: boolean = false
EntityLoaderOptions
Type parameters
- Entity
- Fields: string = PopulatePath.ALL
- Excludes: string = never
Type declaration
optionalconnectionType?: ConnectionType
optionalconvertCustomTypes?: boolean
optionalexclude?: readonly EntityField<Entity, Excludes>[]
optionalfields?: readonly EntityField<Entity, Fields>[]
optionalfilters?: Dictionary<boolean | Dictionary> | string[] | boolean
optionalignoreLazyScalarProperties?: boolean
optionallockMode?: Exclude<LockMode, LockMode.OPTIMISTIC>
optionallogging?: LoggingOptions
optionallookup?: boolean
optionalorderBy?: QueryOrderMap<Entity> | QueryOrderMap<Entity>[]
optionalpopulateWhere?: PopulateHint | `${PopulateHint}`
optionalrefresh?: boolean
optionalschema?: string
optionalstrategy?: LoadStrategy
optionalvalidate?: boolean
optionalwhere?: FilterQuery<Entity>
EntityName
Type parameters
- T
EntityOptions
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
Returns Constructor
optionalschema?: string
optionaltableName?: string
optionalvirtual?: boolean
EntityProps
Type parameters
- T
EntityRef
EntitySchemaMetadata
Type parameters
- Entity
- Base = never
EntitySchemaProperty
Type parameters
- Target
- Owner
EntityType
Type parameters
- T
EntityValue
Type parameters
- T
ExpandHint
Type parameters
- T
- L: string
ExpandProperty
Type parameters
- T
ExpandQuery
Type parameters
- T
ExpandScalar
Type parameters
- T
FilterItemValue
Type parameters
- T
FilterKey
Type parameters
- T
FilterObject
Type parameters
- T
FilterOptions
FilterQuery
Type parameters
- T
FilterValue
Type parameters
- T
FromEntityType
Type parameters
- T
GetRepository
Type parameters
- Entity: {}
- Fallback
Hidden
Type parameters
- T = unknown
ImportsResolver
Type declaration
Parameters
alias: string
basePath: string
extension: .js |
originFileName: string
Returns { name: string; path: string } | undefined
IPrimaryKey
Type parameters
- T: IPrimaryKeyValue = IPrimaryKeyValue
IsSubset
Type parameters
- T
- U
IsUnknown
Type parameters
- T
IType
Type parameters
- Runtime
- Raw
- Serialized = Raw
Loaded
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
LoggingOptions
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()
.
MaybePromise
Type parameters
- T
MergeLoaded
Type parameters
- T
- U
- P: string
- F: string
- E: string
- R: boolean = false
MergeSelected
Type parameters
- T
- U
- F: string
MetadataProcessor
Type declaration
Parameters
metadata: EntityMetadata[]
platform: Platform
Returns MaybePromise<void>
MigrateOptions
Type declaration
optionalfrom?: string | number
optionalmigrations?: string[]
optionalto?: string | number
optionaltransaction?: Transaction
MigrationResult
Type declaration
code: string
diff: MigrationDiff
fileName: string
MigrationRow
Type declaration
executed_at: Date
name: string
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 | Constructor<Migration>)[]
optionalpath?: string
optionalpathTs?: string
optionalsafe?: boolean
optionalsilent?: boolean
optionalsnapshot?: boolean
optionalsnapshotName?: string
optionaltableName?: string
optionaltransactional?: boolean
MigratorEvent
New
Type parameters
- T
- P: string = string
NoInfer
Type parameters
- T
ObjectQuery
Type parameters
- T
Opt
Type parameters
- T = unknown
Options
Type parameters
- D: IDatabaseDriver = IDatabaseDriver
- EM: D[typeof EntityManagerType] & EntityManager = D[typeof EntityManagerType] & EntityManager
OrderDefinition
Type parameters
- T
Populate
Type parameters
- T
- P: string = never
PopulateOptions
Type parameters
- T
Type declaration
optionalall?: boolean
optionalchildren?: PopulateOptions<T[keyof T]>[]
field: EntityKey<T>
optionalfilter?: boolean
optionalstrategy?: LoadStrategy
Primary
Type parameters
- T
PrimaryProperty
Type parameters
- T
QBFilterQuery
Type parameters
- T = any
QBQueryOrderMap
Type parameters
- T
QueryOrderKeys
Type parameters
- T
QueryOrderKeysFlat
QueryOrderMap
Type parameters
- T
Ref
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
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
Type parameters
- T
- I = never
- C: boolean = false
Scalar
ScalarRef
Selected
Type parameters
- T
- L: string = never
- F: string = *
Transaction
Type parameters
- T = any
TransactionEventType
UmzugMigration
Type declaration
name: string
optionalpath?: string
UnboxArray
Type parameters
- T
Variables
constARRAY_OPERATORS
constConfig
constEagerProps
constEntityManagerType
constEntityRepositoryType
constEventTypeMap
constHiddenProps
constJSON_KEY_OPERATORS
constJsonProperty
constObjectBindingPattern
constOptionalProps
constPrimaryKeyProp
constSCALAR_TYPES
constt
Type declaration
readonlyarray: typeof ArrayType
readonlybigint: typeof BigIntType
readonlyblob: typeof BlobType
readonlyboolean: typeof BooleanType
readonlycharacter: typeof CharacterType
readonlydate: typeof DateType
readonlydatetime: typeof DateTimeType
readonlydecimal: typeof DecimalType
readonlydouble: typeof DoubleType
readonlyenum: typeof EnumType
readonlyenumArray: typeof EnumArrayType
readonlyfloat: typeof FloatType
readonlyinteger: typeof IntegerType
readonlyinterval: typeof IntervalType
readonlyjson: typeof JsonType
readonlymediumint: typeof MediumIntType
readonlysmallint: typeof SmallIntType
readonlystring: typeof StringType
readonlytext: typeof TextType
readonlytime: typeof TimeType
readonlytinyint: typeof TinyIntType
readonlyuint8array: typeof Uint8ArrayType
readonlyunknown: typeof UnknownType
readonlyuuid: typeof UuidType
consttypes
Type declaration
readonlyarray: typeof ArrayType
readonlybigint: typeof BigIntType
readonlyblob: typeof BlobType
readonlyboolean: typeof BooleanType
readonlycharacter: typeof CharacterType
readonlydate: typeof DateType
readonlydatetime: typeof DateTimeType
readonlydecimal: typeof DecimalType
readonlydouble: typeof DoubleType
readonlyenum: typeof EnumType
readonlyenumArray: typeof EnumArrayType
readonlyfloat: typeof FloatType
readonlyinteger: typeof IntegerType
readonlyinterval: typeof IntervalType
readonlyjson: typeof JsonType
readonlymediumint: typeof MediumIntType
readonlysmallint: typeof SmallIntType
readonlystring: typeof StringType
readonlytext: typeof TextType
readonlytime: typeof TimeType
readonlytinyint: typeof TinyIntType
readonlyuint8array: typeof Uint8ArrayType
readonlyunknown: typeof UnknownType
readonlyuuid: typeof UuidType
With
absolute
the prefix is set at the root of the entity (regardless of the nesting level)