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)
16 On Ubuntu/Debian, you can run:
18 sudo apt install sqlite3 libsqlite3-mod-spatialite libspatialite7
20 ## Creating a new SQLite database
22 Nominatim cannot import directly into SQLite database. Instead you have to
23 first create a geocoding database in PostgreSQL by running a
24 [regular Nominatim import](../admin/Import.md).
26 Once this is done, the database can be converted to SQLite with
28 nominatim convert -o mydb.sqlite
30 This will create a database where all geocoding functions are available.
31 Depending on what functions you need, the database can be made smaller:
33 * `--without-reverse` omits indexes only needed for reverse geocoding
34 * `--without-search` omit tables and indexes used for forward search
35 * `--without-details` leaves out extra information only available in the
38 ## Using an SQLite database
40 Once you have created the database, you can use it by simply pointing the
41 database DSN to the SQLite file:
43 NOMINATIM_DATABASE_DSN=sqlite:dbname=mydb.sqlite
45 Please note that SQLite support is only available for the Python frontend. To
46 use the test server with an SQLite database, you therefore need to switch
49 nominatim serve --engine falcon
51 You need to install falcon or starlette for this, depending on which engine
54 The CLI query commands and the library interface already use the new Python
55 frontend and therefore work right out of the box.