more postgresql type fixes
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-04-20 16:35:23 +10:00
parent aa0d8099c7
commit 83bd4b2026
5 changed files with 56 additions and 7 deletions
+10
View File
@@ -22,3 +22,13 @@ GROUP BY`) {
t.Fatalf("unexpected final GROUP BY after agg/totals join; this breaks Postgres SQLSTATE 42803")
}
}
func TestBuildMonthlySummaryInsertCastsSampleSumToBigInt(t *testing.T) {
query, err := BuildMonthlySummaryInsert("inventory_monthly_summary_202601", "SELECT 1")
if err != nil {
t.Fatalf("BuildMonthlySummaryInsert failed: %v", err)
}
if !strings.Contains(query, `CAST(SUM("SamplesPresent") AS BIGINT) AS "SamplesPresent"`) {
t.Fatalf("expected monthly sample sum cast to BIGINT to avoid Postgres numeric assignment issues")
}
}