Version: 1.0

SQLiteKnexDBDataProvider

Knex.js database data provider exposing basic CRUD operations.

NOTE: This class implements SQLite specific implementaion

Type parameters#

Type

Hierarchy#

Implements#

  • GraphbackDataProvider‹Type›

Index#

Constructors#

Properties#

Methods#

Constructors#

constructor#

+ new SQLiteKnexDBDataProvider(model: ModelDefinition, db: Knex): SQLiteKnexDBDataProvider

Overrides KnexDBDataProvider.constructor

Defined in SQLiteKnexDBDataProvider.ts:11

Parameters:

NameType
modelModelDefinition
dbKnex

Returns: SQLiteKnexDBDataProvider

Properties#

Protected db#

db: Knex

Inherited from KnexDBDataProvider.db

Defined in KnexDBDataProvider.ts:18


Protected queryBuilder#

queryBuilder: CRUDKnexQueryMapper

Inherited from KnexDBDataProvider.queryBuilder

Defined in KnexDBDataProvider.ts:21


Protected tableMap#

tableMap: ModelTableMap

Inherited from KnexDBDataProvider.tableMap

Defined in KnexDBDataProvider.ts:20


Protected tableName#

tableName: string

Inherited from KnexDBDataProvider.tableName

Defined in KnexDBDataProvider.ts:19

Methods#

batchRead#

batchRead(relationField: string, ids: string[], filter?: QueryFilter, selectedFields?: string[]): Promise‹Type[][]›

Inherited from KnexDBDataProvider.batchRead

Defined in KnexDBDataProvider.ts:97

Parameters:

NameType
relationFieldstring
idsstring[]
filter?QueryFilter
selectedFields?string[]

Returns: Promise‹Type[][]›


count#

count(filter?: QueryFilter): Promise‹number›

Inherited from KnexDBDataProvider.count

Defined in KnexDBDataProvider.ts:90

Parameters:

NameType
filter?QueryFilter

Returns: Promise‹number›


create#

create(data: Type, selectedFields?: string[]): Promise‹Type›

Overrides KnexDBDataProvider.create

Defined in SQLiteKnexDBDataProvider.ts:17

Parameters:

NameType
dataType
selectedFields?string[]

Returns: Promise‹Type›


delete#

delete(data: Partial‹Type›, selectedFields?: string[]): Promise‹Type›

Overrides KnexDBDataProvider.delete

Defined in SQLiteKnexDBDataProvider.ts:45

Parameters:

NameType
dataPartial‹Type›
selectedFields?string[]

Returns: Promise‹Type›


findBy#

findBy(args?: FindByArgs, selectedFields?: string[]): Promise‹Type[]›

Inherited from KnexDBDataProvider.findBy

Defined in KnexDBDataProvider.ts:74

Parameters:

NameType
args?FindByArgs
selectedFields?string[]

Returns: Promise‹Type[]›


findOne#

findOne(args: Partial‹Type›, selectedFields?: string[]): Promise‹Type›

Inherited from KnexDBDataProvider.findOne

Defined in KnexDBDataProvider.ts:63

Parameters:

NameType
argsPartial‹Type›
selectedFields?string[]

Returns: Promise‹Type›


Protected getSelectedFields#

getSelectedFields(selectedFields: string[]): string[] | ""*

Inherited from KnexDBDataProvider.getSelectedFields

Defined in KnexDBDataProvider.ts:111

Parameters:

NameType
selectedFieldsstring[]

Returns: string[] | ""*


update#

update(data: Partial‹Type›, selectedFields?: string[]): Promise‹Type›

Overrides KnexDBDataProvider.update

Defined in SQLiteKnexDBDataProvider.ts:30

Parameters:

NameType
dataPartial‹Type›
selectedFields?string[]

Returns: Promise‹Type›