gws.plugin.postgres¶
PostgreSQL/PostGIS support.
Provides a database provider for PostgreSQL and the objects that use it:
layers, models, finders, an authorization provider and a storage provider.
The database-independent parts are in gws.base.database; this plugin adds
the PostgreSQL specifics.
Submodules:
provider: thepostgresdatabase provider. Builds the connection URL from host and credentials or from a service name in the PostgreSQL service file, splits and joins schema-qualified table names (the default schema ispublic; quoted identifiers are supported), computes table bounds withST_Extentand detects array columns (described asstrlist,intlistorfloatlistwhen the item type is known) and the geometry type and SRID of PostGIS columns, also for constraint-based geometry columns without a type modifier, viapublic.geometry_columns.layer: thepostgresvector layer that shows the features of a table.model: thepostgresmodel that reads and writes the records of a table.finder: thepostgresfinder that searches a table by keyword, geometry and filter. The search itself is done by thepostgresmodels of the finder; all three search types are always enabled, since the actual support depends on the models.auth_provider: thepostgresauthorization provider that checks credentials and loads users with SQL queries.storage_provider: thepostgresstorage provider that keeps saved user data in a table. The table is not created by the provider; writing a record with an existing category and name replaces it.
Objects find their database provider by dbUid. Without dbUid, the
first configured postgres provider is used.
Example:
database.providers+ {
uid "main_db"
type "postgres"
serviceName "LOCAL"
}
map.layers+ {
title "POIs"
type "postgres"
dbUid "main_db"
tableName "edit.poi"
}
storage.providers+ {
type "postgres"
dbUid "main_db"
tableName "public.gws_storage"
}
Source code: gws.plugin.postgres