| I built SQL++, a type-safe SQL library for Rust using PostgreSQL's binary protocol. Benchmarks vs Prisma (5,000-10,000 queries):
- Simple queries: 1.5x faster
- Complex aggregations: 19.9x faster
- Batch inserts: 5.6x faster
- Average: 5x faster One benchmark didn't finish in Prisma (crashed), SQL++ completed in 2.5min. Why faster:
1. No runtime query building - validates once, caches forever
2. Zero ORM overhead - direct struct mapping
3. Binary protocol - implemented PostgreSQL wire protocol from scratch Currently supports:
- Full SQL (CTEs, window functions, JOINs, subqueries)
- DDL (CREATE/ALTER/DROP TABLE, indexes)
- ~60% of SQL spec Limitations:
- PostgreSQL only
- v0.1 (expect bugs)
- No ORM relationships (by design) Built as a high school project. Feedback welcome! GitHub: https://github.com/sinisterMage/sqlpp
Benchmarks: https://github.com/sinisterMage/sqlpp/tree/main/benchmarks |
Any chance of contributing to https://crates.io/crates/pgwire ? pgwire has been great on the server end for me, and it would make sense to have a single high-quality implementation of the whole protocol.
Also, your SQL parser is gonna miss out on a lot of the very complex language. Have you seen https://crates.io/crates/sqlparser ?