-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Escaping causes check statement to fail #686
Comments
I think you have to use |
@tyt2y3 Thank you for the quick response, I didn't know about Not sure if this is a bug or not, feel free to close this if it is intended to behave like this. |
Okay I found the context sea-query/tests/mysql/table.rs Lines 352 to 365 in 336bf95
|
So you can actually .check(Expr::col(User::Email).binary(PgBinOper::RegexCaseInsensitive, Expr::value("^[^@]+@[^@]+\\.[^@]+$")) |
We should add an example though. |
Description
In a migration for PostgreSQL I have some code like this:
This is the SQL that gets produced:
The error is:
I tried changing the way I express the check but I could not find a way to make it work, there is always some escaping problem.
This is what would work instead:
Workarounds
Current workaround is to add the check as a separate sql statement bypassing seaorm.
Versions
sea-orm: 0.12.2
sea-orm-migration: 0.12.2
db: postgres
OS: Win11
The text was updated successfully, but these errors were encountered: