iosobjective-csqlitecore-dataencrypted-core-data-sql

SQLite syntax error with Encrypted-Core-Data


I've been running into a syntax error for a very long time now and I am unsure as to what could be causing it. The debug log is as follows:

SQL DEBUG: SELECT ecdImages.checkSum, ecdImages.creationDate, ecdImages.filename, ecdImages.height, ecdImages.latitude, ecdImages.locationString, ecdImages.longitude, ecdImages.order, ecdImages.photoId, ecdImages.photoLogValues, ecdImages.requiresDeletion, ecdImages.requiresUpload, ecdImages.rotationAngle, ecdImages.scale, ecdImages.source, ecdImages.timestamp, ecdImages.title, ecdImages.transform, ecdImages.width, ecdImages.x, ecdImages.y, ecdImages.book__objectid, ecdImages.page__objectid FROM ecdImages WHERE ecdImages.__objectid=?;

could not prepare statement: near "order": syntax error

Order is of type Integer 16 and for your reference, I am currently using Encrypted-Core-Data as found on github. Any thoughts?


Solution

  • As pointed out by CL in the comments, I was using a reserved keyword. Refer to SQLite Keywords.