Show HN: SQL++ – 5x faster than Prisma (Rust)

https://github.com/sinisterMage/sqlpp
by SinisterMage2 • 8 months ago
2 4 8 months ago

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

Related Stories

Loading related stories...

Source preview

github.com