Skip to main content
Version: Next

abstractConnection

Hierarchy

Index

Constructors

constructor

Methods

begin

abstractcheckConnection

  • checkConnection(): Promise<{ ok: true } | { error?: Error; ok: false; reason: string }>
  • Are we connected to the database


    Returns Promise<{ ok: true } | { error?: Error; ok: false; reason: string }>

close

  • close(force?: boolean): Promise<void>
  • Closes the database connection (aka disconnect)


    Parameters

    • optionalforce: boolean

    Returns Promise<void>

commit

abstractconnect

  • connect(): void | Promise<void>
  • Establishes connection to database


    Returns void | Promise<void>

ensureConnection

  • ensureConnection(): Promise<void>
  • Ensure the connection exists, this is used to support lazy connect when using MikroORM.initSync()


    Returns Promise<void>

abstractexecute

  • execute(query: string, params?: any[], method?: get | all | run, ctx?: any): Promise<any>
  • Parameters

    • query: string
    • optionalparams: any[]
    • optionalmethod: get | all | run
    • optionalctx: any

    Returns Promise<any>

getClientUrl

  • getClientUrl(): string
  • Returns string

getConnectionOptions

abstractgetDefaultClientUrl

  • getDefaultClientUrl(): string
  • Returns default client url for given driver (e.g. mongodb://127.0.0.1:27017 for mongodb)


    Returns string

getPlatform

abstractisConnected

  • isConnected(): Promise<boolean>
  • Are we connected to the database


    Returns Promise<boolean>

rollback

setMetadata

setPlatform

  • Parameters

    Returns void

transactional