A lightweight, MySQL-compatible SQL server with dual-protocol support (SQL over TCP + HTTP JSON API), featuring full-text search, dynamic caching, and Redis-like key-value capabilities.
- SQL Engine: Pest-based parser supporting SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, JOINs, Subqueries, Aggregations, and more.
- MySQL Compatible: Native TCP support on port 3306. Connect via standard
mysqlCLI or GUI tools. - Full-Text Search: Integrated Tantivy-powered search with
SEARCHcommand. - Persistence: Hybrid in-memory storage with Sled-based snapshotting.
- HTTP API: Axum-based JSON API supporting both standard SQL (
POST /_query) and JSqueal JSON-based queries (POST /_jsqueal). - Squeal IR: Unified internal representation for queries, decoupling parser from execution logic.
- Backup & Restore: Export and import full database state as SQL scripts.
- REPL: Interactive CLI client for manual querying and management.
- Observability: Built-in
EXPLAINsupport for query plan visualization.
# Start the server (default HTTP port 9200)
cargo run -p thy-squealcurl -X POST http://localhost:9200/_jsqueal -H "Content-Type: application/json" -d '{
"squeal": {
"Select": {
"table": "users",
"columns": [{ "expr": "Star" }],
"where_clause": {
"Comparison": [
{ "Column": "id" },
"Eq",
{ "Literal": { "Int": 1 } }
]
}
}
}
}'# Start the interactive REPL
cargo run -p thy-squeal-client
# Export database to a file
cargo run -p thy-squeal-client -- --export backup.sql
# Import database from a file
cargo run -p thy-squeal-client -- --import backup.sql-- Create a table
CREATE TABLE users (id INT, name TEXT, email TEXT);
-- Insert data
INSERT INTO users (id, name, email) VALUES (1, 'Alice', 'alice@example.com');
-- Search data
SEARCH users 'alice';
-- Complex query
SELECT name, (SELECT COUNT(*) FROM posts WHERE user_id = users.id) as post_count
FROM users
WHERE id = 1;- MVP Architecture
- Product Requirements (PRD)
- Comparison with other Engines
- SQL Parser Details
- Implementation TODO
See AGENTS.md for development guidelines, commands, and project structure.
MIT
