oleghnidets / OHMySQL

Swift + MySQL = ❤️
https://oleghnidets.github.io/OHMySQL/documentation/ohmysql/
MIT License
235 stars 42 forks source link

TEXT fields return NSData objects rather than NSString #12

Open EricShapiro opened 6 years ago

EricShapiro commented 6 years ago

What did you do?

Issued a SELECT from a table with TEXT fields

What happened instead?

The TEXT values came back as NSData types

What did you expect?

I expected the fields to be of type NSString. Seems like NSString is the obvious matching for a TEXT field. The field was utf8 encoded in the database.

OHMySQL Environment

Demo Project

Don't have a demo project yet. It's not hard to work-around the issue, but maybe it would be nice to have an option to map TEXT to NSString rather than NSData?

oleghnidets commented 6 years ago

Hi there, Thank you for reporting. I will take a look ASAP as for now I have limited time.

oleghnidets commented 6 years ago

Hi there,

Anyone, take a look at release https://github.com/oleghnidets/OHMySQL/releases/tag/2.1.2

TEXT type is treated as BLOB. Therefore, it is mapped to NSData. Please, consider it in your code.

Anyway I will be looking for better solution.