[Qgis-user] columns in spatialite

Alex M tech_dev at wildintellect.com
Thu Nov 12 09:13:28 PST 2015


Yes we should implement a cheat in QGIS (core) to handle this issue.
Other SQLite GUIs do this. Spatialite GUI and SQLite Manager (Firefox
plugin).

The basic process:
1. Make a new table the way you actually want it.
2. SQL INSERT records from Old to New (Mapping old columns to new if
name changed).
3. Remove old table
4. Rename new table to old name
5. Vacuum to recover extra pages allocated in the shuffle.

Nothing else should be needed, since you use the same name, spatial
indexes and geometry_column records should stay the same unless the
Geometry column is renamed.

This method will apply to both GeoPackage (If editing is allowed),
Spatialite tables, and any non-spatial sqlite tables.

-Alex

On 11/12/2015 04:30 AM, Matthias Kuhn wrote:
> The main issues with spatialite are IMO: It's based on sqlite so
> deleting columns and renaming columns is not supported by design. We
> could offer some hacks to bypass this (annoying restriction) from the UI
> - there is a risk of side effects though. Another property of it is,
> that it's already 4-5MB big, even when empty. I consider this a major
> limiting factor as well. Other issues which we were not yet able to
> solve are its management of the information scheme which keep duplicate
> entries of tables and columns which need to be properly updated which we
> apparently do not manage (yet).
> 
> Geopackage is also based on sqlite, so the column delete/rename
> restrictions apply as well (with the same workaround possibilities). I
> haven't checked the file size, but if that's smaller, that would be
> quite nice (does somebody know?).
> 
> All the best
> Matthias
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
> 




More information about the Qgis-user mailing list