Create PostgreSQL Connection
create_postgresql_connectionValidate and save a PostgreSQL Browser-panel connection using QGIS Authentication Manager credentials or pg_service.conf, selecting a connection mode for endpoint or service access.
Instructions
Validate and save a new PostgreSQL Browser-panel connection. Passwords are never accepted: credentials come from a QGIS Authentication Manager configuration, from the libpq service file (pg_service.conf), or both. connection_mode selects which parameters are required; when the user's intent is unclear, ask which mode applies before calling. endpoint_using_auth_manager: host, port, database, auth_config_id (port must be the actual database port supplied by the caller or user, this tool never assumes 5432). service_using_auth_manager: service (the name defined in pg_service.conf) and auth_config_id; database optionally overrides the service file's dbname. service_only: service; database optionally overrides dbname; do not pass auth_config_id. Parameters a mode does not use are rejected. Fails if name already exists or the database cannot be reached. ssl_mode is one of prefer (default), disable, allow, require, verify-ca, or verify-full.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | ||
| name | Yes | ||
| port | No | ||
| service | No | ||
| database | No | ||
| ssl_mode | No | prefer | |
| auth_config_id | No | ||
| connection_mode | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||