Skip to main content
Version: 5.2

PostgreSqlConnection

Hierarchy

Index

Constructors

constructor

Methods

begin

  • Parameters

    Returns Promise<Transaction<any, any[]>>

close

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


    Parameters

    • optionalforce: boolean

    Returns Promise<void>

commit

  • Parameters

    Returns Promise<void>

connect

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


    Returns Promise<void>

execute

  • execute<T>(queryOrKnex: string | QueryBuilder<any, any> | Raw<any>, params?: unknown[], method?: get | all | run, ctx?: any): Promise<T>

getClientUrl

  • getClientUrl(): string
  • Returns string

getConnectionOptions

  • getConnectionOptions(): PgConnectionConfig
  • Returns PgConnectionConfig

getDefaultClientUrl

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


    Returns string

getKnex

  • getKnex(): Knex<any, any[]>
  • Returns Knex<any, any[]>

getPlatform

  • Returns Platform

isConnected

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


    Returns Promise<boolean>

loadFile

  • loadFile(path: string): Promise<void>
  • Execute raw SQL queries from file


    Parameters

    • path: string

    Returns Promise<void>

rollback

  • Parameters

    Returns Promise<void>

setMetadata

  • Parameters

    Returns void

setPlatform

  • Parameters

    Returns void

transactional

  • Type parameters

    • T

    Parameters

    Returns Promise<T>