Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use rank when fts-table generated with csvs-to-sqlite #527

Closed
clausjuhl opened this issue Jun 24, 2019 · 3 comments
Closed

Unable to use rank when fts-table generated with csvs-to-sqlite #527

clausjuhl opened this issue Jun 24, 2019 · 3 comments

Comments

@clausjuhl
Copy link

Hi Simon.

If i generate a fts-table with the csvs-to-sqlite f-option, I'm unable to use (in datasette's GUI) the internal ranking of the table for sorting or viewing, but if I generate the fts-table with the enable-fts argument from sqlite-utils, everyrthing works ok. Eg.:

datasette, version 0.28
sqlite-utils, version 1.2.1
csvs-to-sqlite, version 0.9

No column named rank with these commands:
$ csvs-to-sqlite minutes.csv minutes.db -f text_data
$ datasette -i minutes.db
select rank, * from minutes_fts where minutes_fts match 'dog'

Everything ok with these commands:
$ csvs-to-sqlite minutes.csv minutes.db
$ sqlite-utils enable-fts minutes.db text_data
$ datasette -i minutes.db
select rank, * from minutes_fts where minutes_fts match 'dog'

Am I doing something wrong?

Thank you for a great application!

@simonw
Copy link
Owner

simonw commented Jun 24, 2019

The select rank, * feature is only available with FTS5 - it won't work with FTS4. So my best guess is that csvs-to-sqlite is setting up FTS with FTS4 when you want FTS5.

... I tested on my own machine and that is indeed what's happening! And in fact it looks like it's a known bug - I should fix that! simonw/csvs-to-sqlite#41

@simonw
Copy link
Owner

simonw commented Jun 24, 2019

Closing in favour of that bug in the csvs-to-sqlite repo.

@simonw simonw closed this as completed Jun 24, 2019
@simonw
Copy link
Owner

simonw commented Jun 24, 2019

I just released csvs-to-sqlite 0.9.1 with this bug fix: https://github.com/simonw/csvs-to-sqlite/releases/tag/0.9.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants