gws.plugin.postgres.provider¶
PostgreSQL database provider.
Source code: gws.plugin.postgres.provider
Module Contents¶
- class gws.plugin.postgres.provider.Config¶
Bases:
gws.base.database.provider.ConfigConnection to a PostgreSQL/PostGIS database.
- options: dict | None¶
Extra libpq connection parameters.
- gws.plugin.postgres.provider.connection_url(cfg: gws.Config) str | None¶
Create a connection URL from a provider configuration.
If
hostis configured, the URL is built from the host, port, database and credentials. Otherwise, ifserviceNameis configured, the URL refers to that service in the PostgreSQL service file given byPGSERVICEFILE.optionsare added as URL parameters, withapplication_nameset toGWSby default.- Parameters:
cfg – Provider configuration.
- Returns:
The connection URL, or
Noneif neitherhostnorserviceNameis configured.- Raises:
sa.Error – If
serviceNameis used and the service file does not exist.
- class gws.plugin.postgres.provider.Object¶
Bases:
gws.base.database.provider.ObjectPostgreSQL/PostGIS database provider.
Connects to a PostgreSQL database and describes its tables and columns, including PostGIS geometry columns, for the layers, models and finders that use it.
- describe_column(table, column_name)¶
- join_table_name(schema, name)¶
- split_table_name(table_name)¶
- table_bounds(table)¶
- url()¶