jakob / jakob/Postico

Check constraint on table rather than a column

Open
#421 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
485
Forks
8
PR merge metrics
No merged PRs in 30d

Description

When you alter a table to add a check constraint that references two columns (e.g. `ADD CONSTRAINT attr_check CHECK(author_id IS NOT NULL OR book_id IS NOT NULL)`)
Postico shows this constraint at a column level associated with the `author_id` column.

Perhaps it would make more sense to have table-level constraints that are listed in their own section. Just like there is a separate Indexes section in the table Structure view, we can have a Constraints section under that: list of Constraint Name, Check Expression.

Edit: And just like we have buttons for +Column and +Index we can have one for +Constraint.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in the table Structure view, comparing how the existing Indexes section and +Column/+Index buttons are represented. Trace how the example CHECK constraint is currently associated with author_id, then make table-level constraints appear in their own Constraints section with the constraint name and check expression; done means the example is no longer shown as a column constraint.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
database, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.