Skip to content

Update SQLite bundled with Docker container #695

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

Closed
simonw opened this issue Mar 6, 2020 · 7 comments
Closed

Update SQLite bundled with Docker container #695

simonw opened this issue Mar 6, 2020 · 7 comments

Comments

@simonw
Copy link
Owner

simonw commented Mar 6, 2020

It's 3.26.0 at the moment:

datasette/Dockerfile

Lines 9 to 11 in af9cd4c

RUN wget "https://www.sqlite.org/2018/sqlite-autoconf-3260000.tar.gz" && tar xzf sqlite-autoconf-3260000.tar.gz \
&& cd sqlite-autoconf-3260000 && ./configure --disable-static --enable-fts5 --enable-json1 CFLAGS="-g -O2 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_FTS4=1 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_JSON1" \
&& make && make install

Most recent release is 3.31.1: https://www.sqlite.org/releaselog/3_31_1.html

@simonw
Copy link
Owner Author

simonw commented Mar 6, 2020

@simonw
Copy link
Owner Author

simonw commented Mar 6, 2020

On my laptop I can build and test like so:

cd datasette
docker build -t datasette-sqlite .
docker run -p 8001:8001 -v `pwd`:/mnt \
    datasette-sqlite \
    datasette -p 8001 -h 0.0.0.0 /mnt/fixtures.db

@simonw
Copy link
Owner Author

simonw commented Mar 6, 2020

Need to test with SpatiaLite here too.

docker run -p 8001:8001 -v `pwd`:/mnt \
    datasette-sqlite \
    datasette -p 8001 -h 0.0.0.0 /mnt/spatial.db \
    --load-extension=/usr/local/lib/mod_spatialite.so

@simonw
Copy link
Owner Author

simonw commented Mar 6, 2020

Here's how to run the unit test suite inside the freshly built Docker container (built with a new SQLite):

docker run -it -v `pwd`:/mnt datasette-sqlite /bin/bash
root@0e1928cfdf79:/# cd /mnt
root@0e1928cfdf79:/mnt# pip install -e .[test]
root@0e1928cfdf79:/mnt# pytest

I ran that against SQLite 3.31.1 and got one failure!

It was for test_searchable[/fixtures/searchable.json?_search=te*+AND+do*&_searchmode=raw-expected_rows3]

    def test_searchable(app_client, path, expected_rows):
        response = app_client.get(path)
>       assert expected_rows == response.json["rows"]
E       AssertionError: assert [[1, 'barry c...sel', 'puma']] == []
E         Left contains 2 more items, first extra item: [1, 'barry cat', 'terry dog', 'panther']
E         Full diff:
E         + []
E         - [[1, 'barry cat', 'terry dog', 'panther'],
E         -  [2, 'terry dog', 'sara weasel', 'puma']]

@simonw
Copy link
Owner Author

simonw commented Mar 6, 2020

Well that's odd. If I run the tests against SQLite 3.26.0 inside the container I get the same failure there as well:

docker run -it -v `pwd`:/mnt datasetteproject/datasette:0.37.1 /bin/bash
root@710eed6278b2:/# cd /mnt
root@710eed6278b2:/mnt# pip install -e .[test] && pytest

@simonw
Copy link
Owner Author

simonw commented Mar 6, 2020

SpatiaLite testing works fine. I'm going to ship this even though there's a single failing test, since that's not a regression from the previous Docker release. I'm going to file a separate issue about that.

@simonw
Copy link
Owner Author

simonw commented Mar 8, 2020

Shipped in Datasette 0.38.

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

No branches or pull requests

1 participant