Skip to content

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

Open
@mhlsf

Description

@mhlsf

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions