Skip to content

Commit

Permalink
Refactor + Fix for making table headers (#45)
Browse files Browse the repository at this point in the history
Issue:
In the query response, not all keys may be present, leading to columns
in the displayed table having mismatching headers, as these headers are
derived from the keys of the first record.

Fix:
Determining headers on two scenarios:

1. When the query includes '*', indicating the selection of all columns,
headers are generated from the schema by mapping parseable data types to
Grafana's own data types. Any gaps are filled by iterating over the
generated data frame.

2. If the query selectively chooses columns, headers are created from
the first record, assuming that the SQL query results fill any gaps.
  • Loading branch information
balaji-jr authored Jun 11, 2024
1 parent 3bef4ef commit f61dbdf
Show file tree
Hide file tree
Showing 16 changed files with 250 additions and 175 deletions.
34 changes: 17 additions & 17 deletions dist/MANIFEST.txt
Binary file modified dist/gpx_datasource_http_backend_darwin_amd64
Binary file not shown.
Binary file modified dist/gpx_datasource_http_backend_darwin_arm64
Binary file not shown.
Binary file modified dist/gpx_datasource_http_backend_linux_amd64
Binary file not shown.
Binary file modified dist/gpx_datasource_http_backend_linux_arm
Binary file not shown.
Binary file modified dist/gpx_datasource_http_backend_linux_arm64
Binary file not shown.
Binary file modified dist/gpx_datasource_http_backend_windows_amd64.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/module.js
2 changes: 1 addition & 1 deletion dist/module.js.map
4 changes: 2 additions & 2 deletions dist/plugin.json
2 changes: 1 addition & 1 deletion package.json
1 change: 1 addition & 0 deletions releases/parseable-datasource-1.2.1.sha1
Binary file added releases/parseable-datasource-1.2.1.zip
Binary file not shown.
147 changes: 75 additions & 72 deletions src/components/QueryEditor.tsx
229 changes: 150 additions & 79 deletions src/datasource.ts
4 changes: 2 additions & 2 deletions src/types.ts

0 comments on commit f61dbdf

Please sign in to comment.