1 A Nominatim database can be converted into an SQLite database and used as
2 a read-only source for geocoding queries. This sections describes how to
3 create and use an SQLite database.
6 This feature is in an experimental state at the moment. Use at your own
9 ## Installing prerequisites
11 To use a SQLite database, you need to install:
14 * Spatialite (> 5.0.0)
17 On Ubuntu/Debian, you can run:
19 sudo apt install sqlite3 libsqlite3-mod-spatialite libspatialite7
21 Install the aiosqlite Python package in your virtual environment:
23 /srv/nominatim-venv/bin/pip install aiosqlite
25 ## Creating a new SQLite database
27 Nominatim cannot import directly into SQLite database. Instead you have to
28 first create a geocoding database in PostgreSQL by running a
29 [regular Nominatim import](../admin/Import.md).
31 Once this is done, the database can be converted to SQLite with
33 nominatim convert -o mydb.sqlite
35 This will create a database where all geocoding functions are available.
36 Depending on what functions you need, the database can be made smaller:
38 * `--without-reverse` omits indexes only needed for reverse geocoding
39 * `--without-search` omit tables and indexes used for forward search
40 * `--without-details` leaves out extra information only available in the
43 ## Using an SQLite database
45 Once you have created the database, you can use it by simply pointing the
46 database DSN to the SQLite file:
48 NOMINATIM_DATABASE_DSN=sqlite:dbname=mydb.sqlite
50 Please note that SQLite support is only available for the Python frontend. To
51 use the test server with an SQLite database, you therefore need to switch
54 nominatim serve --engine falcon
56 You need to install falcon or starlette for this, depending on which engine
59 The CLI query commands and the library interface already use the new Python
60 frontend and therefore work right out of the box.