OHMySQL icon indicating copy to clipboard operation
OHMySQL copied to clipboard

TEXT fields return NSData objects rather than NSString

Open EricShapiro opened this issue 6 years ago • 2 comments

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

  • OHMySQL version: 2.1.3 (March 2018)
  • Xcode version: 9.2
  • Swift version: (if applicable, if not remove)
  • Platform(s) running OHMySQL: OSX 10.13.3

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?

EricShapiro avatar May 03 '18 23:05 EricShapiro

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

oleghnidets avatar May 04 '18 06:05 oleghnidets

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.

oleghnidets avatar Jun 11 '18 19:06 oleghnidets