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

Lower and trim flags to be added in models field options #17193

Open
4 of 8 tasks
prince-bansal opened this issue Mar 23, 2024 · 1 comment
Open
4 of 8 tasks

Lower and trim flags to be added in models field options #17193

prince-bansal opened this issue Mar 23, 2024 · 1 comment
Labels
type: feature For issues and PRs. For new features. Never breaking changes.

Comments

@prince-bansal
Copy link

Issue Creation Checklist

  • I understand that my issue will be automatically closed if I don't fill in the requested information
  • I have read the contribution guidelines

Feature Description

Describe the feature you'd like to see implemented

Having a check inside model field options to store data in lowercase and trimmed. These are some common use cases and one should not required to use a setter for every field

Example:

email:{
    type: Sequelize.STRING,
    trim: true, // FLAG
    lower: true, // FLAG
    allowNuLll:false
}

Describe why you would like this feature to be added to Sequelize

Is this feature dialect-specific?

  • No. This feature is relevant to Sequelize as a whole.
  • Yes. This feature only applies to the following dialect(s):

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I will need guidance.
  • No, I don't have the time, but my company or I are supporting Sequelize through donations on OpenCollective.
  • No, I don't have the time, and I understand that I will need to wait until someone from the community or maintainers is interested in implementing my feature.

Indicate your interest in the addition of this feature by adding the 👍 reaction. Comments such as "+1" will be removed.

@prince-bansal prince-bansal added pending-approval Bug reports that have not been verified yet, or feature requests that have not been accepted yet type: feature For issues and PRs. For new features. Never breaking changes. labels Mar 23, 2024
@ephys
Copy link
Member

ephys commented Mar 23, 2024

We intend on expanding the validation API (#15497) to support more validation libraries like Joi, Zod, etc. These libraries include features like lowercasing and trimming so this feature request could be covered by them

@ephys ephys removed the pending-approval Bug reports that have not been verified yet, or feature requests that have not been accepted yet label Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature For issues and PRs. For new features. Never breaking changes.
Projects
None yet
Development

No branches or pull requests

2 participants