ReferenceIndividual lint rules
Required CHECK constraints
Require at least one CHECK constraint or specific names on selected tables.
Evaluates the available table and constraint evidence. Without names, any existing CHECK declaration satisfies the rule even when its name is unknown. It reports a coverage gap when inventory is unavailable or when a configured name cannot be verified.
Enable this opt-in rule under lint.rules.
Configuration
import { defineConfig } from '@mwillbanks/zenstack-zenlev'
export default defineConfig({
lint: {
rules: {
'zenlev/constraints/required-check': [
'error',
{ include: ['app.orders'], names: ['orders_total_nonnegative'] },
],
},
},
})Parameters
names lists required name patterns. Omit it to require at least one check of any name. Shared selectors match tables.
All built-in rules accept the shared selectors.
Example
Add CONSTRAINT orders_total_nonnegative CHECK (total_cents >= 0) to app.orders.