generated from grafana/grafana-starter-datasource-backend
-
Notifications
You must be signed in to change notification settings - Fork 90
Closed
Labels
Description
What happened:
when using Business Table to insert a row, I get an error from the clickhouse datasource:
Request error
Details
add Error: {
"error":{"refId":"","message":"PGX connection lifecycle error: driver: bad connection","status":500},
"message":"PGX connection lifecycle error: driver: bad connection\nRequest: {\n \"editorType\": \"sql\",\n \"format\": 1,\n \"meta\": {\n \"builderOptions\": {\n \"columns\": [],\n \"database\": \"\",\n \"limit\": 1000,\n \"mode\": \"list\",\n \"queryType\": \"table\",\n \"table\": \"\"\n }\n },\n \"pluginVersion\": \"4.10.2\",\n \"queryType\": \"table\",\n \"rawSql\": \"INSERT INTO testing.test (name) VALUES ('sdf')\",\n \"refId\": \"\"\n}"
}
The thing is, three rows are inserted, and the above error is reported.
What you expected to happen:
A single row to be inserted and no error reported.
How to reproduce it (as minimally and precisely as possible):
- create a clickhouse datasource (say you have a db called 'testing' with a table 'test', single column 'name' String), user has insert permissions
- create a new dashboard for the datasource
- add a panel of type Business Table:
- in "Queries" put
SELECT name FROM testing.test - in "Layout" add table
testand its columnname - in "Add data"
- enable
testand its columnname - in "Add Request" choose datasource and put in the query
INSERT INTO testing.test (name) VALUES (${payload.name:sqlstring})
- enable
- in "Queries" put
- click on the + sign in the top right corner of the panel
- enter something in "name", click on the save icon on the right
- observe the above error
- refresh the panel, observer three rows inserted
Note that the same procedure works just fine with an "Microsoft SQL Server" datasource
Environment:
- Grafana version: v11.3.0 (d9455ff7db)
- Plugin version: 4.10.2
- OS Grafana is installed on: ubuntu 22.04
- User OS & Browser: any
- Others:
SpencerTorres
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done