Skip to main content

SchemaSyncHooks

@webda/sql


Interface: SchemaSyncHooks

Defined in: packages/sql/src/relational/manager.ts:25

What runs around the DDL of RelationalSchemaManager.sync: the multi-version registry

Under the schema lock, check runs before the database is described and register after the DDL, so the live versions cannot change between the check and the DDL. A caller that cannot read the registry under the lock (one connection shared with the registry) gives live instead and registers itself afterwards.

Properties​

check?​

optional check?: () => Promise<LiveSchemaPlan[]>

Defined in: packages/sql/src/relational/manager.ts:30

Read the live versions and refuse an incompatible plan

Returns​

Promise<LiveSchemaPlan[]>

the plans of the live versions: their columns are never reported as drift


live?​

optional live?: LiveSchemaPlan[]

Defined in: packages/sql/src/relational/manager.ts:34

The plans of the live versions, when check ran before


register?​

optional register?: () => Promise<void>

Defined in: packages/sql/src/relational/manager.ts:38

Record this version as live, under the lock

Returns​

Promise<void>