PostgreSQL: PGX default to time series format when no format is specified in queries (#110028)

* PostgreSQL: PGX default to table format when no format is specified in queries

* Change to default to time series
This commit is contained in:
Zoltán Bedi
2025-08-25 13:31:57 +02:00
committed by GitHub
parent bd06c062b7
commit 1e0587001d
2 changed files with 71 additions and 50 deletions
@@ -345,13 +345,14 @@ func (e *DataSourceHandler) newProcessCfgPGX(queryContext context.Context, query
qm.TimeRange.From = query.TimeRange.From.UTC()
qm.TimeRange.To = query.TimeRange.To.UTC()
// Default to time_series if no format is provided
switch queryJSON.Format {
case "time_series":
qm.Format = dataQueryFormatSeries
case "table":
qm.Format = dataQueryFormatTable
case "time_series":
fallthrough
default:
panic(fmt.Sprintf("Unrecognized query model format: %q", queryJSON.Format))
qm.Format = dataQueryFormatSeries
}
for i, col := range qm.columnNames {