Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Table CHECK Constraints #397

Closed
billy1624 opened this issue Jul 26, 2022 Discussed in #135 · 13 comments · Fixed by #542 or #567
Closed

Support Table CHECK Constraints #397

billy1624 opened this issue Jul 26, 2022 Discussed in #135 · 13 comments · Fixed by #542 or #567
Assignees
Labels
good first issue Good for newcomers
Milestone

Comments

@billy1624
Copy link
Member

Discussed in #135

Originally posted by forrest-akin August 3, 2021
Currently, there's no way to specify table CHECK constraints in TableCreateStatements. Adding an .extra() method similar to ColumnDef would probably be the easiest way to add support for this.

@billy1624
Copy link
Member Author

@billy1624
Copy link
Member Author

I'll open this issue for contributions

@billy1624 billy1624 added the good first issue Good for newcomers label Jul 26, 2022
@nahuakang
Copy link
Contributor

👋 Hey @billy1624! Happy to claim this if it's okay with you!

@ikrivosheev
Copy link
Member

wave Hey @billy1624! Happy to claim this if it's okay with you!

Done!

@Razican
Copy link

Razican commented Oct 20, 2022

@nahuakang is there any news with this?

@nahuakang
Copy link
Contributor

@Razican Sorry I haven't had the time to got around to this issue. Are you interested in taking it? If so, please do :) I probably will only come back to this in 2-3 weeks earliest.

@ikrivosheev ikrivosheev added this to the 0.28.x milestone Oct 21, 2022
@LemarAb
Copy link
Contributor

LemarAb commented Oct 30, 2022

Id be happy to give it a go :)

@ikrivosheev ikrivosheev assigned LemarAb and unassigned nahuakang Oct 31, 2022
@ikrivosheev
Copy link
Member

@LemarAb hello! Any updates?)

@LemarAb
Copy link
Contributor

LemarAb commented Nov 25, 2022

@ikrivosheev I made some progress but need some time to deeper understand how sea query translates the stmt into SQL. Will report soon. If necessary, can I ask you for help?

@ikrivosheev
Copy link
Member

@ikrivosheev I made some progress but need some time to deeper understand how sea query translates the stmt into SQL. Will report soon. If necessary, can I ask you for help?

Take your time! Yes, of course you can)

@LemarAb
Copy link
Contributor

LemarAb commented Nov 27, 2022

Just to clarify: CHECK constraints on Columns are already supported through the extra() method. We want to add CHECK constraints for the whole table, right? As an example for Postgres:

CREATE TABLE products (
    price integer CHECK(product_no > 0),
    discounted_price integer,
    CONSTRAINT valid_discount CHECK (product_no > discounted_price)
);

We want to add support for the second constraint, the first is already supported, correct?

@ikrivosheev

@ikrivosheev
Copy link
Member

ikrivosheev commented Nov 28, 2022

@LemarAb we want to add the ability to add CHECK constraint using SeaQuery, without extra method.

It will great if we can both)

@LemarAb
Copy link
Contributor

LemarAb commented Nov 28, 2022

@ikrivosheev ok, so afaik we need to add check() to ColumnDef and to table/create ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Archived in project
5 participants