dbcli / litecli

CLI for SQLite Databases with auto-completion and syntax highlighting
https://litecli.com
BSD 3-Clause "New" or "Revised" License
2.51k stars 74 forks source link

spatialite support #127

Open fgregg opened 2 years ago

fgregg commented 2 years ago

Thanks so much for this great tool. Would love for it to work with spatialite databases.

gvoysey commented 1 year ago

currently ( on litecli 1.9.0):

select load_extension('/usr/lib/mod_spatialite.so');

returns not authorized, even though litecli has been installed with a python that has spatialite support enabled and was built with:


export PYTHON_CONFIGURE_OPTS="--enable-shared  --enable-loadable-sqlite-extensions"
export LDFLAGS="-L/usr/local/opt/sqlite/lib -L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/sqlite/include -I/usr/local/opt/zlib/include"```
rrrnld commented 5 months ago

It works for me if I use the .load special command (litecli 1.10.0, libspatialite 5.1.0):

.load '/path/to/libspatialite/lib/mod_spatialite.so'
gvoysey commented 5 months ago

confirmed that the .load form works for me, as well. After executing that, i can subsequently select ST_AsText(geometry_column) from GeometryTable and see wkt not wkb.