Skip to content

Sqlite parse error on VIRTUAL constraint #917

Closed

Description

@bagage

Useful extra information

Similarly to #505, it looks like Sqlite has an issue when opening a database with VIRTUAL tables:

Sqlite parse error:  "line 1:8: unexpected token: VIRTUAL" ( "CREATE VIRTUAL TABLE TokenizerTable USING fts3tokenize(\n                    unicodesn,\n                    \"stemmer=french\"\n                )" )
Sqlite parse error:  "line 1:8: unexpected token: VIRTUAL" ( "CREATE VIRTUAL TABLE MessageSearchTable USING fts4(\n    body,\n    attachment,\n    subject,\n    from_field,\n    receivers,\n    cc,\n    bcc,\n    \n    tokenize=simple,\n    prefix=\"2,4,6,8,10\"\n)" )

This seems to have no effect though except of this in logs. This is a Geary mail-client database, if needed.

I'm opening this issue because:

  • DB4S is crashing
  • DB4S has a bug - or at least some strange logs…
  • DB4S needs a feature
  • DB4S has another problem

I'm using DB4S on:

  • Windows: ( version: ___ )
  • Linux: ( _distro: Debian unstable)
  • Mac OS: ( version: ___ )
  • Other:

I'm using DB4S version:

  • 3.9.1
  • 3.9.0
  • Other: git master

I have also:

Activity

  1. justinclift commented on Dec 29, 2016

    @justinclift
    Member

    Ahhh, that might be our grammar parser needing work then.

    @MKleusberg Your kind of thing?

  2. added
    bugConfirmed bugs or reports that are very likely to be bugs.
    on Dec 29, 2016
  3. MKleusberg commented on Dec 29, 2016

    @MKleusberg
    Member

    Yes! I'm referencing our help-wanted issue #741 here, just because that's exactly the kind of issue I was thinking about back then 😃

  4. ghellquist commented on Dec 31, 2016

    @ghellquist

    Hi! I can see that the word VIRTUAL is not part of the list of tokens in sqlite3.g. This probably (have a bit of work to do until I understand things fully) is the reason it is not understood.

    To the people that has coded this: is this a conscious design decision, or simply a missed detail? I can do a bit of testing to see if I can update the grammar with the full language description in the next few days (have a little bit of time available).

  5. MKleusberg commented on Jan 3, 2017

    @MKleusberg
    Member

    @ghellquist Feel free to play around with this! 😃 We highly appreciate any help in coding!

    I've started playing around with this a couple of days ago, too, and it looks like this is a bit more difficult. In the grammar file you'll need to add the VIRTUAL and the USING keyword, but also add some branch for parsing the slightly different syntax of those virtual tables. In our grammar code (in src/sqlitetypes.cpp) there's more work to be done, though, to actually interpret and store the new information.

  6. MKleusberg commented on Jan 5, 2017

    @MKleusberg
    Member

    I have added basic support for virtual tables to the grammar parser. It's still a long way to go from here because browsing and editing those tables still doesn't work as expected. But at least the Sqlite parse error is gone. You can check out the latest version in master and test yourself. And there's still a lot of work to do for better support of virtual tables, so I still want to encourage you to look into this 😃 If you need any help just post here, write me an email, or post on Gitter.

  7. ghellquist commented on Jan 5, 2017

    @ghellquist
  8. added a commit that references this issue on Jan 20, 2017
  9. MKleusberg commented on Jan 20, 2017

    @MKleusberg
    Member

    I've just added some code that should make it possible to browse virtual tables. Depending on the virtual table function it should also be possible to add and remove rows and edit cell values. The only thing that doesn't really work at all is editing the table schema of virtual tables, but I guess that's fine for now. Are you interested in giving tomorrow's nightly build a test, @ghellquist? I guess if it works for you we can close the issue 😃

  10. MKleusberg commented on Jan 20, 2017

    @MKleusberg
    Member

    Same for you of course, @bagage! 😃 You can check out the latest version from master and compile that again. The warning should disappear and the application should work much better with virtual tables in general.

  11. self-assigned this
    on Jan 20, 2017
  12. MKleusberg commented on Jul 14, 2018

    @MKleusberg
    Member

    Has anybody had any more issues with this? If not, I'd suggest closing the issue 😄

  13. MKleusberg commented on Aug 16, 2018

    @MKleusberg
    Member

    As suggested earlier I'll close this issue then. If you're still having issues with virtual tables you're always welcome to re-open this issue or open a new one and I'll be happy to help 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugConfirmed bugs or reports that are very likely to be bugs.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions