@faasjs/knex

License: MITopen in new windowNPM Stable Versionopen in new windowNPM Beta Versionopen in new window

FaasJS's sql plugin, base on Knexopen in new window.

Install

npm install @faasjs/knex

Modules

Classes

Type aliases

Functions

Type aliases

KnexConfig

Ƭ KnexConfig: Object

Type declaration

NameType
config?K.Config
name?string

Functions

query

query<TName>(table): QueryBuilder<TableType<TName>, DeferredKeySelection<ResolveTableType<TableType<TName>, "base">, never, false, {}, false, {}, never>[]>

Type parameters

NameType
TNameextends never

Parameters

NameType
tableTName

Returns

QueryBuilder<TableType<TName>, DeferredKeySelection<ResolveTableType<TableType<TName>, "base">, never, false, {}, false, {}, never>[]>


raw

raw<TResult>(sql, bindings?): Promise<K.Raw<TResult>>

Type parameters

NameType
TResultany

Parameters

NameTypeDefault value
sqlstringundefined
bindingsRawBinding[] | ValueDict[]

Returns

Promise<K.Raw<TResult>>


transaction

transaction<TResult>(scope, config?): Promise<TResult>

Type parameters

NameType
TResultany

Parameters

NameType
scope(trx: Transaction<any, any>) => void | Promise<TResult>
config?any

Returns

Promise<TResult>


useKnex

useKnex(config?): Knex & UseifyPlugin

Parameters

NameType
config?KnexConfig

Returns

Knex & UseifyPlugin