-
-
Notifications
You must be signed in to change notification settings - Fork 625
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
typeCast not supported with .execute #649
Comments
typeCast only documented to work with The aim of With Also I think current api of typeCast is flawed: you as consumer responsible of reading all raw data in full and in correct order. If you miss something everything breaks. |
@sidorares I understand why it's more difficult to do, but the options really should work for both methods... I ultimately had to re-implement typeCast in an abstraction layer that any time .execute is called on my layer, it immediately iterates the fields response and does type conversion. For example, someone decided to use a VARBINARY column type for string keys in order to enforce case sensitivity (very old table before mysql supported this natively), and I now need to convert that to string. A solution is to simply take the fields metadata response, and rebuild the same data structure the .query based call is supplied. |
I'll try to check how easy to do that, maybe actually not that difficult |
This is necessary due to sidorares/node-mysql2#649 We could just cast wherever we call execute, instead of using the typecast option, but this is easier, and we shouldn't really NEED prepared statements (though they would be nice)
I am trying to make Sequelize use binded parameters here. The Sequelize team prefers Also, the overall information returned by the |
Apart from applying timezone, typeCast is also useful to convert geometries to geoJSON format. If it is not possible to add typeCast support for |
I've been using While I'm on the subject, would it be reasonable to have a built-in conversion for |
This comment was marked as resolved.
This comment was marked as resolved.
Closing due to #2398 🎉
|
using typeCast option in .query works, but does not work in .execute. The field is not type casted.
The text was updated successfully, but these errors were encountered: