Skip to content

Introspect live ferro-owned CHECKs #342

Description

@0x054

Part of #339

Parent

#339 — table checks (named multi-column CHECK), auto-migrated

What to build

Ferro can read live ferro-owned ck_* CHECK constraints from the database: name plus definition. Postgres via catalog / pg_get_constraintdef; SQLite for CHECKs that were created inline with the table.

Tests may plant SQL. This ticket does not need the Check Python API and does not add, drop, or rebuild constraints.

Acceptance criteria

  • Introspecting a Postgres table returns each ck_* CHECK with its name and definition.
  • Non-ck_* CHECKs are visible enough to ignore later (user-owned) — they are not treated as ferro-owned.
  • SQLite introspection returns inline table CHECKs that were part of CREATE TABLE, or documents clearly if a given SQLite version cannot name them — either way, not silent.
  • A planted ck_<table>_<suffix> CHECK round-trips name + definition in tests without going through the ORM declaration API.

Blocked by

#340 — table-check IR, names, and canonical renderer

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions