Highly ambitious ATProtocol AppView service and sdks
1-- Add jetstream cursor table for tracking event processing position
2CREATE TABLE IF NOT EXISTS jetstream_cursor (
3 id TEXT PRIMARY KEY DEFAULT 'default',
4 time_us BIGINT NOT NULL,
5 updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
6);
7
8-- Index for tracking cursor freshness
9CREATE INDEX idx_jetstream_cursor_updated_at ON jetstream_cursor(updated_at);
10
11-- Insert default cursor starting at 0 (will be updated when events are processed)
12INSERT INTO jetstream_cursor (id, time_us) VALUES ('default', 0)
13ON CONFLICT (id) DO NOTHING;