PostgreSqlConnection
Hierarchy
- AbstractSqlConnection
- PostgreSqlConnection
Index
Constructors
constructor
Parameters
config: Configuration<IDatabaseDriver<Connection>, EntityManager<IDatabaseDriver<Connection>>>
optionaloptions: ConnectionOptions
optionaltype: read | write
Returns PostgreSqlConnection
Methods
inheritedbegin
Parameters
options: { ctx?: Transaction<any, any[]>; eventBroadcaster?: TransactionEventBroadcaster; isolationLevel?: IsolationLevel; readOnly?: boolean } = {}
optionalctx: Transaction<any, any[]>
optionaleventBroadcaster: TransactionEventBroadcaster
optionalisolationLevel: IsolationLevel
optionalreadOnly: boolean
Returns Promise<Transaction<any, any[]>>
inheritedcheckConnection
Returns Promise<{ ok: true } | { error?: Error; ok: false; reason: string }>
inheritedclose
Closes the database connection (aka disconnect)
Parameters
optionalforce: boolean
Returns Promise<void>
inheritedcommit
Parameters
ctx: Transaction<any, any[]>
optionaleventBroadcaster: TransactionEventBroadcaster
Returns Promise<void>
inheritedconnect
Establishes connection to database
Returns void | Promise<void>
createKnex
Returns void
inheritedensureConnection
Ensure the connection exists, this is used to support lazy connect when using
MikroORM.initSync()
Returns Promise<void>
inheritedexecute
Parameters
queryOrKnex: string | QueryBuilder<any, any> | Raw<any>
params: unknown[] = []
method: get | all | run = 'all'
optionalctx: any
optionalloggerContext: LoggingOptions
Returns Promise<T>
inheritedgetClientUrl
Returns string
getConnectionOptions
Returns PgConnectionConfig
getDefaultClientUrl
Returns default client url for given driver (e.g. mongodb://127.0.0.1:27017 for mongodb)
Returns string
inheritedgetKnex
Returns Knex<any, any[]>
inheritedgetPlatform
Returns Platform
inheritedisConnected
Are we connected to the database
Returns Promise<boolean>
inheritedloadFile
Execute raw SQL queries from file
Parameters
path: string
Returns Promise<void>
inheritedrollback
Parameters
ctx: Transaction<any, any[]>
optionaleventBroadcaster: TransactionEventBroadcaster
Returns Promise<void>
inheritedsetMetadata
Parameters
metadata: MetadataStorage
Returns void
inheritedsetPlatform
Parameters
platform: Platform
Returns void
inheritedtransactional
Parameters
cb: (trx: Transaction<any, any[]>) => Promise<T>
options: { ctx?: Transaction<any, any[]>; eventBroadcaster?: TransactionEventBroadcaster; isolationLevel?: IsolationLevel; readOnly?: boolean } = {}
optionalctx: Transaction<any, any[]>
optionaleventBroadcaster: TransactionEventBroadcaster
optionalisolationLevel: IsolationLevel
optionalreadOnly: boolean
Returns Promise<T>
Are we connected to the database