mauricio / postgresql-async

Async, Netty based, database drivers for PostgreSQL and MySQL written in Scala
Apache License 2.0
1.43k stars 222 forks source link

mysql-async : What is mysql JSON data type in Scala ? #208

Open sm-tester opened 7 years ago

sm-tester commented 7 years ago

Hi @mauricio !

This is a question, I have mysql JSON data type in my "notifications" table and What is type need use for parsing JSON type in mysql-async library. Please help me

SeanSWatkins commented 7 years ago

Seems to give a MatchError when using a JSON type, according to the mysql documentation it's just a string once queried from the db. A temp work around is to cast it to a string using the following: CAST(jsonColumnName AS CHAR) as 'json_string'

Or something of the sort

sm-tester commented 7 years ago

Yes you are right, problem with parsing. I changed JSON data type to TEXT and solved problem