Skip to content

Check entity to meet SQL Strict mode requirements #31

@Arilas

Description

@Arilas

Starting from MySQL 5.7 server returns errors when there's no value provided for NOT NULL field without defaultValue.

Big projects, that are upgrading source code to newer versions need to fix this errors, but if they're disabling Strict mode (temporally) they're not see this errors.

When NODE_ENV is not production we can use console.warn with message like:

[SQL Strict Mode Notice] This insert to ${tableName} can fail. Field ${fieldName} should have either value or have default value in field description or be nullable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions