Skip to Content
🚀 KalamDB v0.3.0-alpha2 is out — Learn more
SQL ReferenceOverview

SQL Reference

Version: 0.1.3 — Last Updated: February 7, 2026

KalamDB uses a SQL-first approach with extensions for real-time subscriptions, per-user isolation, and stream processing. This reference covers the complete SQL syntax.

Statement Separator

Statements are separated by semicolons:

SELECT 1; SELECT 2;

SQL Categories

CategoryDescription
NamespacesCreate, drop, and manage namespaces
Table DDLCREATE, ALTER, DROP tables and views
Data ManipulationINSERT, UPDATE, DELETE, SELECT
SubscriptionsLive queries and real-time subscriptions
Topics & ConsumersPub/sub topics and consumer groups
User ManagementCREATE, ALTER, DROP users
StorageStorage backends, flush, compact
ClusterCluster management and Raft operations
Backup & RestoreDatabase backup and recovery
ImpersonationExecute statements as another user
FunctionsBuilt-in SQL functions

Quick Example

-- Create a namespace and table CREATE NAMESPACE IF NOT EXISTS chat; CREATE TABLE chat.messages ( id BIGINT PRIMARY KEY DEFAULT SNOWFLAKE_ID(), sender TEXT NOT NULL, content TEXT NOT NULL, created_at TIMESTAMP DEFAULT NOW() ) WITH (TYPE = 'USER', FLUSH_POLICY = 'rows:1000'); -- Insert and query INSERT INTO chat.messages (sender, content) VALUES ('alice', 'Hello world!'); SELECT * FROM chat.messages ORDER BY created_at DESC; -- Subscribe to live changes SUBSCRIBE TO chat.messages OPTIONS (last_rows=50);
Last updated on