abstractConnection
Hierarchy
- Connection
Index
Constructors
constructor
Parameters
config: Configuration<IDatabaseDriver<Connection>, EntityManager<IDatabaseDriver<Connection>>>
optionaloptions: ConnectionOptions
type: ConnectionType = 'write'
Returns Connection
Methods
begin
Parameters
optionaloptions: { ctx?: any; eventBroadcaster?: TransactionEventBroadcaster; isolationLevel?: IsolationLevel; readOnly?: boolean }
optionalctx: any
optionaleventBroadcaster: TransactionEventBroadcaster
optionalisolationLevel: IsolationLevel
optionalreadOnly: boolean
Returns Promise<any>
abstractcheckConnection
Returns Promise<{ ok: true } | { error?: Error; ok: false; reason: string }>
close
Closes the database connection (aka disconnect)
Parameters
optionalforce: boolean
Returns Promise<void>
commit
Parameters
ctx: any
optionaleventBroadcaster: TransactionEventBroadcaster
Returns Promise<void>
abstractconnect
Establishes connection to database
Returns void | Promise<void>
ensureConnection
Ensure the connection exists, this is used to support lazy connect when using
MikroORM.initSync()
Returns Promise<void>
abstractexecute
Parameters
query: string
optionalparams: any[]
optionalmethod: get | all | run
optionalctx: any
Returns Promise<any>
getClientUrl
Returns string
getConnectionOptions
Returns ConnectionConfig
abstractgetDefaultClientUrl
Returns default client url for given driver (e.g. mongodb://127.0.0.1:27017 for mongodb)
Returns string
getPlatform
Returns Platform
abstractisConnected
Are we connected to the database
Returns Promise<boolean>
rollback
Parameters
ctx: any
optionaleventBroadcaster: TransactionEventBroadcaster
Returns Promise<void>
setMetadata
Parameters
metadata: MetadataStorage
Returns void
setPlatform
Parameters
platform: Platform
Returns void
transactional
Parameters
cb: (trx: any) => Promise<T>
optionaloptions: { ctx?: any; eventBroadcaster?: TransactionEventBroadcaster; isolationLevel?: IsolationLevel; readOnly?: boolean }
optionalctx: any
optionaleventBroadcaster: TransactionEventBroadcaster
optionalisolationLevel: IsolationLevel
optionalreadOnly: boolean
Returns Promise<T>
Are we connected to the database