Skip to main content

PostgresDialect

@webda/postgres


Class: PostgresDialect

Defined in: postgres/src/dialect.ts:7

PostgreSQL JSONB syntax: uuid VARCHAR(255) key, data jsonb document, $n placeholders

Implements​

Constructors​

Constructor​

new PostgresDialect(): PostgresDialect

Returns​

PostgresDialect

Properties​

binaryCollation​

readonly binaryCollation: "COLLATE \"C\""

Defined in: postgres/src/dialect.ts:8

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

Implementation of​

SQLDialect.binaryCollation

Methods​

asNumber()​

asNumber(json): string

Defined in: postgres/src/dialect.ts:46

Parameters​

json​

string

Returns​

string

Implementation of​

SQLDialect.asNumber


asString()​

asString(json): string

Defined in: postgres/src/dialect.ts:51

Parameters​

json​

string

Returns​

string

Implementation of​

SQLDialect.asString


backfillTypes()​

backfillTypes(table): string

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

Parameters​

table​

string

Returns​

string

Implementation of​

SQLDialect.backfillTypes


bulkAssign()​

bulkAssign(table, assignments, values): string

Defined in: postgres/src/dialect.ts:150

One step per jsonb_set, each reading the previous one (d0 is the row data): the SQL stays linear in size

Parameters​

table​

string

assignments​

object[]

values​

any[]

Returns​

string

Implementation of​

SQLDialect.bulkAssign


collectionItemCondition()​

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

Defined in: postgres/src/dialect.ts:142

Parameters​

attr​

string

index​

number | undefined

field​

string

valueParam​

number

Returns​

string

Implementation of​

SQLDialect.collectionItemCondition


contains()​

contains(json, value): string

Defined in: postgres/src/dialect.ts:66

Parameters​

json​

string

value​

string | number | boolean

Returns​

string

Implementation of​

SQLDialect.contains


countStoredTypes()​

countStoredTypes(table): string

Defined in: postgres/src/dialect.ts:182

Parameters​

table​

string

Returns​

string

Implementation of​

SQLDialect.countStoredTypes


createTable()​

createTable(table): string

Defined in: postgres/src/dialect.ts:76

Parameters​

table​

string

Returns​

string

Implementation of​

SQLDialect.createTable


decode()​

decode(value): any

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

pg parses jsonb columns

Parameters​

value​

any

Returns​

any

Implementation of​

SQLDialect.decode


distinctFrom()​

distinctFrom(left, right): string

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

Parameters​

left​

string

string

Returns​

string

Implementation of​

SQLDialect.distinctFrom


hasStoredType()​

hasStoredType(): string

Defined in: postgres/src/dialect.ts:89

Returns​

string

Implementation of​

SQLDialect.hasStoredType


increment()​

increment(entries, updateDate, args): string

Defined in: postgres/src/dialect.ts:116

Parameters​

entries​

object[]

updateDate​

string

args​

any[]

Returns​

string

Implementation of​

SQLDialect.increment


isObjectRow()​

isObjectRow(): string

Defined in: postgres/src/dialect.ts:189

Returns​

string

Implementation of​

SQLDialect.isObjectRow


isType()​

isType(json, type): string

Defined in: postgres/src/dialect.ts:41

Parameters​

json​

string

type​

JSONType

Returns​

string

Implementation of​

SQLDialect.isType


isUniqueViolation()​

isUniqueViolation(err): boolean

Defined in: postgres/src/dialect.ts:84

unique_violation

Parameters​

err​

unknown

Returns​

boolean

Implementation of​

SQLDialect.isUniqueViolation


jsonParam()​

jsonParam(i): string

Defined in: postgres/src/dialect.ts:16

Parameters​

i​

number

Returns​

string

Implementation of​

SQLDialect.jsonParam


jsonText()​

jsonText(path): string

Defined in: postgres/src/dialect.ts:21

Parameters​

path​

string[]

Returns​

string

Implementation of​

SQLDialect.jsonText


jsonValue()​

jsonValue(path): string

Defined in: postgres/src/dialect.ts:26

Parameters​

path​

string[]

Returns​

string

Implementation of​

SQLDialect.jsonValue


jsonValueOrNull()​

jsonValueOrNull(path): string

Defined in: postgres/src/dialect.ts:31

Parameters​

path​

string[]

Returns​

string

Implementation of​

SQLDialect.jsonValueOrNull


keptType()​

keptType(mapParam): string

Defined in: postgres/src/dialect.ts:94

Parameters​

mapParam​

number

Returns​

string

Implementation of​

SQLDialect.keptType


keyText()​

keyText(key): string

Defined in: postgres/src/dialect.ts:36

Parameters​

key​

string

Returns​

string

Implementation of​

SQLDialect.keyText


like()​

like(text, pattern): string

Defined in: postgres/src/dialect.ts:71

Parameters​

text​

string

pattern​

string

Returns​

string

Implementation of​

SQLDialect.like


placeholder()​

placeholder(i): string

Defined in: postgres/src/dialect.ts:11

Parameters​

i​

number

Returns​

string

Implementation of​

SQLDialect.placeholder


removeCollectionItem()​

removeCollectionItem(attr, index, updateDate): string

Defined in: postgres/src/dialect.ts:137

Parameters​

attr​

string

index​

number

updateDate​

string

Returns​

string

Implementation of​

SQLDialect.removeCollectionItem


removeKey()​

removeKey(attribute, args): string

Defined in: postgres/src/dialect.ts:110

Parameters​

attribute​

string

args​

any[]

Returns​

string

Implementation of​

SQLDialect.removeKey


setCollectionItem()​

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

Defined in: postgres/src/dialect.ts:126

Parameters​

attr​

string

itemParam​

number

index​

number | undefined

updateDate​

string

Returns​

string

Implementation of​

SQLDialect.setCollectionItem


shallowMerge()​

shallowMerge(json, patch, args): string

Defined in: postgres/src/dialect.ts:104

Parameters​

json​

string

patch​

Record<string, any>

args​

any[]

Returns​

string

Implementation of​

SQLDialect.shallowMerge


typedAttribute()​

typedAttribute(text, json, type): string

Defined in: postgres/src/dialect.ts:56

Parameters​

text​

string

json​

string

type​

"number" | "boolean"

Returns​

string

Implementation of​

SQLDialect.typedAttribute


withStoredType()​

withStoredType(json, type): string

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

Parameters​

json​

string

type​

string

Returns​

string

Implementation of​

SQLDialect.withStoredType