Creating a Table with a reserved work breaks when deleting.

Issue #55 resolved
Seth Valdetero created an issue

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)

  1. Guillermo Gutiérrez

    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.

  2. Guillermo Gutiérrez

    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.

  3. Guillermo Gutiérrez
    • changed status to open

    I've been checking the SQLite-Net source code and it's prepared to use reserved words as table names.

  4. Guillermo Gutiérrez

    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

  5. Log in to comment