Skip to main content

SQLiteDialect

@webda/sqlite


Class: SQLiteDialect

Defined in: sqlite/src/dialect.ts:57

SQLite JSON1 syntax: uuid TEXT key, data TEXT JSON document, ?n placeholders

Extended by​

Implements​

  • SQLDialect

Constructors​

Constructor​

new SQLiteDialect(): SQLiteDialect

Returns​

SQLiteDialect

Properties​

binaryCollation​

readonly binaryCollation: "COLLATE BINARY" = "COLLATE BINARY"

Defined in: sqlite/src/dialect.ts:61

Binary collation

Implementation of​

SQLDialect.binaryCollation

Methods​

asNumber()​

asNumber(json): string

Defined in: sqlite/src/dialect.ts:113

Parameters​

json​

string

Returns​

string

Implementation of​

SQLDialect.asNumber


asString()​

asString(json): string

Defined in: sqlite/src/dialect.ts:118

Parameters​

json​

string

Returns​

string

Implementation of​

SQLDialect.asString


backfillTypes()​

backfillTypes(table): string

Defined in: sqlite/src/dialect.ts:273

Parameters​

table​

string

Returns​

string

Implementation of​

SQLDialect.backfillTypes


bulkAssign()​

bulkAssign(_table, assignments, args): string

Defined in: sqlite/src/dialect.ts:253

One json_set: parents of dotted targets made objects (read from the stored row: a statement never sets a field and one of its children), then the values. An array index beyond the end of an existing array is not applied (json_set ignores a path past the end).

Parameters​

_table​

string

assignments​

object[]

args​

any[]

Returns​

string

Implementation of​

SQLDialect.bulkAssign


checkIndex()​

protected checkIndex(index): number

Defined in: sqlite/src/dialect.ts:310

Check index

Parameters​

index​

number

an array index written inside a JSON path literal

Returns​

number

the index


checkKey()​

protected checkKey(key): void

Defined in: sqlite/src/dialect.ts:299

Check key

Parameters​

key​

string

a top-level key written inside a JSON path literal

Returns​

void


collectionItemCondition()​

collectionItemCondition(attr, index, field, valueParam): string

Defined in: sqlite/src/dialect.ts:238

Without an index (an append with a condition) the condition never matches, as on the other stores

Parameters​

attr​

string

index​

number | undefined

field​

string

valueParam​

number

Returns​

string

Implementation of​

SQLDialect.collectionItemCondition


contains()​

contains(json, value): string

Defined in: sqlite/src/dialect.ts:133

Parameters​

json​

string

value​

string | number | boolean

Returns​

string

Implementation of​

SQLDialect.contains


countStoredTypes()​

countStoredTypes(table): string

Defined in: sqlite/src/dialect.ts:278

Parameters​

table​

string

Returns​

string

Implementation of​

SQLDialect.countStoredTypes


createTable()​

createTable(table): string

Defined in: sqlite/src/dialect.ts:151

Parameters​

table​

string

Returns​

string

Implementation of​

SQLDialect.createTable


decode()​

decode(value): any

Defined in: sqlite/src/dialect.ts:291

The data column is JSON text

Parameters​

value​

any

Returns​

any

Implementation of​

SQLDialect.decode


distinctFrom()​

distinctFrom(left, right): string

Defined in: sqlite/src/dialect.ts:128

Parameters​

left​

string

string

Returns​

string

Implementation of​

SQLDialect.distinctFrom


hasStoredType()​

hasStoredType(): string

Defined in: sqlite/src/dialect.ts:167

Returns​

string

Implementation of​

SQLDialect.hasStoredType


increment()​

increment(entries, updateDate, args): string

Defined in: sqlite/src/dialect.ts:204

Parameters​

entries​

object[]

updateDate​

string

args​

any[]

Returns​

string

Implementation of​

SQLDialect.increment


isObjectRow()​

isObjectRow(): string

Defined in: sqlite/src/dialect.ts:283

Returns​

string

Implementation of​

SQLDialect.isObjectRow


isType()​

isType(json, type): string

Defined in: sqlite/src/dialect.ts:99

Parameters​

json​

string

type​

JSONType

Returns​

string

Implementation of​

SQLDialect.isType


isUniqueViolation()​

isUniqueViolation(err): boolean

Defined in: sqlite/src/dialect.ts:159

SQLITE_CONSTRAINT_PRIMARYKEY (1555) or SQLITE_CONSTRAINT_UNIQUE (2067)

Parameters​

err​

unknown

Returns​

boolean

Implementation of​

SQLDialect.isUniqueViolation


jsonParam()​

jsonParam(i): string

Defined in: sqlite/src/dialect.ts:69

Parameters​

i​

number

Returns​

string

Implementation of​

SQLDialect.jsonParam


jsonText()​

jsonText(path): string

Defined in: sqlite/src/dialect.ts:77

Booleans read as true / false (not 0 / 1), everything else as its text; NULL for missing and JSON null

Parameters​

path​

string[]

Returns​

string

Implementation of​

SQLDialect.jsonText


jsonValue()​

jsonValue(path): string

Defined in: sqlite/src/dialect.ts:83

Parameters​

path​

string[]

Returns​

string

Implementation of​

SQLDialect.jsonValue


jsonValueOrNull()​

jsonValueOrNull(path): string

Defined in: sqlite/src/dialect.ts:88

Parameters​

path​

string[]

Returns​

string

Implementation of​

SQLDialect.jsonValueOrNull


keptType()​

keptType(mapParam): string

Defined in: sqlite/src/dialect.ts:172

Parameters​

mapParam​

number

Returns​

string

Implementation of​

SQLDialect.keptType


keyText()​

keyText(key): string

Defined in: sqlite/src/dialect.ts:93

Parameters​

key​

string

Returns​

string

Implementation of​

SQLDialect.keyText


like()​

like(text, pattern): string

Defined in: sqlite/src/dialect.ts:146

Parameters​

text​

string

pattern​

string

Returns​

string

Implementation of​

SQLDialect.like


placeholder()​

placeholder(i): string

Defined in: sqlite/src/dialect.ts:64

Parameters​

i​

number

Returns​

string

Implementation of​

SQLDialect.placeholder


removeCollectionItem()​

removeCollectionItem(attr, index, updateDate): string

Defined in: sqlite/src/dialect.ts:229

Parameters​

attr​

string

index​

number

updateDate​

string

Returns​

string

Implementation of​

SQLDialect.removeCollectionItem


removeKey()​

removeKey(attribute, args): string

Defined in: sqlite/src/dialect.ts:197

Parameters​

attribute​

string

args​

any[]

Returns​

string

Implementation of​

SQLDialect.removeKey


setCollectionItem()​

setCollectionItem(attr, itemParam, index, updateDate): string

Defined in: sqlite/src/dialect.ts:217

An index at or beyond the end appends (json_set ignores a path past the end), as PostgreSQL jsonb_set does

Parameters​

attr​

string

itemParam​

number

index​

number | undefined

updateDate​

string

Returns​

string

Implementation of​

SQLDialect.setCollectionItem


shallowMerge()​

shallowMerge(json, patch, args): string

Defined in: sqlite/src/dialect.ts:185

One json_set pair per top-level key (json_patch would drop null values and merge nested objects)

Parameters​

json​

string

patch​

Record<string, any>

args​

any[]

Returns​

string

Implementation of​

SQLDialect.shallowMerge


typedAttribute()​

typedAttribute(_text, json, type): string

Defined in: sqlite/src/dialect.ts:123

Parameters​

_text​

string

json​

string

type​

"number" | "boolean"

Returns​

string

Implementation of​

SQLDialect.typedAttribute


withStoredType()​

withStoredType(json, type): string

Defined in: sqlite/src/dialect.ts:177

Parameters​

json​

string

type​

string

Returns​

string

Implementation of​

SQLDialect.withStoredType