Skip to main content

StoreParameters

@webda/core


Class: StoreParameters

Defined in: packages/core/src/stores/store.ts:264

Internal

Store parameter

— Store configuration schema. Authored in webda.config/deployment files; not consumed by app code directly.

Extends​

Extended by​

Constructors​

Constructor​

new StoreParameters(): StoreParameters

Returns​

StoreParameters

Inherited from​

ServiceParameters.constructor

Properties​

aggregationFallback?​

optional aggregationFallback?: "allow" | "warn" | "deny"

Defined in: packages/core/src/stores/store.ts:306

What to do when an aggregation on this store cannot run natively and must stream every matching object through memory

Default​

"warn"

maxGroups?​

optional maxGroups?: number

Defined in: packages/core/src/stores/store.ts:313

Maximum number of groups an aggregation may produce without LIMIT (or in memory)

Minimum​

1

Default​

10000

models?​

optional models?: string[]

Defined in: packages/core/src/stores/store.ts:270

Models managed by this Store.

Default​

["Webda/RegistryEntry"]

noCache?​

optional noCache?: boolean

Defined in: packages/core/src/stores/store.ts:332

Disable default memory cache


slowQueryLogLevel?​

optional slowQueryLogLevel?: WorkerLogLevel

Defined in: packages/core/src/stores/store.ts:293

Log level used for slow queries

Default​

"WARN"

slowQueryMaxLength?​

optional slowQueryMaxLength?: number

Defined in: packages/core/src/stores/store.ts:299

Maximum length of the query string written to logs / events (longer queries are truncated)

Default​

1024

slowQueryThreshold?​

optional slowQueryThreshold?: number

Defined in: packages/core/src/stores/store.ts:287

Duration in ms above which a query is considered slow. Set to 0 to disable slow query detection.

Default​

30000

strict?​

optional strict?: boolean

Defined in: packages/core/src/stores/store.ts:280

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

type​

type: string

Defined in: packages/core/src/services/serviceparameters.ts:10

Type of the service

Inherited from​

ServiceParameters.type


typeCheck?​

optional typeCheck?: object

Defined in: packages/core/src/stores/store.ts:317

Startup check of the stored types: one WARN listing the legacy, untyped and unknown types found

enabled?​

optional enabled?: boolean

Default​
true

maxRows?​

optional maxRows?: number

Rows scanned at most by stores without a native count; beyond, the counts are "at least"

Default​
10000

Methods​

load()​

load(params): StoreParameters

Defined in: packages/core/src/stores/store.ts:339

Load store parameters with defaults for models, strict mode and the startup type check

Parameters​

params​

any

the service parameters

Returns​

StoreParameters

the result

Overrides​

ServiceParameters.load


update()​

update(params?, delta): this

Defined in: packages/core/src/application/parameters.ts:33

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​

ServiceParameters.update


with()​

with(callback): this

Defined in: packages/core/src/application/parameters.ts:63

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

Inherited from​

ServiceParameters.with