Sorry, there was something going wrong in gpkgAddGeometryColumn();
here is the full history:
1. about two months ago (immediately before releasing the first 4.3.0
Release Candidate) it emerged that gpkgAddGeometryColumn() failed
due to a Foreign Key constraint violation simply caused by a
missing corresponding entry into the "gpkg_content" table.
2. consequently we decided that the most appropriate solution was to
modify the gpkgAddGeometryColumn() implementation so to silently
insert an eventually missing "gpkg_content" entry whenever it
was required.
https://groups.google.com/forum/#!searchin/spatialite-users/creating$20an$20ESRI$20compatible$20Geopackage$20second$20thought|sort:relevance/spatialite-users/rBKeuXLpQv8/EzgG4GsJeeUJ
3. unhappily something gone wrong with the intended patch that
didn't worked properly due to a trivial programming error.
nobody noticed during the Release Candidate testings that the
problem was still unresolved, so now 4.3.0 continues to be
affected by this issue.
4. as already noticed by Mark the problem is possibly worsened by
the fact that checking Foreign Key constraints is an optional
feature of SQLite and requires an explicit call in order to
be effectively activated: PRAGMA foreign_key=1;
spatialite_gui always do this each time that a new connection
is established, and consequently the bugged gpkgAddGeometryColumn()
will always fail on spatialite_gui.
on the other hand sqlite3 and many language connectors adopt
the opposite default setting (always disabling foreign keys),
so gpkgAddGeometryColumn() will apparently work fine but an
incomplete GPKG will be produced.
Conclusions:
-----------------
the gpkgAddGeometryColumn() issue is now definitely fixed into
the Fossil repository and will be released with the next version.
in the meanwhile, as an interim solution, manually inserting the
appropriate entry into "gpkg_content" before any attempt to call
gpkgAddGeometryColumn() should be a reasonable workaround.
bye Sandro