Our great sponsors
-
sqlx
🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite. (by launchbadge)
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
SQLx uses some inference heuristics that will break some valid PostgreSQL queries (e.g. https://github.com/launchbadge/sqlx/issues/1266, https://github.com/launchbadge/sqlx/issues/1980). The error messages can be jarring sometimes. Cornucopia doesn't use any heuristics and gets its type inference directly from rust-postgres. I have yet to see Cornucopia fail to generate code from valid SQL.
respository | book | crates.io | discord
Performance is always a hot topic, so take this with a grain of salt, but in our benchmarks, Cornucopia performs very close to the rust-postgres drivers, which themselves beat SQLx by a significant margin in the ubiquitous db interface benchmarks provided by Diesel (https://github.com/diesel-rs/metrics). Take this with a grain of salt though, since this is an indirect comparison. We'll try to provide a direct comparison with SQLx in our benchmarks as soon as possible.
Related posts
- SQLX MSSQL Connection String Problem
- SQLx 0.7 released! Offline mode usability improvements, performance fixes and major upgrades across the board!
- MariaDB / SQLx - "Unknown Authentication Plugin"
- What do you think about macros that use remote source to calculate its result?
- Ask HN: Why is there no database with a functional query language?