You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gen-sqlvalidation rules: not inherited, lost on abstract classes and mixins, value_presence unsupported #44
Run gen-sqlvalidation --no-include-comments schema.yaml, then run the output on SQLite tables created with gen-sqltables.
Concrete P: there is only a FROM "P" rule query, so row C(guard='g', target='y') is not reported.
Abstract or mixin P: there is no rule query at all, although tables P and C exist.
Precondition guard: {value_presence: PRESENT}: the rule is skipped with "preconditions exist but produced no SQL conditions".
Precondition {guard: {value_presence: ABSENT}, kind: {equals_string: k}}: the query is WHERE kind = 'k' AND (target != 'x' OR target IS NULL), with no warning. A row with guard set is reported, which is a false positive.
References
Metamodel rules: "the collection of rules that apply to all members of this class".
For every non-abstract, non-mixin class, collect rules from class_ancestors(class_name) (mixins included), and translate them against that class's table and columns.
Translate value_presence: PRESENT / ABSENT as IS NOT NULL / IS NULL, negated in postconditions.
When any condition can't be translated, skip the rule with a warning instead of dropping that condition.
Acceptance criteria
SQLite-executed tests cover:
the concrete-parent, abstract-parent and mixin cases;
value_presence in both pre- and postconditions;
a mixed precondition with an untranslatable operator.
changed the title [-]gen-sqlvalidation rules: not inherited, lost on abstract classes, value_presence preconditions unsupported[/-][+]gen-sqlvalidation rules: not inherited, lost on abstract classes and mixins, value_presence unsupported[/+]on Oct 6, 2026
Activity
[-]gen-sqlvalidation rules: not inherited, lost on abstract classes, value_presence preconditions unsupported[/-][+]gen-sqlvalidation rules: not inherited, lost on abstract classes and mixins, value_presence unsupported[/+]