Hi Sandro,
I see in https://www.gaia-gis.it/fossil/libspatialite/info/023f3323443fffa1 that you dealt with the issues related to trusted_schema = 0. But I see you used sqlite3_vtab_config(db, SQLITE_INNOCUOUS) in the spatialite virtual tables xConnect method, whereas my understanding of https://www.sqlite.org/c3ref/c_vtab_constraint_support.html is that it should be the SQLITE_VTAB_INNOCUOUS constant (with a VTAB_).
Another thing I noticed when fixing the same set of issues in the OGR Geopackage driver is that we are a bit stuck with the RTree extension itself which is *not* tagged as SQLITE_VTAB_INNOCUOUS, and thus the usual triggers to update the RTree when inserting/updating/deleting row in a feature table don't work on a trusted_schema = 0 database. I've reported that issue in https://sqlite.org/forum/forumpost/f7b7dd72f6 but that didn't get answers from a SQLite developer
Even
-- http://www.spatialys.com My software is free, but my time generally not.
--
You received this message because you are subscribed to the Google Groups "SpatiaLite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spatialite-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/spatialite-users/2a4cc010368f57e27539a95a77831cbc%40lqt.it.
If we knew the exact content of the rtree_ _node, _parent and
_rowid tables, we could possibly directly populate them and this
should be a massive speed-up if we can generate their content
outside of sqlite in a much faster way than sqlite (the doc at
https://www.sqlite.org/rtree.html doesn't go into the specifics of
the exact content/format of those tables)
I've implemented some time ago in ogr2ogr an optimization that
fills the main table in a thread, while creating the RTree in
another one (using classic INSERT INTO the RTree virtual table) in
a in-memory database, and at the end it does a "INSERT INTO
rtree_XXX_node/parent/rowid FROM SELECT * FROM
tempdb.rtree_XXX_node/parent/rowid". The later copy is super fast
(like 3 seconds for 3 million records)
To view this discussion on the web visit https://groups.google.com/d/msgid/spatialite-users/CALDLyw-bMSh542i6z%2BEnM%3Drwh3pL0oeKCz-yRT5KOyK2VCOxZA%40mail.gmail.com.