Improve sql-switch-spatialite-sqlite function