ValueError: Unknown options: analyze (Sqlite backend)
See original GitHub issueDjango Silk ANALYZE_QUERIES
does not work with Sqlite3 when using Django 3.2.6.
Django silk fetched via pip install -e git+https://github.com/jazzband/django-silk.git#egg=django-silk
.
Django-silk latest commit: 7f03cfef0b554af541dc53fc6d5bee850469098a
.
# settings.py
SILKY_AUTHENTICATION = True
SILKY_AUTHORISATION = True
SILKY_ANALYZE_QUERIES = True # This appears to result in the problem taking place.
SILKY_PYTHON_PROFILER = True
SILKY_PYTHON_PROFILER_BINARY = True
This issue is not present on Django 3.1 using Django-silk 4.1
Traceback
Traceback (most recent call last):
File "C:\Users\username\Documents\Repositories\Conreq\.venv\lib\site-packages\asgiref\sync.py", line 482, in thread_handler
raise exc_info[1]
File "C:\Users\username\Documents\Repositories\Conreq\.venv\lib\site-packages\django\core\handlers\exception.py", line 38, in inner
response = await get_response(request)
File "C:\Users\username\Documents\Repositories\Conreq\.venv\lib\site-packages\django\core\handlers\base.py", line 233, in _get_response_async
response = await wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\username\Documents\Repositories\Conreq\.venv\lib\site-packages\asgiref\sync.py", line 444, in __call__
ret = await asyncio.wait_for(future, timeout=None)
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\asyncio\tasks.py", line 442, in wait_for
return await fut
File "C:\Users\username\Documents\Repositories\Conreq\.venv\lib\site-packages\asgiref\current_thread_executor.py", line 22, in run
result = self.fn(*self.args, **self.kwargs)
File "C:\Users\username\Documents\Repositories\Conreq\.venv\lib\site-packages\asgiref\sync.py", line 486, in thread_handler
return func(*args, **kwargs)
File "c:\users\username\documents\repositories\conreq\.venv\src\django-silk\silk\profiling\profiler.py", line 158, in wrapped_target
result = target(*args, **kwargs)
File "C:\Users\username\Documents\Repositories\Conreq\conreq\core\base\views.py", line 86, in landing
config_needed = configure(request)
File "C:\Users\username\Documents\Repositories\Conreq\conreq\core\base\views.py", line 21, in configure
conreq_config = ConreqConfig.get_solo()
File "C:\Users\username\Documents\Repositories\Conreq\.venv\lib\site-packages\solo\models.py", line 55, in get_solo
obj, created = cls.objects.get_or_create(pk=cls.singleton_instance_id)
File "C:\Users\username\Documents\Repositories\Conreq\.venv\lib\site-packages\django\db\models\manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "C:\Users\username\Documents\Repositories\Conreq\.venv\lib\site-packages\django\db\models\query.py", line 581, in get_or_create
return self.get(**kwargs), False
File "C:\Users\username\Documents\Repositories\Conreq\.venv\lib\site-packages\django\db\models\query.py", line 431, in get
num = len(clone)
File "C:\Users\username\Documents\Repositories\Conreq\.venv\lib\site-packages\django\db\models\query.py", line 262, in __len__
self._fetch_all()
File "C:\Users\username\Documents\Repositories\Conreq\.venv\lib\site-packages\django\db\models\query.py", line 1324, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "C:\Users\username\Documents\Repositories\Conreq\.venv\lib\site-packages\django\db\models\query.py", line 51, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
File "c:\users\username\documents\repositories\conreq\.venv\src\django-silk\silk\sql.py", line 81, in execute_sql
query_dict['analysis'] = _explain_query(q, params)
File "c:\users\username\documents\repositories\conreq\.venv\src\django-silk\silk\sql.py", line 33, in _explain_query
prefix = connection.ops.explain_query_prefix(
File "C:\Users\username\Documents\Repositories\Conreq\.venv\lib\site-packages\django\db\backends\base\operations.py", line 686, in explain_query_prefix
raise ValueError('Unknown options: %s' % ', '.join(sorted(options.keys())))
Related LOC
Issue appears to be related to django-silk/silk/sql.py:33
prefix = connection.ops.explain_query_prefix(
analyze = True
)
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
#29962 (Queryset.explain(verbose=True) doesn't work on non ...
As documented explain() accepts backend specific options and the the verbose=True option is PostgreSQL specific. Some databases accept flags that can return ...
Read more >(sqlite3.OperationalError) unknown database "seller"
createall() to create the same tables of the production database, i got this error: (sqlite3.OperationalError) unknown database "seller".
Read more >tf.data.experimental.SqlDataset | TensorFlow v2.11.0
A new Dataset with the transformation applied as described above. Raises. ValueError, If a component has an unknown rank, and ...
Read more >ara Documentation - Read the Docs
Create a directory for a volume to store settings and a sqlite database mkdir -p ~/.ara/server. # Start an API server with podman...
Read more >Introduction and key concepts - Brightway2 1.0 documentation
Parameterized inventory datasets only work with databases that use the default SQLite backend. Groups#. Parameters are tricky because you have to parse and ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think this should be closed via #493
It looks like the project is already set up to test against multiple Python versions and databases, the problem is the existing tests all seem to mock queries so nothing hits the actual DB. I’ll try to submit a PR with tests that actually call out to the DB.