Working with QGIS 3.4.9 and Geopackage. I created a View table. The command runs without errors, the view is created but does not appear in QGIS. What do I need to do?
The current version of GeoPackage (version 1.2.1) lacks a mechanism to register views into the metadata tables. The GitHub issue about that seems to be solved and closed https://github.com/opengeospatial/geopackage/issues/446 but changes will be included only in the version 1.3 of the standard.
For making your view to appear in QGIS you must materialize it with (
create table my_materialized_view as select … from my_view). Some additional SQL may be needed for registering the new materialized view properly.