mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
parent
6d91d082e0
commit
9cb5700d60
2 changed files with 6 additions and 2 deletions
|
|
@ -69,6 +69,7 @@ from .utils import (
|
||||||
async_call_with_supported_arguments,
|
async_call_with_supported_arguments,
|
||||||
await_me_maybe,
|
await_me_maybe,
|
||||||
call_with_supported_arguments,
|
call_with_supported_arguments,
|
||||||
|
detect_json1,
|
||||||
display_actor,
|
display_actor,
|
||||||
escape_css_string,
|
escape_css_string,
|
||||||
escape_sqlite,
|
escape_sqlite,
|
||||||
|
|
@ -1172,9 +1173,8 @@ class Datasette:
|
||||||
conn = sqlite3.connect(":memory:")
|
conn = sqlite3.connect(":memory:")
|
||||||
self._prepare_connection(conn, "_memory")
|
self._prepare_connection(conn, "_memory")
|
||||||
sqlite_version = conn.execute("select sqlite_version()").fetchone()[0]
|
sqlite_version = conn.execute("select sqlite_version()").fetchone()[0]
|
||||||
sqlite_extensions = {}
|
sqlite_extensions = {"json1": detect_json1(conn)}
|
||||||
for extension, testsql, hasversion in (
|
for extension, testsql, hasversion in (
|
||||||
("json1", "SELECT json('{}')", False),
|
|
||||||
("spatialite", "SELECT spatialite_version()", True),
|
("spatialite", "SELECT spatialite_version()", True),
|
||||||
):
|
):
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -835,6 +835,10 @@ async def test_versions_json(ds_client):
|
||||||
assert "version" in data["sqlite"]
|
assert "version" in data["sqlite"]
|
||||||
assert "fts_versions" in data["sqlite"]
|
assert "fts_versions" in data["sqlite"]
|
||||||
assert "compile_options" in data["sqlite"]
|
assert "compile_options" in data["sqlite"]
|
||||||
|
# By default, the json1 extension is enabled in the SQLite
|
||||||
|
# provided by the `ubuntu-latest` github actions runner, and
|
||||||
|
# all versions of SQLite from 3.38.0 onwards
|
||||||
|
assert data["sqlite"]["extensions"]["json1"]
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue