sequelize / sequelize/sequelize
Suggestion: Please support DataTypes.UUID.BINARY
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 30.4k
- Forks
- 4.3k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 68
Description
From the documentation
The
CHARandSTRINGtypes expose theBINARYproperty
I think this is also needed for UUID data type so we can store it as BINARy(16) is MySQL.
for example:
sequelize.define('model',` {
uuid: {
type: DataTypes.UUID.BINARY,
defaultValue: DataTypes.UUIDV4,
primaryKey: true
}
})
I could not find any way to map a UUID field to BINARY(16) on MySQL. DataTypes.UUID and DataType.STRING.BINARY give ER_DATA_TOO_LONG error code.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the UUID data type implementation and the MySQL dialect handling for binary types. Reproduce the reported ER_DATA_TOO_LONG error with the example model, then trace how UUID and BINARY types are rendered. Done means UUID.BINARY is supported for MySQL as BINARY(16), with coverage for the resulting definition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, typescript
- Domain
- database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100