I am working on one NodeJs application with NodeJS, Sequelize ORM and mysql2 database.
I am creating a model xyz with one field called "text" which should hold HTML values from frontend as its getting values from a text editor in frontend with bold or italic functionalities among many.
What datatype should I assign to this field "text" in Sequelize as I am lost and I searched but could not find.
I think we cannot store that in String.
Cany anyone suggest ?
LONGTEXT is probably excessive -- it allows data sizes up to 4GB.
MEDIUMTEXT allows 16MB.
TEXT allows 64KB.
TINYTEXT allows only 255 characters.
Very few HTML documents are going to be 64KB in size, so a TEXT ought to be suitable for you. If you really want to be safe, go for a MEDIUMTEXT.
Use TEXT datatype for sequelize
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With