friends-of-reactphp / mysql

Async MySQL database client for ReactPHP.
MIT License
331 stars 66 forks source link

A function to interpret mysql data types. #156

Closed devblack closed 1 year ago

devblack commented 2 years ago

I needed to use the data types of my columns in mysql but they were shown as "string" in each query, so I decided to make this function that converts a limited range of mysql data types to its php interpreter.

Support mysql data types:

SimonFrings commented 2 years ago

Hey @devblack, thanks for bringing this up :+1:

This sounds like a useful addition to the project! There already are constants inside src/Io/Constants.php and I think that 1, 2, 3 etc. aren't meaningful identifiers, maybe we should use the constant names instead. Additionally there are more types than the ones you've mentioned, would it make sense to include them too?

Could you also add some tests to assure that you're changes work as expected?