@mikro-orm/core
Index
References
Namespaces
Enumerations
Classes
- AbstractNamingStrategy
- ArrayType
- BaseEntity
- BigIntType
- BlobType
- BooleanType
- ChangeSet
- CharacterType
- CheckConstraintViolationException
- Collection
- Configuration
- Connection
- ConnectionException
- ConstraintViolationException
- Cursor
- CursorError
- DatabaseDriver
- DatabaseObjectExistsException
- DatabaseObjectNotFoundException
- DateTimeType
- DateType
- DeadlockException
- DecimalType
- DefaultLogger
- DoubleType
- DriverException
- EntityAssigner
- EntityCaseNamingStrategy
- EntityLoader
- EntityManager
- EntityMetadata
- EntityRepository
- EntitySchema
- EntitySerializer
- EntityTransformer
- EnumArrayType
- EnumType
- EventManager
- ExceptionConverter
- FloatType
- ForeignKeyConstraintViolationException
- GeneratedCacheAdapter
- Hydrator
- IntegerType
- IntervalType
- InvalidFieldNameException
- JsonType
- LockWaitTimeoutException
- MediumIntType
- MemoryCacheAdapter
- MetadataDiscovery
- MetadataError
- MetadataProvider
- MetadataStorage
- MikroORM
- MongoNamingStrategy
- NonUniqueFieldNameException
- NotFoundError
- NotNullConstraintViolationException
- NullCacheAdapter
- NullHighlighter
- OptimisticLockError
- PlainObject
- Platform
- PolymorphicRef
- RawQueryFragment
- ReadOnlyException
- Reference
- RequestContext
- ScalarReference
- SerializationContext
- ServerException
- SimpleLogger
- SmallIntType
- StringType
- SyntaxErrorException
- TableExistsException
- TableNotFoundException
- TextType
- TimeType
- TinyIntType
- TransactionContext
- TransactionEventBroadcaster
- TransactionManager
- TransactionStateError
- Type
- Uint8ArrayType
- UnderscoreNamingStrategy
- UniqueConstraintViolationException
- UnitOfWork
- UnknownType
- Utils
- UuidType
- ValidationError
Interfaces
- AssignOptions
- CacheAdapter
- CheckConstraint
- ClearDatabaseOptions
- CollationOptions
- ConnectionConfig
- ConnectionOptions
- CountOptions
- CreateContextOptions
- CreateOptions
- CreateSchemaOptions
- DefineEntityHooks
- DeleteOptions
- DriverMethodOptions
- DropSchemaOptions
- Edge
- EmbeddableOptions
- EmbeddedOptions
- EmptyOptions
- EnsureDatabaseOptions
- EntityLoaderOptions
- EntityMetadataWithProperties
- EntityProperty
- EntitySchemaWithMeta
- EnumOptions
- EventArgs
- EventSubscriber
- FindAllOptions
- FindByCursorOptions
- FindOneOptions
- FindOneOrFailOptions
- FindOptions
- FlatQueryOrderMap
- FlushEventArgs
- ForkOptions
- GenerateOptions
- GetReferenceOptions
- Highlighter
- IConfiguration
- IDatabaseDriver
- IEntityGenerator
- IMigrationGenerator
- IMigrator
- IndexColumnOptions
- IndexOptions
- InitCollectionOptions
- ISchemaGenerator
- ISeedManager
- IWrappedEntity
- LoadCountOptions
- LoadedCollection
- LoadedReference
- LoadHint
- LoadReferenceOptions
- LoadReferenceOrFailOptions
- LockOptions
- LogContext
- Logger
- LoggerOptions
- ManyToManyOptions
- ManyToOneOptions
- MatchingOptions
- MergeOptions
- MetadataDiscoveryOptions
- MigrationDiff
- MigrationObject
- NamingStrategy
- NativeDeleteOptions
- NativeInsertUpdateManyOptions
- NativeInsertUpdateOptions
- Node
- OneToManyOptions
- OneToOneOptions
- Options
- PoolConfig
- PrimaryKeyOptions
- PropertyChain
- PropertyOptions
- QueryResult
- ReferenceOptions
- RefreshDatabaseOptions
- RegisterOptions
- SeederObject
- SeederOptions
- SerializedPrimaryKeyOptions
- SerializeOptions
- SimpleColumnMeta
- StreamOptions
- Subquery
- SyncCacheAdapter
- TransactionEventArgs
- TransactionOptions
- TransformContext
- TypeConfig
- UniqueOptions
- UpdateOptions
- UpdateSchemaOptions
- UpsertManyOptions
- UpsertOptions
Type Aliases
- AnyEntity
- AnyString
- AutoPath
- Cast
- CheckCallback
- CompiledFunctions
- ConnectionType
- Constructor
- DeepPartial
- DefineConfig
- Dictionary
- EmbeddedPrefixMode
- EntityClass
- EntityCtor
- EntityData
- EntityDataValue
- EntityDictionary
- EntityDTO
- EntityDTOProp
- EntityField
- EntityKey
- EntityName
- EntityOptions
- EntityProps
- EntityRef
- EntitySchemaMetadata
- EntitySchemaProperty
- EntityType
- EntityValue
- ExpandHint
- ExpandProperty
- ExpandQuery
- ExpandScalar
- FilterDef
- FilterItemValue
- FilterKey
- FilterObject
- FilterOptions
- FilterQuery
- FilterValue
- FormulaCallback
- FormulaTable
- FromEntityType
- GeneratedColumnCallback
- GetRepository
- Hidden
- ImportsResolver
- IndexCallback
- InferEntity
- InferEntityFromProperties
- InferEntityName
- InferPrimaryKey
- IPrimaryKey
- IsSubset
- IsUnknown
- IType
- Loaded
- LoggerNamespace
- LoggingOptions
- MaybePromise
- MergeLoaded
- MergeSelected
- MetadataProcessor
- MigrateOptions
- MigrationInfo
- MigrationResult
- MigrationRow
- MigrationsOptions
- MigratorEvent
- New
- ObjectQuery
- Opt
- OrderDefinition
- Populate
- PopulateHintOptions
- PopulateOptions
- Prefixes
- Primary
- PropertyBuilders
- QueryOrderKeys
- QueryOrderKeysFlat
- QueryOrderMap
- RawQueryFragmentSymbol
- Ref
- Rel
- RequiredEntityData
- RequiredNullable
- Scalar
- ScalarRef
- SchemaColumns
- SchemaTable
- Selected
- SerializeDTO
- Transaction
- TransactionEventType
- UnboxArray
- UniversalPropertyKeys
Variables
Functions
References
Raw
Type Aliases
AnyEntity
Type parameters
- T = any
AnyString
Branded string that accepts any string value while preserving autocompletion for known literals.
AutoPath
Autocomplete-friendly type for dot-separated relation paths (e.g., 'author.books').
Validates each segment against entity keys and provides IDE suggestions. Depth-limited to prevent infinite recursion.
Type parameters
- O
- P: string | boolean
- E: string = never
- D: Prev[number] = 9
Cast
Conditional cast: returns T if it extends R, otherwise returns R.
Type parameters
- T
- R
CheckCallback
Callback for CHECK constraint expressions. Receives column mappings and table info.
Type parameters
- T
Type declaration
Parameters
columns: Record<PropertyName<T>, string>
table: SchemaTable
Returns string | Raw
CompiledFunctions
Record of compiled functions, used internally for hydration and comparison.
ConnectionType
Discriminator for read vs write database connections in read-replica setups.
Constructor
Generic constructor type. Matches any class that can be instantiated with new.
Type parameters
- T = unknown
Type declaration
Parameters
rest...args: any[]
Returns T
DeepPartial
Recursively makes all properties of T optional, including nested objects and arrays.
Type parameters
- T
DefineConfig
Branded type for entity-level configuration (e.g., [Config]?: DefineConfig<{ forceObject: true }>).
Controls type-level behavior such as forcing object representation for primary keys in DTOs.
Type parameters
- T: TypeConfig
Dictionary
Simple string-keyed object type. Use instead of Record<string, T> for convenience.
Type parameters
- T = any
Type declaration
EmbeddedPrefixMode
With absolute the prefix is set at the root of the entity (regardless of the nesting level)
EntityClass
A class (function with prototype) whose instances are of type T.
Type parameters
- T = any
EntityCtor
Abstract constructor type that matches both abstract and concrete entity classes.
Type parameters
- T = any
Type declaration
Parameters
rest...args: any[]
Returns T
EntityData
Data shape for creating or updating entities. All properties are optional. Used in em.create() and em.assign().
Type parameters
- T
- C: boolean = false
EntityDataValue
Resolves to the value type within EntityData<T> (the data shape used for create/update).
Type parameters
- T
EntityDictionary
EntityData<T> extended with an index signature, allowing arbitrary additional properties.
Type parameters
- T
EntityDTO
Plain object (DTO) representation of an entity as returned by toObject() / toPOJO().
Unwraps references to PKs, collections to arrays, and respects hidden properties.
Type parameters
- T
- C: TypeConfig = never
EntityDTOProp
Resolves the serialized (DTO) type for a single entity property. Unwraps references, collections, and custom serialized types.
Type parameters
- E
- T
- C: TypeConfig = never
- Flat: boolean = false
EntityField
Represents a field selector for entity queries (property name or wildcard).
Type parameters
- T
- P: string = PopulatePath.ALL
EntityKey
Extracts string property keys from an entity, excluding symbols, functions, and internal keys.
Pass B = true to also exclude scalar properties (useful for getting only relation keys).
Type parameters
- T = unknown
- B: boolean = false
EntityName
Any valid entity name reference: a class, abstract constructor, or EntitySchema.
Type parameters
- T = any
EntityOptions
Type parameters
- T
- E = T extends EntityClass<infer P> ? P : T
Type declaration
optionalabstract?: boolean
Marks entity as abstract, such entities are inlined during discovery.
optionalcollection?: string
Override default collection/table name. Alias for
tableName.optionalcomment?: string
Specify comment to table. (SQL only)
optionalconstructorParams?: (T extends EntityClass<infer P> ? keyof P : string)[]
Specify constructor parameters to be used in
em.createor whenforceConstructoris enabled. Those should be names of declared entity properties in the same order as your constructor uses them. The ORM tries to infer those automatically, use this option in case the inference fails.optionaldiscriminatorColumn?: (T extends EntityClass<infer P> ? keyof P : string) | AnyString
optionaldiscriminatorMap?: Dictionary<string>
optionaldiscriminatorValue?: number | string
optionalexpression?: string | (em, where, options, stream) => object
SQL query that maps to a virtual entity, or for view entities, the view definition.
optionalforceConstructor?: boolean
Enforce use of constructor when creating managed entity instances.
optionalhasTriggers?: boolean
Used to make ORM aware of externally defined triggers. This is needed for MS SQL Server multi inserts, ignored in other dialects.
optionalinheritance?: tpt
Set inheritance strategy: 'tpt' for Table-Per-Type inheritance. When set on the root entity, each entity in the hierarchy gets its own table with a FK from child PK to parent PK.
optionalorderBy?: QueryOrderMap<E> | QueryOrderMap<E>[]
Set default ordering for this entity. This ordering is applied when:
- Querying the entity directly via
em.find(),em.findAll(), etc. - Populating the entity as a relation
All orderings are combined together. Precedence (highest to lowest):
- Runtime
FindOptions.orderBy - Relation-level
@OneToMany({ orderBy })/@ManyToMany({ orderBy }) - Entity-level
@Entity({ orderBy })
- Querying the entity directly via
optionalreadonly?: boolean
Disables change tracking - such entities are ignored during flush.
optionalrepository?: () => Constructor
Returns Constructor
optionalschema?: string
Sets the schema name.
optionaltableName?: string
Override default collection/table name. Alias for
collection.optionalview?: boolean | { materialized?: boolean; withData?: boolean }
Marks entity as a database view. Unlike virtual entities which evaluate expressions at query time, view entities create actual database views. The
expressionoption must be provided whenviewis true. View entities are read-only by default.Use
view: truefor regular views, orview: { materialized: true }for materialized views (PostgreSQL only). Materialized views store the query results and must be refreshed to update data. Useview: { materialized: true, withData: false }to create an unpopulated materialized view.optionalvirtual?: boolean
Marks entity as virtual. This is set automatically when you use
expressionoption (unlessviewis set).
EntityProps
Partial entity shape with all entity properties optional.
Type parameters
- T
EntityRef
EntitySchemaMetadata
Configuration object for defining an entity via EntitySchema.
Type parameters
- Entity
- Base = never
- Class: EntityCtor = EntityCtor<Entity>
EntitySchemaProperty
Union type representing all possible property definition shapes in an EntitySchema.
Type parameters
- Target
- Owner
EntityType
Accepts either a plain entity type or a Loaded/Selected wrapped version.
Type parameters
- T
EntityValue
Resolves to the value type of entity properties (keyed by EntityKey<T>).
Type parameters
- T
ExpandHint
Combines an explicit populate hint L with the entity's eagerly loaded properties.
Type parameters
- T
- L: string
ExpandProperty
Unwraps a property type from its wrapper (Reference, Collection, or array) to the inner entity type.
Type parameters
- T
ExpandQuery
Recursively expands a type into its FilterQuery form for nested object filtering.
Type parameters
- T
ExpandScalar
Expands a scalar type to include alternative representations accepted in queries (e.g., Date | string).
Type parameters
- T
FilterDef
Definition of a query filter that can be registered globally or per-entity via @Filter().
Type parameters
- T: EntityName | readonly EntityName[] = any
FilterItemValue
A single filter value: the raw value, its expanded scalar form, its primary key, or a raw SQL expression.
Type parameters
- T
FilterKey
Extracts valid keys for FilterQuery<T>.
Type parameters
- T
FilterObject
Object form of a filter query, mapping entity keys to their filter conditions.
Type parameters
- T
FilterOptions
Configuration for enabling/disabling named filters on a query.
FilterQuery
The main query filter type used in em.find(), em.findOne(), etc.
Accepts an object query, a primary key value, entity props with operators, or an array of filters.
Type parameters
- T
FilterValue
A complete filter value: an operator map, a single value, an array of values, or null.
Type parameters
- T
FormulaCallback
Callback for computed (formula) properties. Receives column mappings and table info, returns a SQL expression.
Type parameters
- T
Type declaration
Parameters
columns: FormulaColumns<T>
table: FormulaTable
Returns string | Raw
FormulaTable
Table reference object passed to formula callbacks, including alias and schema information.
Type declaration
alias: string
name: string
qualifiedName: string
optionalschema?: string
toString: () => string
Returns string
FromEntityType
Extracts the base entity type from a Loaded/Selected wrapper, or returns T as-is.
Type parameters
- T
GeneratedColumnCallback
Callback for generated (computed) column expressions. Receives column mappings and table info.
Type parameters
- T
Type declaration
Parameters
columns: Record<PropertyName<T>, string>
table: SchemaTable
Returns string | Raw
GetRepository
Resolves the custom repository type for an entity (from [EntityRepositoryType]), or falls back to Fallback.
Type parameters
- Entity: {}
- Fallback
Hidden
Branded type that marks a property as hidden from serialization.
Use as a property type wrapper: password: Hidden<string> instead of listing in [HiddenProps].
Type parameters
- T = unknown
ImportsResolver
Custom resolver for import paths in the entity generator. Returns a path/name pair or undefined to use the default.
Type declaration
Parameters
alias: string
basePath: string
extension: .js |
originFileName: string
Returns { name: string; path: string } | undefined
IndexCallback
Callback for custom index expressions. Receives column mappings, table info, and the index name.
Type parameters
- T
Type declaration
Parameters
columns: Record<PropertyName<T>, string>
table: SchemaTable
indexName: string
Returns string | Raw
InferEntity
Extracts the entity type from an EntitySchema, EntitySchemaWithMeta, or entity class.
Uses a fast-path direct property access when available, falling back to generic inference.
Type parameters
- Schema
InferEntityFromProperties
Infers the entity type from a defineEntity() properties map, resolving builders, base classes, and primary keys.
Type parameters
- Properties: Record<string, any>
- PK: keyof Properties[] | undefined = undefined
- Base = never
- Repository = never
- ForceObject: boolean = false
InferEntityName
Extracts the entity name string literal from an entity type that declares [EntityName].
Type parameters
- T
InferPrimaryKey
Extracts the primary key property names from a properties map by finding builders with primary: true.
Type parameters
- Properties: Record<string, any>
IPrimaryKey
Alias for a primary key value, constrained to IPrimaryKeyValue.
Type parameters
- T: IPrimaryKeyValue = IPrimaryKeyValue
IsSubset
Validates that U is a subset of T. Returns {} if valid, or a mapped type with never values to cause a type error.
Type parameters
- T
- U
IsUnknown
Evaluates to true if T is the unknown type.
Type parameters
- T
IType
Branded type helper for mapping between JS runtime, database raw, and JSON serialized representations.
Type parameters
- Runtime
- Raw
- Serialized = Raw
Loaded
Represents entity with its loaded relations (populate hint) and selected properties (fields hint).
The __loadHint marker uses contravariance to ensure Loaded<A, 'b'> is NOT assignable to Loaded<A, 'b.c'>.
Type parameters
- T
- L: string = never
- F: string = *
- E: string = never
LoggerNamespace
Available logging namespaces that can be individually enabled or disabled.
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
Represents a value that may be synchronous or wrapped in a Promise.
Type parameters
- T
MergeLoaded
Optimized MergeLoaded using intersection instead of extraction.
When T is already Loaded, we intersect with a new Loaded type for the additional hints.
This avoids the expensive pattern matching needed to extract hints from Loaded types.
Used for em.populate and em.refresh.
Type parameters
- T
- U
- P: string
- F: string
- E: string
- R: boolean = false
MergeSelected
Optimized MergeSelected using intersection instead of extraction. When T is already Loaded, we intersect with a new Loaded type for the selected fields. This avoids the expensive pattern matching needed to extract hints from Loaded types.
Type parameters
- T
- U
- F: string
MetadataProcessor
Callback for processing entity metadata during discovery or entity generation.
Type declaration
Parameters
metadata: EntityMetadata[]
platform: Platform
Returns MaybePromise<void>
MigrateOptions
Options for controlling which migrations to run (range, specific list, or transaction).
Type declaration
optionalfrom?: string | number
optionalmigrations?: string[]
optionalto?: string | number
optionaltransaction?: Transaction
MigrationInfo
Basic migration descriptor with a name and optional file path.
Type declaration
name: string
optionalpath?: string
MigrationResult
Result of creating a new migration file, including the generated code and schema diff.
Type declaration
code: string
diff: MigrationDiff
fileName: string
MigrationRow
A row from the migrations tracking table, representing an executed migration.
Type declaration
executed_at: Date
id: number
name: string
MigrationsOptions
Configuration options for database migrations.
Type declaration
optionalallOrNothing?: boolean
Run all migrations in the current batch in a master transaction.
optionaldisableForeignKeys?: boolean
Try to disable foreign key checks during migrations.
optionaldropTables?: boolean
Allow dropping tables during schema diff.
optionalemit?: js | ts | cjs
File extension for generated migration files.
optionalfileName?: (timestamp, name) => string
Custom function to generate migration file names.
Parameters
timestamp: string
optionalname: string
Returns string
optionalgenerator?: Constructor<IMigrationGenerator>
Custom migration generator class.
optionalglob?: string
Glob pattern to match migration files.
optionalmigrationsList?: (MigrationObject | Constructor<Migration>)[]
List of migration classes or objects to use instead of file-based discovery.
optionalpath?: string
Path to the folder with migration files (for compiled JavaScript files).
optionalpathTs?: string
Path to the folder with migration files (for TypeScript source files). Used when running in TypeScript mode.
optionalsafe?: boolean
Safe mode - only allow adding new tables and columns, never dropping existing ones.
optionalsilent?: boolean
Disable logging for migration operations.
optionalsnapshot?: boolean
Create a snapshot of the current schema after migration generation.
optionalsnapshotName?: string
Custom name for the snapshot file.
optionaltableName?: string
Name of the migrations table.
optionaltransactional?: boolean
Run each migration inside a transaction.
MigratorEvent
Events emitted by the migrator during migration execution.
New
Alias for Loaded<T, P>. Represents a newly created entity with all specified relations populated.
Type parameters
- T
- P: string = string
ObjectQuery
Object-based query filter combining operator maps with property-level filters.
Type parameters
- T
Opt
Branded type that marks a property as optional in em.create().
Use as a property type wrapper: createdAt: Opt<Date> instead of listing in [OptionalProps].
Type parameters
- T = unknown
OrderDefinition
Defines the ordering for query results, either a single order map or an array of them.
Type parameters
- T
Populate
Type for the populate option in find methods. An array of relation paths to eagerly load, or false to disable.
Type parameters
- T
- P: string = never
PopulateHintOptions
Inline options that can be appended to populate hint strings (e.g., strategy, join type).
Type declaration
optionaljoinType?: inner join | left join
optionalstrategy?: LoadStrategy.JOINED | LoadStrategy.SELECT_IN | joined | select-in
PopulateOptions
Parsed populate hint for a single relation, including strategy and nested children.
Type parameters
- T
Type declaration
optionalall?: boolean
optionalchildren?: PopulateOptions<T[keyof T]>[]
optionaldataOnly?: boolean
When true, ignores
mapToPkon the property and returns full entity data instead of just PKs.field: EntityKey<T>
optionalfilter?: boolean
optionaljoinType?: inner join | left join
optionalstrategy?: LoadStrategy
Prefixes
Expands a populate hint into all its prefixes. e.g., Prefixes<'a.b.c'> = 'a' | 'a.b' | 'a.b.c' This reflects that loading 'a.b.c' means 'a' and 'a.b' are also loaded. Special case: '*' returns string to ensure Loaded<T, '*'> is assignable to any Loaded<T, Hint>.
Type parameters
- S: string
Primary
Resolves the primary key type for an entity. Uses [PrimaryKeyProp] if declared,
otherwise falls back to _id, id, or uuid properties. For composite keys, returns a tuple.
Type parameters
- T
PropertyBuilders
Map of factory functions for creating type-safe property builders (scalars, enums, embeddables, and relations).
QueryOrderKeys
Type parameters
- T
QueryOrderKeysFlat
QueryOrderMap
Type parameters
- T
RawQueryFragmentSymbol
Branded symbol type used as a unique key for tracking raw SQL fragments in object properties.
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
Data shape for em.create() with required/optional distinction based on entity metadata.
Properties with defaults, nullable types, Opt brand, or [OptionalProps] declaration are optional.
I excludes additional types from being required (used for inverse side of relations).
Type parameters
- T
- I = never
- C: boolean = false
RequiredNullable
Branded type that marks a nullable property as required in em.create().
By default, nullable properties are treated as optional; this forces them to be explicitly provided.
Type parameters
- T = never
Scalar
Union of types considered "scalar" (non-entity) values. Used to distinguish entity relations from plain values.
ScalarRef
SchemaColumns
Column mapping for schema callbacks (indexes, checks, generated columns). Maps property names to field names. For TPT entities, only includes properties that belong to the current table (not inherited properties from parent tables).
Type parameters
- T
SchemaTable
Table reference for schema callbacks (indexes, checks, generated columns). Unlike FormulaTable, this has no alias since schema generation doesn't use query aliases.
Type declaration
name: string
qualifiedName: string
optionalschema?: string
toString: () => string
Returns string
Selected
Entity type narrowed to only the selected fields (F) and populated relations (L).
Used as the return type when fields option is specified in find methods.
Type parameters
- T
- L: string = never
- F: string = *
SerializeDTO
Return type of serialize(). Combines Loaded + EntityDTO in a single pass for better performance.
Respects populate hints (H) and exclude hints (E).
Type parameters
- T
- H: string = never
- E: string = never
- C: TypeConfig = never
Transaction
Opaque transaction context type, wrapping the driver-specific transaction object.
Type parameters
- T = any
TransactionEventType
UnboxArray
Unwraps an array type to its element type; non-arrays pass through unchanged.
Type parameters
- T
UniversalPropertyKeys
Union of all option keys supported across all property definition types (scalar, enum, embedded, relations).
Variables
constARRAY_OPERATORS
constConfig
Symbol used to declare type-level configuration on an entity (e.g., [Config]?: DefineConfig<{ forceObject: true }>).
constEagerProps
Symbol used to declare which relation properties should be eagerly loaded (e.g., [EagerProps]?: 'author').
constEntityManagerType
Symbol used to extract the EntityManager type from a driver instance.
constEntityName
Symbol used to declare the entity name as a string literal type (used by defineEntity).
constEntityRepositoryType
Symbol used to declare a custom repository type on an entity class (e.g., [EntityRepositoryType]?: BookRepository).
constEventTypeMap
constHiddenProps
Symbol used to declare which properties are hidden from serialization (e.g., [HiddenProps]?: 'password').
constJSON_KEY_OPERATORS
constJsonProperty
Symbol used to tag cloned embeddable data for JSON serialization handling.
constOptionalProps
Symbol used to declare which properties are optional in em.create() (e.g., [OptionalProps]?: 'createdAt').
constp
constPrimaryKeyProp
Symbol used to declare the primary key property name(s) on an entity (e.g., [PrimaryKeyProp]?: 'id').
constSCALAR_TYPES
constt
Shorthand alias for the types registry.
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
Registry of all built-in type constructors, keyed by their short name (e.g., types.integer, types.uuid).
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
Loose entity type used in generic contexts. Equivalent to
Partial<T>.