Skip to main content

SQLiteDialect

@webda/sqlite


Class: SQLiteDialect

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

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

Implements​

  • SQLDialect

Constructors​

Constructor​

new SQLiteDialect(): SQLiteDialect

Returns​

SQLiteDialect

Properties​

binaryCollation​

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

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

Clause ordering text in code unit order: COLLATE "C" / COLLATE BINARY

Implementation of​

SQLDialect.binaryCollation

Methods​

asNumber()​

asNumber(json): string

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

Parameters​

json​

string

Returns​

string

Implementation of​

SQLDialect.asNumber


asString()​

asString(json): string

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

Parameters​

json​

string

Returns​

string

Implementation of​

SQLDialect.asString


backfillTypes()​

backfillTypes(table): string

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

Parameters​

table​

string

Returns​

string

Implementation of​

SQLDialect.backfillTypes


bulkAssign()​

bulkAssign(_table, assignments, args): string

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

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

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

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

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

Parameters​

json​

string

value​

string | number | boolean

Returns​

string

Implementation of​

SQLDialect.contains


countStoredTypes()​

countStoredTypes(table): string

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

Parameters​

table​

string

Returns​

string

Implementation of​

SQLDialect.countStoredTypes


createTable()​

createTable(table): string

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

Parameters​

table​

string

Returns​

string

Implementation of​

SQLDialect.createTable


decode()​

decode(value): any

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

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

Parameters​

left​

string

string

Returns​

string

Implementation of​

SQLDialect.distinctFrom


hasStoredType()​

hasStoredType(): string

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

Returns​

string

Implementation of​

SQLDialect.hasStoredType


increment()​

increment(entries, updateDate, args): string

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

Parameters​

entries​

object[]

updateDate​

string

args​

any[]

Returns​

string

Implementation of​

SQLDialect.increment


isObjectRow()​

isObjectRow(): string

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

Returns​

string

Implementation of​

SQLDialect.isObjectRow


isType()​

isType(json, type): string

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

Parameters​

json​

string

type​

JSONType

Returns​

string

Implementation of​

SQLDialect.isType


isUniqueViolation()​

isUniqueViolation(err): boolean

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

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

Parameters​

i​

number

Returns​

string

Implementation of​

SQLDialect.jsonParam


jsonText()​

jsonText(path): string

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

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

Parameters​

path​

string[]

Returns​

string

Implementation of​

SQLDialect.jsonValue


jsonValueOrNull()​

jsonValueOrNull(path): string

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

Parameters​

path​

string[]

Returns​

string

Implementation of​

SQLDialect.jsonValueOrNull


keptType()​

keptType(mapParam): string

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

Parameters​

mapParam​

number

Returns​

string

Implementation of​

SQLDialect.keptType


keyText()​

keyText(key): string

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

Parameters​

key​

string

Returns​

string

Implementation of​

SQLDialect.keyText


like()​

like(text, pattern): string

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

Parameters​

text​

string

pattern​

string

Returns​

string

Implementation of​

SQLDialect.like


placeholder()​

placeholder(i): string

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

Parameters​

i​

number

Returns​

string

Implementation of​

SQLDialect.placeholder


removeCollectionItem()​

removeCollectionItem(attr, index, updateDate): string

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

Parameters​

attr​

string

index​

number

updateDate​

string

Returns​

string

Implementation of​

SQLDialect.removeCollectionItem


removeKey()​

removeKey(attribute, args): string

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

Parameters​

attribute​

string

args​

any[]

Returns​

string

Implementation of​

SQLDialect.removeKey


setCollectionItem()​

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

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

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

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

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

Parameters​

json​

string

type​

string

Returns​

string

Implementation of​

SQLDialect.withStoredType