Ir al contenido
#0303
ExecSqlite

The data-quality check runs before the row exists

Twenty pipelines from six teams write to the shared warehouse over the hoody-sqlite API. Once a month someone inserts cents into a dollars column, and you find out three dashboards later.

You register a proxy hook on the sqlite service: match POST on /api/v1/sqlite/db*, route to /guard in your exec instance. Every write now passes through your script before the service sees it. The script parses the transaction, checks amount values against the column's known range, rejects outliers with a 422 and a reason, and calls metadata.hook.forward() for everything clean.

The writing teams changed nothing. Their URLs are the same. The bad row never existed, so there's nothing to back out and nothing to reconcile.

Validation used to live in twenty codebases or in nobody's. Now it lives in front of the database.

The schema guards the shape. The hook guards the meaning.