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

User Management

KalamDB includes built-in authentication and role-based access control (RBAC).

CREATE USER

CREATE USER '<username>' WITH <PASSWORD '<password>' | OAUTH | INTERNAL> ROLE <user|service|dba|system> [EMAIL '<email>'];

Roles

RoleDescription
userStandard user — access to own tables
serviceService account — for bots and integrations
dbaDatabase administrator — full table management
systemSystem-level — unrestricted access

Examples

-- Create a regular user with password CREATE USER 'alice' WITH PASSWORD 'SecurePass123!' ROLE user EMAIL 'alice@example.com'; -- Create a service account CREATE USER 'chat_bot' WITH PASSWORD 'BotSecret456!' ROLE service; -- Create a DBA CREATE USER 'admin' WITH PASSWORD 'AdminPass789!' ROLE dba EMAIL 'admin@example.com';

ALTER USER

-- Change password ALTER USER '<username>' SET PASSWORD '<new_password>'; -- Change role ALTER USER '<username>' SET ROLE <user|service|dba|system>; -- Update email ALTER 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