Skip to Content
Topic Pub/SubSQL Topics & Consumers

SQL Topics & Consumer Groups

Topics provide a durable pub/sub messaging layer built on top of KalamDB tables.

CREATE TOPIC

CREATE TOPIC <topic_name>; CREATE TOPIC <topic_name> PARTITIONS <count>;

<topic_name> must be namespace-qualified and unquoted (for example: chat.ai_processing).

CREATE TOPIC IF NOT EXISTS ... is not currently supported.

ADD SOURCE

ALTER TOPIC <topic_name> ADD SOURCE <table_name_or_namespace.table_name> ON <INSERT|UPDATE|DELETE> [WHERE <filter_expression>] [WITH (payload = '<key|full|diff>')];

CONSUME FROM

CONSUME FROM <topic_name> [GROUP '<group_id>'] [FROM <LATEST|EARLIEST|offset>] [START <LATEST|EARLIEST|offset>] -- compatibility syntax used in tests/examples [LIMIT <count>];

ACK

ACK <topic_name> GROUP '<group_id>' [PARTITION <partition_id>] UPTO OFFSET <offset>;
Last updated on