Creating a Table with a reserved work breaks when deleting.
I created an entity named Group. When I try to delete any "group" object, I get a syntax error. It took me several days to figure out this was the issue. All other functions seem to work ok.
I'm not doing anything special with the delete:
public void DeleteItem(object item)
{
lock (locker)
{
database.Delete(item, true);
}
}
Where database is a SQLiteConnection object.
Comments (7)
-
-
reporter I thought it was the way that you were generating the queries.
-
reporter - changed status to invalid
Limitation of SQLite.
-
I've seen that we're not quoting table names in plain sql queries. I'll take a look tomorrow to check if that fixes the issue.
-
- changed status to open
I've been checking the SQLite-Net source code and it's prepared to use reserved words as table names.
-
- changed status to resolved
Added support for reserved words in column names and table names. Fixes
#55→ <<cset 9f0833a3c3e3>>
-
I've added support for reserved words in column names and table names. Sadly, SQLite-Net only supports reserved words in table names.
This is the
Update
statement:update "{0}" set {1} where {2} = ?
. As you can see only the table name is quoted, and the column names are not escaped.If you need support for columns with reserved word names, I'd recommend you to open a bug report in the SQLite-Net project.
Kind regards
- Log in to comment
You cannot use any SQL selected word as table or column names. Change the table name to any other using
Table
attribute.This is a SQLite.Net limitation. There's nothing we can do about it.