Binary fields in mySQL
I have a schema with ids stored as BINARY (sucks I know). Is it possible to write a plugin to convert them to string when receiving?
Solution:Jump to solution
You can use the
typeCast
config of mysql2
```ts
typeCast: function (field, next) {
if (field.type === 'TINY' && field.length === 1) {...4 Replies
Are you using the built-in
MysqlDialect
?yes
solved it with
passing to createPool options
Solution
You can use the
typeCast
config of mysql2
thanks!