Rust SQL

Open-source Rust projects categorized as SQL

Top 15 Rust SQL Projects

  • diesel

    A safe, extensible ORM and Query Builder for Rust

    Latest mention: What has been your experience creating a web app with Rust vs other languages | reddit.com/r/rust | 2021-01-16

    I'm very comfortable with SQL but I still prefer the interface provided by ORMs for the simpler operations, as long as they have an escape hatch that allows for raw SQL when needed. AFAIK there is nothing in Rust right now that comes close to what Python offers there. I think the most developped one right now is Diesel, but it intentionally skips convenience methods for simpler joins like frameworks in other languages have. It also doesn't support async (https://github.com/diesel-rs/diesel/issues/399) which is a shame.

  • sqlx

    🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, SQLite, and MSSQL.

    Latest mention: What has been your experience creating a web app with Rust vs other languages | reddit.com/r/rust | 2021-01-16

    I'm gonna give somewhat of a different opinion than all the other guys: I've explored Rust web development a little during a week I took at the end of last year to widen my tech knowledge, and in my opinion it's just not there. The language is beautiful, but the amount of libraries is simply not enough. Both warp and tide are great starting points, but I found database access to be lackluster. SQLx is fine but can't fetch *-to-many associations (https://github.com/launchbadge/sqlx/issues/298 - this is blocked by a language feature) and diesel is not async. Template engines are good (very much like askama), so we have good support there. What I dearly missed is automatic OpenAPI spec generation based on endpoints and comments - ASP.Net is absolutely amazing in regards to that and has never disappointed me. I also don't really like rolling my own authentication scheme, although others might be okay with that. Rust-crypto is pretty great. In general I didn't find productivity to be very high, taking much longer to accomplish the same site compared to using Phoenix and its generators that do most of the work for me.

  • zombodb

    Making Postgres and Elasticsearch work together like it's 2021

    Latest mention: What Are Your Moves Tomorrow, January 18, 2021 | reddit.com/r/wallstreetbets | 2021-01-17
  • rust-postgres

    Native PostgreSQL driver for the Rust programming language

    Latest mention: How Mandarine Framework could surpass NestJS | dev.to | 2020-10-28

    This driver makes use of tokio-postgres under the hood, a widely-used Rust driver for postgres which has been out there for more than 4 years.

  • fselect

    Find files with SQL-like queries

  • rusqlite

    Ergonomic bindings to SQLite for Rust

    Latest mention: Learning Rust 2: A Tiny Database is Born | dev.to | 2020-08-30

    The architecture for this kind of system can be really straightforward: a repository consists of a chronological list of Revisions, each of which consists of one or more Changes. Each Change is a transformation applied to a file. At least to start with we'll model every Change as completely replacing the previous state of the file since diffs and merging aren't necessary when we don't have collaboration features. We could store all this in many different ways but I figure SQLite is a reasonably scalable solution that seems to have bindings for Rust available. I'm not looking forward to manual management of database connections but this is part of what learning Rust is.

  • gluesql

    GlueSQL is quite sticky, it attaches to anywhere.

    Latest mention: Rusticles #10 - Wed Sep 09 2020 | dev.to | 2020-09-09

    gluesql/gluesql (Rust): GlueSQL is quite sticky, it attaches to anywhere.

  • rust-mysql-simple

    Mysql client library implemented in rust.

  • mysql_async

    Asyncronous Rust Mysql driver based on Tokio.

    Latest mention: Hey Rustaceans! Got an easy question? Ask here (1/2021)! | reddit.com/r/rust | 2021-01-06

    I'm way ahead of you. I found out about it because I noticed the impl Clone for Pool at the bottom and clicked the [src] button to verify that the pool was shared among clones.

  • rustorm

    an orm for rust

  • deuterium

    Fully typed SQL query builder for Rust [deprecated]

  • mysql-proxy-rs

    A highly scalable MySQL Proxy framework written in Rust

  • sqlite

    Interface to SQLite

  • rust-sqlite3

    Rustic bindings for sqlite3

  • treasure

    ORM for rust (journey begins)

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

Index

What are some of the best open-source SQL projects in Rust? This list will help you:

Project Stars
1 diesel 6,353
2 sqlx 3,269
3 zombodb 3,172
4 rust-postgres 2,018
5 fselect 1,819
6 rusqlite 946
7 gluesql 439
8 rust-mysql-simple 404
9 mysql_async 201
10 rustorm 199
11 deuterium 167
12 mysql-proxy-rs 144
13 sqlite 73
14 rust-sqlite3 52
15 treasure 39