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 for CHECK constraints #358
Comments
This goes beyond the I haven't used these myself, do you have any |
I'm using them myself for the first time as well, this is a tutorial of how to use (and change) them in sqlite: https://www.sqlitetutorial.net/sqlite-check-constraint/ |
I've been thinking about this more recently. I think the first place to explore these will be in the Relevant docs: https://www.sqlite.org/lang_createtable.html#check_constraints
Something like this:
Where Then can bundle a bunch of other pre-baked recipes, but also support the following:
The besign reason for the Detecting |
Quick demo of a check constraint for JSON validation:
|
A few other recipes off the top of my head:
|
Make me think also that |
HI Simon, looks good, I noticed you wanted to use a regex to detect it, you might be interested in github.com/iafisher/sqliteparser which creates an ast of the create table statement, not every option supported yet but i forked it and am adding all the possible options in a create table (and create index) statement. |
Hi,
I noticed the
transform.table()
method doesn't have an option to add/change or drop a check constraint (see https://sqlite.org/lang_createtable.html -> 3.7 Check Constraints. would be great to have this as an option!The text was updated successfully, but these errors were encountered: