Add Layer from Connection
add_layer_from_connectionLoad a table or SQL query from a saved database connection as a QGIS project layer, specifying geometry and primary key fields so the result can be mapped and identified.
Instructions
Load a table from a saved connection as a project layer. Pass table (+ schema), or sql to build a query layer executed by the database. For a SQL layer, geometry_column and primary_key may be needed for QGIS to map/identify the result.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"provider": "<provider>",
"connection": "<connection>"
},
"name": "add_layer_from_connection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | No | ||
| name | No | ||
| table | No | ||
| schema | No | ||
| provider | Yes | ||
| connection | Yes | ||
| primary_key | No | ||
| geometry_column | No |