Skip to main content
Version: 6.3

abstractConnection

Hierarchy

Index

Constructors

constructor

Methods

begin

abstractcheckConnection

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


    Returns Promise<{ error?: Error; ok: boolean; 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<T>(query: string, params?: any[], method?: get | all | run, ctx?: any): Promise<any>
  • Type parameters

    • T

    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