3 ms·
Show HN: SQL++ – 5x faster than Prisma (Rust)
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 https://github.com/sinisterMage/sqlpp
Benchmarks: https://github.com/sinisterMage/sqlpp/tree/main/benchmarks https://github.com/sinisterMage/sqlpp/tree/main/benchmarks
- yencabulator 11mo ago> 3. Binary protocol - implemented PostgreSQL wire protocol from scratch Any chance of contributing to https://crates.io/crates/pgwire 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 https://crates.io/crates/sqlparser ?
- NuSkooler 11mo agoI don't quite understand the name. Sort of follows the "I wrote this in C++" convention of naming.
- alloysmila 11mo agoWhat is the point of comparing with prisma? prisma is javascript, it's already likely to be slower.
- brudgers 11mo agoSome previous comments on Show HN, https://news.ycombinator.com/item?id=44136884 https://news.ycombinator.com/item?id=44136884