You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for newer JS Types (bigint, temporal, etc) #14296
With the arrival of new built-in JavaScript types like BigInt, and Temporal, we need to provide a way to tell Sequelize to use these types instead of the currently used string and Date.
Such a mechanism would allow users to easily migrate to these new types without creating a very large breaking change.
Proposed solution
My idea is to add a new option to the different DataTypes: jsType (e.g. jsType: 'string', jsType: 'bigint'). This option would tell Sequelize which built-in JS type should be used when retrieving an attribute from the database.
In the following example, id is declared as bigint in the database table, but will be represented as a string in JS.
side note: jsType: 'bigint' is likely to become the default setting for this data type, in a future major release.
This only impacts how Sequelize casts the values that come from the database. You can still set the value to a string yourself, this will continue functioning.
List of valid jsType values per Data type
if the data type is not listed, it doesn't accept this option.
This issue has been automatically marked as stale because it has been open for 14 days without activity. It will be closed if no further activity occurs within the next 14 days. If this is still an issue, just leave a comment or remove the "stale" label. 🙂
changed the title [-][RFC] Add support for newer JS Types (bigint, temporal, etc)[/-][+]Add support for newer JS Types (bigint, temporal, etc)[/+]on Mar 9, 2025
Activity
[-][RFC] Support for Alternative JS Types[/-][+][RFC] Add support for Alternative JS Types[/+][-][RFC] Add support for Alternative JS Types[/-][+][RFC] Add support for newer JS Types (bigint, temporal, etc)[/+]github-actions commentedon Apr 14, 2022
This issue has been automatically marked as stale because it has been open for 14 days without activity. It will be closed if no further activity occurs within the next 14 days. If this is still an issue, just leave a comment or remove the "stale" label. 🙂
feat: support using JS BigInt in queries (#14485)
feat: support using JS BigInt in queries (sequelize#14485)
QuentinFarizon commentedon Oct 30, 2023
Hello @ephys I'd like to help by tackling this feature. Is it ready to work on ?
[-][RFC] Add support for newer JS Types (bigint, temporal, etc)[/-][+]Add support for newer JS Types (bigint, temporal, etc)[/+]