Version: 4.3

Class: MariaDbConnection

Hierarchy

  • MySqlConnection

    MariaDbConnection

Constructors

constructor

+ new MariaDbConnection(config: Configuration, options?: ConnectionOptions, type?: "read" | "write"): MariaDbConnection

Inherited from MariaDbConnection.constructor

Overrides MongoConnection.constructor

Defined in packages/knex/dist/AbstractSqlConnection.d.ts:6

Parameters:

NameType
configConfiguration
options?ConnectionOptions
type?"read" | "write"

Returns: MariaDbConnection

Properties

client

Protected client: Knex

Inherited from MariaDbConnection.client

Overrides void

Defined in packages/knex/dist/AbstractSqlConnection.d.ts:6


config

Protected Readonly config: Configuration

Inherited from AbstractSqlConnection.config

Defined in packages/core/dist/connections/Connection.d.ts:6


metadata

Protected metadata: MetadataStorage

Inherited from AbstractSqlConnection.metadata

Defined in packages/core/dist/connections/Connection.d.ts:9


options

Protected Optional Readonly options: ConnectionOptions | undefined

Inherited from AbstractSqlConnection.options

Defined in packages/core/dist/connections/Connection.d.ts:7


platform

Protected platform: AbstractSqlPlatform

Inherited from MariaDbConnection.platform

Overrides MongoConnection.platform

Defined in packages/knex/dist/AbstractSqlConnection.d.ts:5


type

Protected Readonly type: "read" | "write"

Inherited from AbstractSqlConnection.type

Defined in packages/core/dist/connections/Connection.d.ts:8

Methods

begin

begin(ctx?: KnexTransaction): Promise<KnexTransaction>

Inherited from MariaDbConnection.begin

Overrides void

Defined in packages/knex/dist/AbstractSqlConnection.d.ts:12

Parameters:

NameType
ctx?KnexTransaction

Returns: Promise<KnexTransaction>


close

close(force?: boolean): Promise<void>

Inherited from MariaDbConnection.close

Overrides void

Defined in packages/knex/dist/AbstractSqlConnection.d.ts:9

Parameters:

NameType
force?boolean

Returns: Promise<void>


commit

commit(ctx: KnexTransaction): Promise<void>

Inherited from MariaDbConnection.commit

Overrides void

Defined in packages/knex/dist/AbstractSqlConnection.d.ts:13

Parameters:

NameType
ctxKnexTransaction

Returns: Promise<void>


connect

connect(): Promise<void>

Overrides void

Defined in packages/mariadb/src/MariaDbConnection.ts:6

Returns: Promise<void>


createKnexClient

ProtectedcreateKnexClient(type: string): Knex

Inherited from MariaDbConnection.createKnexClient

Defined in packages/knex/dist/AbstractSqlConnection.d.ts:21

Parameters:

NameType
typestring

Returns: Knex


execute

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

Inherited from MariaDbConnection.execute

Overrides void

Defined in packages/knex/dist/AbstractSqlConnection.d.ts:15

Type parameters:

NameTypeDefault
TQueryResult | EntityData<AnyEntity> | EntityData<AnyEntity>[]EntityData\<AnyEntity>[]

Parameters:

NameType
queryOrKnexstring | QueryBuilder | Raw
params?any[]
method?"all" | "get" | "run"
ctx?Transaction

Returns: Promise<T>


executeQuery

ProtectedexecuteQuery<T>(query: string, cb: () => Promise<T>): Promise<T>

Inherited from AbstractSqlConnection.executeQuery

Defined in packages/core/dist/connections/Connection.d.ts:38

Type parameters:

Name
T

Parameters:

NameType
querystring
cb() => Promise<T>

Returns: Promise<T>


getClientUrl

getClientUrl(): string

Inherited from AbstractSqlConnection.getClientUrl

Defined in packages/core/dist/connections/Connection.d.ts:35

Returns: string


getConnectionOptions

getConnectionOptions(): MySqlConnectionConfig

Overrides void

Defined in packages/mariadb/src/MariaDbConnection.ts:10

Returns: MySqlConnectionConfig


getDefaultClientUrl

getDefaultClientUrl(): string

Inherited from MariaDbConnection.getDefaultClientUrl

Overrides AbstractSqlConnection.getDefaultClientUrl

Defined in packages/mysql-base/dist/MySqlConnection.d.ts:4

Returns: string


getKnex

getKnex(): Knex

Inherited from MariaDbConnection.getKnex

Defined in packages/knex/dist/AbstractSqlConnection.d.ts:8

Returns: Knex


getKnexOptions

ProtectedgetKnexOptions(type: string): Config

Inherited from MariaDbConnection.getKnexOptions

Defined in packages/knex/dist/AbstractSqlConnection.d.ts:22

Parameters:

NameType
typestring

Returns: Config


getPatchedDialect

PrivategetPatchedDialect(): any

Defined in packages/mariadb/src/MariaDbConnection.ts:17

Returns: any


isConnected

isConnected(): Promise<boolean>

Inherited from MariaDbConnection.isConnected

Overrides void

Defined in packages/knex/dist/AbstractSqlConnection.d.ts:10

Returns: Promise<boolean>


loadFile

loadFile(path: string): Promise<void>

Inherited from MariaDbConnection.loadFile

Defined in packages/knex/dist/AbstractSqlConnection.d.ts:19

Execute raw SQL queries from file

Parameters:

NameType
pathstring

Returns: Promise<void>


logQuery

ProtectedlogQuery(query: string, took?: number): void

Inherited from MariaDbConnection.logQuery

Overrides void

Defined in packages/knex/dist/AbstractSqlConnection.d.ts:20

Parameters:

NameType
querystring
took?number

Returns: void


rollback

rollback(ctx: KnexTransaction): Promise<void>

Inherited from MariaDbConnection.rollback

Overrides void

Defined in packages/knex/dist/AbstractSqlConnection.d.ts:14

Parameters:

NameType
ctxKnexTransaction

Returns: Promise<void>


setMetadata

setMetadata(metadata: MetadataStorage): void

Inherited from AbstractSqlConnection.setMetadata

Defined in packages/core/dist/connections/Connection.d.ts:36

Parameters:

NameType
metadataMetadataStorage

Returns: void


setPlatform

setPlatform(platform: Platform): void

Inherited from AbstractSqlConnection.setPlatform

Defined in packages/core/dist/connections/Connection.d.ts:37

Parameters:

NameType
platformPlatform

Returns: void


transactional

transactional<T>(cb: (trx: Transaction<KnexTransaction>) => Promise<T>, ctx?: Transaction<KnexTransaction>): Promise<T>

Inherited from MariaDbConnection.transactional

Overrides void

Defined in packages/knex/dist/AbstractSqlConnection.d.ts:11

Type parameters:

Name
T

Parameters:

NameType
cb(trx: Transaction<KnexTransaction>) => Promise<T>
ctx?Transaction<KnexTransaction>

Returns: Promise<T>


transformRawResult

ProtectedtransformRawResult<T>(res: any, method: "all" | "get" | "run"): T

Inherited from MariaDbConnection.transformRawResult

Overrides void

Defined in packages/mysql-base/dist/MySqlConnection.d.ts:6

Type parameters:

Name
T

Parameters:

NameType
resany
method"all" | "get" | "run"

Returns: T

Last updated on by Martin Adámek