RSQL supports basic ACID features and a subset of SQL features.
Supported:
CREATE TABLE- Column definitions
- Column constraints:
PRIMARY KEYNOT NULLUNIQUEINDEX
- Data types:
INTEGER: 64-bit signed integerFLOAT: double-precision floating pointVARCHAR(n)CHAR(n)BOOLEAN
IF NOT EXISTSclause
e.g.
CREATE TABLE users (
id INTEGER PRIMARY KEY, // auto indexed
name VARCHAR(100) NOT NULL,
age INTEGER,
email VARCHAR(100) UNIQUE, // auto indexed
is_active BOOLEAN,
INDEX (age)
);Supported:
CREATE INDEXUNIQUEconstraint- Single-column indexes
IF NOT EXISTSclause
Not Supported:
- Multi-column indexes
- Indexes on VARCHAR columns
e.g.
CREATE INDEX idx_age ON users(age);
CREATE UNIQUE INDEX idx_email ON users(email) IF NOT EXISTS;Supported:
ALTER TABLE RENAME TOIF EXISTSclauseALTER TABLE RENAME COLUMN TO: Only support renaming unindexed columnsALTER TABLE DROP COLUMN: Support dropping columns (logical deletion)
e.g.
ALTER TABLE old_table_name IF EXISTS RENAME TO new_table_name;
ALTER TABLE users DROP COLUMN age;Supported:
DROP TABLEIF EXISTSclause
e.g.
DROP TABLE IF EXISTS users;Supported:
INSERT VALUESNot Supported:- Insert from subquery
e.g.
INSERT INTO users (id, name, age, email, is_active) VALUES (1, 'Alice', 30, 'alice@example.com', true);Supported:
- basic
SELECTstatements WHEREclause with complex conditions:- Simple comparisons:
=,<,>,<=,>=,!= - Pattern matching:
LIKE,ILIKE(case-insensitive) - Range matching:
BETWEEN <low> AND <high>(optimized with B-Tree index)
- Simple comparisons:
JOINoperations (INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN, CROSS JOIN)GROUP BYclause and aggregation functions (COUNT,SUM,AVG,MIN,MAX)FROMclause with one subqueryORDER BYclause- Renaming columns using
AS// TO BE SUPPORTED IN FUTURE
e.g.
SELECT name, age FROM users WHERE age > 25;
SELECT name FROM users WHERE name LIKE 'A%';
SELECT * FROM users WHERE age BETWEEN 20 AND 30;
SELECT u.name, o.order_id FROM users u INNER JOIN orders o ON u.id = o.user_id;
SELECT age, COUNT(*) FROM users GROUP BY age;Supported:
UPDATEstatements withSETclauseWHEREclause with all supported conditions (comparisons,LIKE,BETWEEN, etc.)
e.g.
UPDATE users SET is_active = false WHERE last_login < 1600000000;
UPDATE users SET bio = 'Secret' WHERE name LIKE 'Private%';Supported:
DELETEstatementsWHEREclause with all supported conditions
e.g.
DELETE FROM users WHERE is_active = false;
DELETE FROM users WHERE age BETWEEN 0 AND 18;Supported:
BEGIN TRANSACTIONe.g.
BEGIN TRANSACTION;Supported:
COMMITe.g.
COMMIT;Supported:
ROLLBACKe.g.
ROLLBACK;Supported:
CREATE USERIF NOT EXISTSclausePASSWORDspecification
Created users have no permissions by default and cannot read or write any tables until granted.
e.g.
CREATE USER alice PASSWORD 'securepassword' IF NOT EXISTS;Supported:
DROP USERIF EXISTSclause
e.g.
DROP USER IF EXISTS alice;Supported:
GRANT READ TO user: Grant global read access.GRANT WRITE TO user: Grant global write access (includes read).GRANT READ ON table TO user: Grant table-specific read access.GRANT WRITE ON table TO user: Grant table-specific write access.
e.g.
GRANT WRITE TO alice;
GRANT READ ON orders TO guest_user;Supported:
REVOKE READ FROM user: Revoke all global permissions.REVOKE WRITE FROM user: Revoke all global permissions.REVOKE READ ON table FROM user: Revoke table-specific access.REVOKE WRITE ON table FROM user: Revoke table-specific access.
e.g.
REVOKE WRITE FROM alice;
REVOKE READ ON orders FROM guest_user;