Database Tools¶
- spatialist.sqlite_util.sqlite_setup(driver=':memory:', extensions=None, verbose=False)[source]¶
Setup a sqlite3 connection and load extensions to it. This function intends to simplify the process of loading extensions to sqlite3, which can be quite difficult depending on the version used. Particularly loading spatialite has caused quite some trouble. In recent distributions of Ubuntu this has become much easier due to a new apt package libsqlite3-mod-spatialite. For use in Windows, spatialist comes with its own spatialite DLL distribution. See here for more details on loading spatialite as an sqlite3 extension.
- Parameters:
- Returns:
the database connection
- Return type:
Example
>>> from spatialist.sqlite_util import sqlite_setup >>> conn = sqlite_setup(extensions=['spatialite'])