PostgresRelationalParameters
Class: PostgresRelationalParameters
Defined in: packages/postgres/src/postgresrelationalstore.service.ts:27
Parameters of the relational store: those of PostgresStore plus the schema layout and lifecycle
Extends
Implements
RelationalLayoutParameters
Constructors
Constructor
new PostgresRelationalParameters():
PostgresRelationalParameters
Returns
PostgresRelationalParameters
Inherited from
PostgresParameters.constructor
Properties
aggregationFallback?
optionalaggregationFallback?:"allow"|"warn"|"deny"
Defined in: packages/core/lib/stores/store.d.ts:281
What to do when an aggregation on this store cannot run natively and must stream every matching object through memory
Default
"warn"
Inherited from
PostgresParameters.aggregationFallback
allowIncompatible?
optionalallowIncompatible?:string[]
Defined in: packages/postgres/src/postgresrelationalstore.service.ts:76
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
[]
Implementation of
RelationalLayoutParameters.allowIncompatible
appVersion?
optionalappVersion?:string
Defined in: packages/postgres/src/postgresrelationalstore.service.ts:70
Version of the application recorded in the Webda/SchemaVersion registry
Default
the version of package.json
Implementation of
RelationalLayoutParameters.appVersion
autoCreateTable?
optionalautoCreateTable?:boolean
Defined in: packages/sql/lib/store.d.ts:22
Auto create tables if they do not exist
Default
true
Inherited from
PostgresParameters.autoCreateTable
columnNaming?
optionalcolumnNaming?:"preserve"|"snake_case"
Defined in: packages/postgres/src/postgresrelationalstore.service.ts:43
preserve keeps the field names as column names (quoted camelCase), snake_case converts them
Default
"preserve"
Implementation of
RelationalLayoutParameters.columnNaming
database?
optionaldatabase?:SQLDatabase
Defined in: packages/sql/lib/store.d.ts:17
Database
Inherited from
extraColumn?
optionalextraColumn?:string|false
Defined in: packages/postgres/src/postgresrelationalstore.service.ts:48
JSON column keeping the properties the model schema does not declare, false to refuse them
Default
"_extra"
Implementation of
RelationalLayoutParameters.extraColumn
foreignKeys?
optionalforeignKeys?:boolean
Defined in: packages/postgres/src/postgresrelationalstore.service.ts:53
Create foreign key constraints between the tables of the store
Default
true
Implementation of
RelationalLayoutParameters.foreignKeys
foreignKeysToJsonb?
optionalforeignKeysToJsonb?:boolean
Defined in: packages/postgres/src/postgresrelationalstore.service.ts:59
Also create a foreign key to the uuid column of the JSONB table of a model served by a PostgresStore (the
Registry) on the same server and database with a table per model; the JSONB table is created at init()
Default
false
Implementation of
RelationalLayoutParameters.foreignKeysToJsonb
maxGroups?
optionalmaxGroups?:number
Defined in: packages/core/lib/stores/store.d.ts:288
Maximum number of groups an aggregation may produce without LIMIT (or in memory)
Minimum
1
Default
10000
Inherited from
models?
optionalmodels?:string[]
Defined in: packages/core/lib/stores/store.d.ts:246
Models managed by this Store.
Default
["Webda/RegistryEntry"]
Inherited from
noCache?
optionalnoCache?:boolean
Defined in: packages/core/lib/stores/store.d.ts:308
Disable default memory cache
Inherited from
numericAsDecimal?
optionalnumericAsDecimal?:boolean
Defined in: packages/postgres/src/postgresrelationalstore.service.ts:64
Store JSON number fields as NUMERIC instead of DOUBLE PRECISION
Default
false
Implementation of
RelationalLayoutParameters.numericAsDecimal
postgresqlServer?
optionalpostgresqlServer?:ClientConfig|PoolConfig
Defined in: packages/postgres/src/postgresstore.service.ts:43
By default use environment variables
Can be encrypted with webda config encrypt
Secret
password,connectionString
Inherited from
PostgresParameters.postgresqlServer
schemaSync?
optionalschemaSync?:SchemaSyncMode
Defined in: packages/postgres/src/postgresrelationalstore.service.ts:38
What init() does with the database schema
none: nothingcreate: create the missing tables, with their indexes and foreign keysalter:create, plus add the missing columns, indexes and foreign keys of the existing tables (never drops, narrows or setsNOT NULL)validate: write nothing, fail when anything is missing or differs
Default
"create"
Implementation of
RelationalLayoutParameters.schemaSync
slowQueryLogLevel?
optionalslowQueryLogLevel?:WorkerLogLevel
Defined in: packages/core/lib/stores/store.d.ts:268
Log level used for slow queries
Default
"WARN"
Inherited from
PostgresParameters.slowQueryLogLevel
slowQueryMaxLength?
optionalslowQueryMaxLength?:number
Defined in: packages/core/lib/stores/store.d.ts:274
Maximum length of the query string written to logs / events (longer queries are truncated)
Default
1024
Inherited from
PostgresParameters.slowQueryMaxLength
slowQueryThreshold?
optionalslowQueryThreshold?:number
Defined in: packages/core/lib/stores/store.d.ts:262
Duration in ms above which a query is considered slow. Set to 0 to disable slow query detection.
Default
30000
Inherited from
PostgresParameters.slowQueryThreshold
strict?
optionalstrict?:boolean
Defined in: packages/core/lib/stores/store.d.ts:255
Allow to load object that does not have the type data
If set to true, then the Store will only managed the defined _model and no model extending this one
Default
false
Inherited from
table?
optionaltable?:string
Defined in: packages/sql/lib/store.d.ts:13
The table of every model of the store, subclasses and models routed to this store as fallback included (the Webda 3 layout). Without it each model gets its own table (its identifier lowercased with "/" → "_").
Implementation of
RelationalLayoutParameters.table
Inherited from
tables?
optionaltables?:object
Defined in: packages/sql/lib/store.d.ts:27
Per-model table name overrides. Maps a model identifier (e.g. "Webda/User") to a custom table name.
Index Signature
[modelIdentifier: string]: string
Implementation of
RelationalLayoutParameters.tables
Inherited from
transaction?
optionaltransaction?:SQLTransactionMode
Defined in: packages/sql/lib/store.d.ts:38
Wrap all statements of an operation in a single transaction
- "none": autocommit per statement
- "operation": BEGIN on the first statement of an operation, COMMIT when the operation succeeds, ROLLBACK when
it fails. Nested operations join the outermost one;
transaction: falseon an operation opts it out.
Default
"none"
Inherited from
PostgresParameters.transaction
transactionIsolation?
optionaltransactionIsolation?:PostgresIsolationLevel
Defined in: packages/postgres/src/postgresstore.service.ts:63
Isolation level of the transactions (transaction: "operation" and withTransaction)
Default
"READ COMMITTED"
Inherited from
PostgresParameters.transactionIsolation
type
type:
string
Defined in: packages/core/lib/services/serviceparameters.d.ts:9
Type of the service
Inherited from
typeCheck?
optionaltypeCheck?:object
Defined in: packages/core/lib/stores/store.d.ts:292
Startup check of the stored types: one WARN listing the legacy, untyped and unknown types found
enabled?
optionalenabled?:boolean
Whether enabled is enabled
Default
true
maxRows?
optionalmaxRows?:number
Rows scanned at most by stores without a native count; beyond, the counts are "at least"
Default
10000
Inherited from
usePool?
optionalusePool?:boolean
Defined in: packages/postgres/src/postgresstore.service.ts:36
Use a shared pool of connections rather than a single client: required by transaction: "operation"
Default
false
Inherited from
versionHeartbeat?
optionalversionHeartbeat?:number
Defined in: packages/postgres/src/postgresrelationalstore.service.ts:81
Seconds between two heartbeats of the version in the registry, 0 for none
Default
60
Implementation of
RelationalLayoutParameters.versionHeartbeat
versionTtl?
optionalversionTtl?:number
Defined in: packages/postgres/src/postgresrelationalstore.service.ts:86
Seconds after its last heartbeat a version still counts as live
Default
600
Implementation of
RelationalLayoutParameters.versionTtl
viewPrefix?
optionalviewPrefix?:string
Defined in: packages/postgres/src/postgresstore.service.ts:52
View name prefix
Default
""
Pattern
/^[a-zA-Z_][a-zA-Z0-9_]*$/
Examples
"app_"
"v_"
"view_"
Inherited from
views?
optionalviews?:string[]
Defined in: packages/postgres/src/postgresstore.service.ts:58
Regexp patterns of model identifiers to include when generating views
Default
[".*"]
Inherited from
Methods
load()
load(
params):this
Defined in: packages/postgres/src/postgresrelationalstore.service.ts:93
Parameters
params
any
raw parameters
Returns
this
this
Overrides
update()
update(
params,delta):this
Defined in: packages/core/lib/application/parameters.d.ts:21
Update parameters and call watchers if a parameter was changed
Parameters
params
any
the service parameters
delta
any
the delta
Returns
this
this for chaining
Inherited from
with()
with(
callback):this
Defined in: packages/core/lib/application/parameters.d.ts:27
Watch for changes on the parameters and call watchers when a parameter is changed
Parameters
callback
(params) => void
the callback function
Returns
this
this for chaining