mirror of
https://github.com/MeshCore-Beacon/beacon-server.git
synced 2026-10-15 22:39:56 +00:00
Stats endpoints read hourly rollup tables filled once per closed hour by one advisory-locked task, instead of materialized views that re-scanned every observation on each refresh. IATA-set tables give exact distinct counts for any IATA set or region. Cleanup holds raw rows for unrolled hours (up to 24h). Adds /stats/series; ingest keeps packet observation counts, observer last IATA, channel message counts and trace tag summaries. 001_baseline.sql is rewritten, so pre-release 2.0 databases must be recreated. See docs/historical-stats.md.
25 lines
650 B
YAML
25 lines
650 B
YAML
# Copyright 2026 Beacon Contributors
|
|
# SPDX-License-Identifier: agpl
|
|
|
|
version: "2"
|
|
sql:
|
|
- engine: "postgresql"
|
|
queries: "db/queries"
|
|
schema: ["db/migrations", "db/sqlc_scratch"]
|
|
gen:
|
|
go:
|
|
package: "db"
|
|
sql_package: "pgx/v5"
|
|
out: "db/sqlc"
|
|
emit_json_tags: true
|
|
emit_pointers_for_null_types: true
|
|
emit_empty_slices: true
|
|
emit_interface: true
|
|
overrides:
|
|
- db_type: "uuid"
|
|
go_type: "github.com/google/uuid.UUID"
|
|
- db_type: "jsonb"
|
|
go_type: "encoding/json.RawMessage"
|
|
- db_type: "bpchar"
|
|
go_type: "string"
|