IF Commons GitHub

sql/extensions/safety/locks

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0015-sql-safety FR-008, 0015-sql-safety FR-009

Lock discipline (commons data 0015-sql-safety FR-008, FR-009): a step that changes a table asks for its locks with a timeout and runs with a limit, the run tries it again when the engine gives up on a lock, and a constraint is added without checking the rows that are there and checked in a statement of its own, so that the strongest lock is held for a short time.

Source: commons/data/sql/extensions/safety/locks.ts

0 of 3 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

lockRetryfunctionno test imports it
function lockRetry(dialect: Dialect, settings: Safety): { readonly attempts: number; readonly delayMs: number; readonly when: (message: string) => boolean; } | undefined

What execute is given to try a step again when the engine gives up on a lock.

ParameterWhat it is
dialectthe dialect
settingsthe settings

Returns: the retry, or none where the dialect has no locks with a timeout or the feature is off

lockTimeoutsfunctionno test imports it
function lockTimeouts(settings: Safety): StepTransform

The transform that asks for locks with a timeout.

validateLaterfunctionno test imports it
function validateLater(settings: Safety): StepTransform

The transform that adds a foreign key or a check without checking the rows and then checks them.

Titles, headings, exports, tables, columns and requirements. Esc closes.