User Management
KalamDB includes built-in authentication and role-based access control (RBAC).
CREATE USER
CREATE USER '<username>' WITH <PASSWORD '<password>' | OAUTH '<json-auth-data>' | INTERNAL> ROLE <user|service|dba|system> [EMAIL '<email>'];Roles
| Role | Description |
|---|---|
user | Standard user — access to own tables |
service | Service account — for bots and integrations |
dba | Database administrator — full table management |
system | System-level — unrestricted access |
Examples
-- Create a regular user with passwordCREATE USER 'alice' WITH PASSWORD 'SecurePass123!' ROLE user EMAIL 'alice@example.com'; -- Create a service accountCREATE USER 'chat_bot' WITH PASSWORD 'BotSecret456!' ROLE service; -- Create an OAuth-mapped user (provider + subject are required)CREATE USER 'alice_oauth' WITH OAUTH '{"provider":"google","subject":"google-user-123"}' ROLE user EMAIL 'alice@example.com'; -- Create a DBACREATE USER 'admin' WITH PASSWORD 'AdminPass789!' ROLE dba EMAIL 'admin@example.com';ALTER USER
-- Change passwordALTER USER '<username>' SET PASSWORD '<new_password>'; -- Change roleALTER USER '<username>' SET ROLE <user|service|dba|system>; -- Update emailALTER USER '<username>' SET EMAIL '<new_email>';Examples
ALTER USER 'alice' SET PASSWORD 'NewSecurePass!';ALTER USER 'alice' SET ROLE dba;ALTER USER 'alice' SET EMAIL 'alice.new@example.com';DROP USER
DROP USER '<username>';DROP USER IF EXISTS '<username>';Dropping a user also removes their per-user storage directory, providing GDPR-compliant data deletion.
DROP USER IF EXISTS 'alice';Last updated on