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

Add a default guard on data too long for column sql error #205

Open
mhlsf opened this issue Jun 19, 2020 · 0 comments
Open

Add a default guard on data too long for column sql error #205

mhlsf opened this issue Jun 19, 2020 · 0 comments

Comments

@mhlsf
Copy link

mhlsf commented Jun 19, 2020

I made a sql column using the ->string(255) of TdbmFluidSchema.

If I try to insert a value bigger than the max size of the string, I get the expected PDOException : SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'name' at row 1 unless I set a rule in the Model.

Maybe Tdbm should generate a condition to avoid this kind of error by either integrating a validator or proposing an option to automaticaly generate a condition in the model that throw an error message as this can be redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant