Commands Overview
Redlite implements the Redis protocol and supports most Redis commands. For detailed command documentation, refer to the official Redis documentation.
Supported Commands
Section titled âSupported CommandsâSee COMMANDS.md for the complete list of supported commands.
Data Types
Section titled âData Typesâ- â Strings - GET, SET, MGET, MSET, INCR, APPEND, etc.
- â Hashes - HGET, HSET, HGETALL, HDEL, HINCRBY, etc.
- â Lists - LPUSH, RPUSH, LPOP, RPOP, LRANGE, etc.
- â Sets - SADD, SREM, SMEMBERS, SDIFF, SINTER, SUNION, etc.
- â Sorted Sets - ZADD, ZREM, ZRANGE, ZRANGEBYSCORE, etc.
- â Streams - XADD, XREAD, XRANGE, XGROUP, XREADGROUP, etc.
Search & Vectors
Section titled âSearch & Vectorsâ- â RediSearch - FT.CREATE, FT.SEARCH, FT.INFO, FT.AGGREGATE, FT.ALTER, FT.DROPINDEX, aliases, synonyms, suggestions
- â
Vector Search - VADD, VSIM, VREM, VCARD, VDIM, VGET, VGETALL, VGETATTRIBUTES, VSETATTRIBUTES (requires
--features vectors)
Transactions & Scripting
Section titled âTransactions & Scriptingâ- â Transactions - MULTI, EXEC, DISCARD, WATCH, UNWATCH
- â Lua Scripting - EVAL, EVALSHA (not supported)
Connection & Authentication
Section titled âConnection & Authenticationâ- â
Authentication - AUTH, password support via
--passwordflag - â Client Commands - CLIENT SETNAME, GETNAME, LIST, ID, INFO, KILL, PAUSE, UNPAUSE
Server-Only Features
Section titled âServer-Only FeaturesâThese features require server mode and are not available in embedded library mode:
Blocking Operations
Section titled âBlocking OperationsâCommands that wait for data with timeouts:
BLPOP,BRPOP- Blocking list operationsXREAD BLOCK- Blocking stream readsBRPOPLPUSH,BLMOVE- Blocking list moves
Server-only limitation: Cross-client coordination requires a central server process to manage waiters.
Pub/Sub
Section titled âPub/SubâMessaging via publish/subscribe channels:
SUBSCRIBE,UNSUBSCRIBE- Channel subscriptionsPSUBSCRIBE,PUNSUBSCRIBE- Pattern subscriptionsPUBLISH- Publish messages
Server-only limitation: Message routing requires a central broker to maintain subscriber lists.
Custom Commands
Section titled âCustom CommandsâRedlite adds commands that Redis doesnât have:
Delete expired keys and run SQLite VACUUM:
127.0.0.1:6379> VACUUMOKLibrary mode:
db.vacuum()?;Use cases:
- Remove expired keys (lazy expiration only deletes on read)
- Reclaim disk space (SQLite VACUUM compacts database file)
- Maintenance operations
KEYINFO
Section titled âKEYINFOâGet detailed metadata about a key:
127.0.0.1:6379> KEYINFO mykey1) "type"2) "string"3) "ttl"4) (integer) 36000005) "created_at"6) (integer) 17040672000007) "updated_at"8) (integer) 1704067200000Library mode:
let info = db.keyinfo("mykey")?;println!("Type: {:?}, TTL: {:?}", info.key_type, info.ttl);Fields:
type- Key type (string, hash, list, set, zset, stream)ttl- Time-to-live in milliseconds (nil if no expiration)created_at- Creation timestamp (milliseconds)updated_at- Last update timestamp (milliseconds)
HISTORY
Section titled âHISTORYâTrack and query historical data with time-travel queries:
# Enable history tracking127.0.0.1:6379> HISTORY ENABLE KEY mykey RETENTION COUNT 100OK
# Query history127.0.0.1:6379> HISTORY GET mykey LIMIT 10[... history entries ...]
# Time-travel query127.0.0.1:6379> HISTORY GETAT mykey 1704067200000"historical_value"See History Tracking for full documentation.
Differences from Redis
Section titled âDifferences from RedisâExpiration
Section titled âExpirationâRedlite uses lazy expiration:
- Expired keys checked on read access
- Manual cleanup via
VACUUMcommand - No background expiration daemon
Implementation rationale: Expired keys remain on disk until accessed or explicitly removed via VACUUM.
Persistence
Section titled âPersistenceâRedlite persists data by default:
- All writes committed to SQLite database file
- ACID guarantees via SQLiteâs transaction system
- No separate
SAVEorBGSAVEcommands
Implementation: SQLite WAL mode provides durability without requiring manual persistence configuration.
Transactions
Section titled âTransactionsâServer mode provides MULTI/EXEC for command batching:
127.0.0.1:6379> MULTIOK127.0.0.1:6379> SET key1 value1QUEUED127.0.0.1:6379> SET key2 value2QUEUED127.0.0.1:6379> EXEC1) OK2) OKUse WATCH for optimistic locking (check-and-set):
127.0.0.1:6379> WATCH mykeyOK127.0.0.1:6379> GET mykey"100"127.0.0.1:6379> MULTIOK127.0.0.1:6379> SET mykey 101QUEUED127.0.0.1:6379> EXEC1) OK# Returns nil if mykey was modified by another clientRedis Documentation
Section titled âRedis DocumentationâFor detailed command syntax and behavior, see:
Redlite implements the RESP protocol and aims for command-level compatibility with Redis.