Skip to content

feat(validations) Partial rollback of datatype validation by hiding b… - #4604

Merged
janmeier merged 2 commits into
masterfrom
validationsRollback
Oct 8, 2015
Merged

janmeier merged 2 commits into
masterfrom
validationsRollback

Conversation

@janmeier

@janmeier janmeier commented Oct 3, 2015

Copy link
Copy Markdown
Member

…ehind a flag. Soften up some validation and restrict them to insert and create

Adresses #4314

I've hidden the validations behind a flag validations, which is false by default - which menas they are practically rolled back unless the user manually enables them.

Furthermore, I've restricted the validations to only run on insert, bulkinsert and update, not findAll etc. I still believe there would be some merit to validation find query args, but there are also lots of complications, as the issues mentinoed in #4314 show - e.g $in array and $like str%, for uuid etc.

I also refactored bulkInsert into the abstract query generator, since the code was 90% the same for mysql, sqlite and pg

Comment thread lib/data-types.js

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validator is more loose about boolean and decimal like strings

@mickhansen

Copy link
Copy Markdown
Contributor

/cc @defunctzombie

Comment thread lib/sequelize.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps typeValidation and perhaps allow it on model level aswell?
validation is perhaps slightly generic.

@janmeier
janmeier force-pushed the validationsRollback branch from 1d4535b to e45a2a0 Compare October 8, 2015 18:39
Comment thread lib/sequelize.js

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Option changed to typeValidation

…ehind a flag. Soften up some validation and restrict them to insert and create
…ate. Refactor bulk update for mysql, sqlite and pg into abstract qg
@janmeier
janmeier force-pushed the validationsRollback branch from e45a2a0 to d84ae1f Compare October 8, 2015 20:18
janmeier added a commit that referenced this pull request Oct 8, 2015
feat(validations) Partial rollback of datatype validation by hiding b…
@janmeier
janmeier merged commit 46a3cd4 into master Oct 8, 2015
@janmeier
janmeier deleted the validationsRollback branch May 16, 2016 12:18
@damien-git

Copy link
Copy Markdown

This could be better documented, it took me a long time to find this secret typeValidation flag.

@papb

papb commented Nov 16, 2019

Copy link
Copy Markdown
Member

@damien-git can you please open a new docs issue about this, and link to this PR in your issue description? Thanks!

@papb

papb commented Jan 15, 2020

Copy link
Copy Markdown
Member

@damien-git can you please open a new docs issue about this, and link to this PR in your issue description? Thanks!

I did it myself now - #11828

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

Successfully merging this pull request may close these issues.

5 participants