-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql_setup.txt
More file actions
34 lines (25 loc) · 986 Bytes
/
Copy pathsql_setup.txt
File metadata and controls
34 lines (25 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
SEARCHAPI POSTGRES SETUP
The service runs its own idempotent migrations on startup. A site only needs a
database and a user with table/index creation rights.
Example:
CREATE DATABASE telemetry WITH ENCODING 'UTF8';
CREATE USER searchapi WITH PASSWORD 'replace-me';
GRANT ALL PRIVILEGES ON DATABASE telemetry TO searchapi;
Core tables created by the service:
assets
procedures
test_runs
channels
telemetry_samples
alarms
operator_annotations
audit_events
Eventing model:
Every create/ingest action writes an audit_events row.
The service publishes the audit event id on the telemetry_events channel.
If Elasticsearch is configured, the listener indexes the audit event.
If Elasticsearch is not configured, the API searches audit_events directly.
Replay model:
telemetry_samples.replay_key is unique when provided.
Gateways should generate stable replay keys per source message.
Replayed messages with the same key are rejected as duplicates.