Open zkavtaskin opened 10 years ago
I think it isnt recommendable to use reserved words. Am I wrong?
Infrastructure (ORM i.e. Persistence) should not dictate to the business logic / domain layer how it should name it's entities or properties. Infrastructure is the servant not other way round. Besides the fix for this is really simple and all popular ORM frameworks do it i.e. Hibernate, Entity Framework, etc.
Edit: I am not even going to mention security, command conflicts and versioning.
I tend to agree with @zkavtaskin here. The framework should not be a limiting factor. Though, practically, we tend to stay away from reserved keywords to avoid any issues later. We should however have that fix in place.. thanks for pointing that out.
05-20 17:24:51.757: E/AndroidRuntime(1655): java.lang.RuntimeException: Unable to start activity android.database.sqlite.SQLiteException: near "EXISTS": syntax error (code 1): , while compiling: CREATE TABLE SOMETHING ( ID INTEGER PRIMARY KEY AUTOINCREMENT , DATE_CREATED INTEGER, OTHER TEXT, EXISTS INTEGER, SYNCED INTEGER, OTHER2 TEXT, STUFF INTEGER, COUNTER INTEGER )
Please update query generator to take in to account SQLite Keywords. http://www.sqlite.org/lang_keywords.html
I.e.
CREATE TABLE SOMETHING ( [ID] INTEGER PRIMARY KEY AUTOINCREMENT , [DATE_CREATED] INTEGER, [OTHER] TEXT, [EXISTS] INTEGER, [SYNCED] INTEGER, [OTHER2] TEXT, [STUFF] INTEGER, [COUNTER] INTEGER )