(t *testing.T)
| 339 | |
| 340 | ql := &QueryLogger{db: db} |
| 341 | ql.flushBatch([]QueryLogEntry{{ |
| 342 | EventTime: time.Unix(1700000000, 0).UTC(), |
| 343 | QueryDurationMs: 42, |
| 344 | Type: "QueryFinish", |
| 345 | Query: "SELECT 1", |
| 346 | QueryKind: "Select", |
| 347 | NormalizedHash: 17, |
| 348 | ResultRows: 1, |
| 349 | UserName: "alice", |
| 350 | OrgID: "analytics", |
| 351 | CurrentDatabase: "analytics_db", |
| 352 | ClientAddress: "127.0.0.1", |
| 353 | ClientPort: 5432, |
| 354 | ApplicationName: "psql", |
| 355 | PID: 99, |
| 356 | WorkerID: 7, |
| 357 | Protocol: "simple", |
| 358 | PostgresScanMs: 123, |
| 359 | CPUTimeSeconds: 4.25, |
| 360 | PeakBufferMemoryBytes: 2048, |
| 361 | }}) |
| 362 | |
| 363 | var got string |
| 364 | err = db.QueryRow("SELECT org_id FROM query_log WHERE query = 'SELECT 1'").Scan(&got) |
| 365 | if err != nil { |
| 366 | t.Fatalf("query org_id: %v", err) |
| 367 | } |
| 368 | if got != "analytics" { |
nothing calls this directly
no test coverage detected