Skip to content

deterministic=True fails on versions of SQLite prior to 3.8.3 #408

@learning4life

Description

@learning4life

Hi, love your work.

I am unable to lookup indexes in a database using sqlite-utils:

sqlite-utils indexes city_spec.db --table

or

sqlite-utils indexes city_spec.db MyTable

Software
sqlite-utils, version 3.24
sqlite3 --version: 3.36.0

Output:

Traceback (most recent call last):
File "/opt/app-root/bin/sqlite-utils", line 8, in
sys.exit(cli())
File "/opt/app-root/lib64/python3.8/site-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/opt/app-root/lib64/python3.8/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/opt/app-root/lib64/python3.8/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/app-root/lib64/python3.8/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/app-root/lib64/python3.8/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/opt/app-root/lib64/python3.8/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/opt/app-root/lib64/python3.8/site-packages/sqlite_utils/cli.py", line 2123, in indexes
ctx.invoke(
File "/opt/app-root/lib64/python3.8/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/opt/app-root/lib64/python3.8/site-packages/sqlite_utils/cli.py", line 1624, in query
db.register_fts4_bm25()
File "/opt/app-root/lib64/python3.8/site-packages/sqlite_utils/db.py", line 403, in register_fts4_bm25
self.register_function(rank_bm25, deterministic=True)
File "/opt/app-root/lib64/python3.8/site-packages/sqlite_utils/db.py", line 399, in register_function
register(fn)
File "/opt/app-root/lib64/python3.8/site-packages/sqlite_utils/db.py", line 392, in register
self.conn.create_function(name, arity, fn, **kwargs)
sqlite3.NotSupportedError: deterministic=True requires SQLite 3.8.3 or higher

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions