1

I'm using NSBatchInsertRequest to save an array of data to Core Data and the model has an attribute id which is of type UUID. when I attempt to execute the batch insert I get id is not valid error, however when I change the type of id to String everything works fine.

It might worth mentioning that, when I try to save the array one by one without using NSBatchInsertRequest, id being UUID is not an issue.

I was wondering whether it's a known issue or I'm missing something?

Appreciate any guidance!

Edit I: As mentioned in the comment section NSBatchInsertRequest works directly with SQlite and according to this question it is better to save UUID as String

mori_ahk
  • 81
  • 5
  • I don’t really know but the batch insert is executed directly at the Sql level so could it be that SQLite doesn’t support the UUID type? – Joakim Danielson Dec 30 '20 at 22:09
  • I think you are right, I did come across some questions which talked about using UUID in sqlite. I'll link those questions to my post. Thanks! – mori_ahk Dec 31 '20 at 03:27

0 Answers0