Skip to main content

RelationalLayoutParameters

@webda/sql


Interface: RelationalLayoutParameters

Defined in: packages/sql/src/relational/support.ts:31

Parameters every relational store exposes on top of its engine parameters

Properties​

allowIncompatible?​

optional allowIncompatible?: string[]

Defined in: packages/sql/src/relational/support.ts:87

Elements whose blocking changes against a live version are accepted (<table>, <table>.<column>, <model> or <model>.<attribute>): the BLOCK becomes a WARN and the version records it in forced

Default​

[]

appVersion?​

optional appVersion?: string

Defined in: packages/sql/src/relational/support.ts:81

Version of the application recorded in the Webda/SchemaVersion registry

Default​

the version of package.json

columnNaming?​

optional columnNaming?: "preserve" | "snake_case"

Defined in: packages/sql/src/relational/support.ts:47

preserve keeps the field names as column names (quoted camelCase), snake_case converts them

Default​

"preserve"

extraColumn?​

optional extraColumn?: string | false

Defined in: packages/sql/src/relational/support.ts:52

JSON column keeping the properties the model schema does not declare, false to refuse them

Default​

"_extra"

foreignKeys?​

optional foreignKeys?: boolean

Defined in: packages/sql/src/relational/support.ts:57

Create foreign key constraints between the tables of the store

Default​

true

foreignKeysToJsonb?​

optional foreignKeysToJsonb?: boolean

Defined in: packages/sql/src/relational/support.ts:63

Also create a foreign key to the key column of the JSON table of a model served by a JSON store of the same engine (the Registry) on the same database with a table per model; the JSON table is created with the schema

Default​

false

numericAsDecimal?​

optional numericAsDecimal?: boolean

Defined in: packages/sql/src/relational/support.ts:68

Store JSON number fields as decimals instead of doubles

Default​

false

schemaSync?​

optional schemaSync?: SchemaSyncMode

Defined in: packages/sql/src/relational/support.ts:42

What init() does with the database schema

  • none: nothing
  • create: create the missing tables, with their indexes and foreign keys
  • alter: create, plus add the missing columns, indexes and foreign keys of the existing tables (never drops, narrows or sets NOT NULL)
  • validate: write nothing, fail when anything is missing or differs

Default​

"create"

table?​

optional table?: string

Defined in: packages/sql/src/relational/support.ts:76

One shared table (the JSON stores): refused by a relational store


tables?​

optional tables?: object

Defined in: packages/sql/src/relational/support.ts:72

Per-model table name overrides: lowercase identifiers

Index Signature​

[modelIdentifier: string]: string


versionHeartbeat?​

optional versionHeartbeat?: number

Defined in: packages/sql/src/relational/support.ts:92

Seconds between two heartbeats of the version in the registry, 0 for none

Default​

60

versionTtl?​

optional versionTtl?: number

Defined in: packages/sql/src/relational/support.ts:97

Seconds after its last heartbeat a version still counts as live

Default​

600