Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add test for TopoGeometry layers visibility with and w/out permissions
Adds a "qgis_test_user" database users with the db setup script, using an hard-coded password for connection. This was the simplest way to make things work because the alternative of using 'options' member in the URI is not supported by QGIS at the moment, see #32832
- Loading branch information
1 parent
0558a5c
commit 90c8301
Showing
5 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DROP USER IF EXISTS qgis_test_user; | ||
CREATE USER qgis_test_user PASSWORD 'qgis_test_user_password' LOGIN; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
DO $$ | ||
DECLARE | ||
layerid INTEGER; | ||
|
||
BEGIN | ||
IF EXISTS ( SELECT * FROM pg_catalog.pg_available_extensions | ||
WHERE name = 'postgis_topology' ) | ||
THEN | ||
RAISE NOTICE 'Loading postgis_topology'; | ||
CREATE EXTENSION IF NOT EXISTS postgis_topology; | ||
|
||
-- Topology: qgis_test_Topo1 | ||
|
||
IF EXISTS ( SELECT * FROM pg_catalog.pg_namespace WHERE | ||
nspname = 'qgis_test_Topo1' ) | ||
THEN | ||
PERFORM topology.DropTopology('qgis_test_Topo1'); | ||
END IF; | ||
|
||
PERFORM topology.CreateTopology('qgis_test_Topo1'); | ||
|
||
-- TopoLayer: qgis_test.TopoLayer1 | ||
|
||
DROP TABLE IF EXISTS qgis_test."TopoLayer1"; | ||
CREATE TABLE qgis_test."TopoLayer1" (id serial primary key); | ||
layerid := topology.AddTopoGeometryColumn('qgis_test_Topo1', | ||
'qgis_test', | ||
'TopoLayer1', | ||
'topogeom', | ||
'POLYGON'); | ||
INSERT INTO qgis_test."TopoLayer1" (topogeom) SELECT | ||
topology.toTopoGeom('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))', | ||
'qgis_test_Topo1', layerid); | ||
|
||
END IF; | ||
END; | ||
$$; | ||
|