Version: 4.3

Class: SqliteConnection

Hierarchy

  • AbstractSqlConnection

    SqliteConnection

Constructors

constructor

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

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: SqliteConnection

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


RUN_QUERY_RE

Static Readonly RUN_QUERY_RE: RegExp = /^insert into|^update|^delete|^truncate/

Defined in packages/sqlite/src/SqliteConnection.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 AbstractSqlConnection.connect

Defined in packages/sqlite/src/SqliteConnection.ts:10

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>


getCallMethod

PrivategetCallMethod(obj: any): string

Defined in packages/sqlite/src/SqliteConnection.ts:94

Parameters:

NameType
objany

Returns: string


getClientUrl

getClientUrl(): string

Overrides AbstractSqlConnection.getClientUrl

Defined in packages/sqlite/src/SqliteConnection.ts:20

Returns: string


getConnectionOptions

getConnectionOptions(): ConnectionConfig

Inherited from AbstractSqlConnection.getConnectionOptions

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

Returns: ConnectionConfig


getDefaultClientUrl

getDefaultClientUrl(): string

Overrides AbstractSqlConnection.getDefaultClientUrl

Defined in packages/sqlite/src/SqliteConnection.ts:16

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

Overrides MariaDbConnection.getKnexOptions

Defined in packages/sqlite/src/SqliteConnection.ts:30

Parameters:

NameType
typestring

Returns: Config


getPatchedDialect

PrivategetPatchedDialect(): any

Defined in packages/sqlite/src/SqliteConnection.ts:58

monkey patch knex' sqlite Dialect so it returns inserted id when doing raw insert query

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>

Overrides MariaDbConnection.loadFile

Defined in packages/sqlite/src/SqliteConnection.ts:24

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

Overrides void

Defined in packages/sqlite/src/SqliteConnection.ts:40

Type parameters:

Name
T

Parameters:

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

Returns: T

Last updated on by Martin Adámek