Rust connectors for every well-known database

Ruststudio adds a Rust database driver to your project in one step and writes a runnable example that connects: 29 connectors for 18 databases, including PostgreSQL, MySQL, SQLite, SQL Server, Oracle, MongoDB and Redis, plus ODBC for the rest.

Updated · describes Ruststudio 0.1.7

Pick a database, pick a driver, and Ruststudio adds it with cargo and writes a runnable example that connects. 29 connectors for 18 databases, and ODBC for the rest.

Which Rust crate connects to which database?

Rust database drivers by database, as offered in Ruststudio’s Database Connectors
PostgreSQLsqlx, tokio-postgres, postgres, diesel, SeaORMAlso CockroachDB and Aurora PostgreSQL, which speak its protocol
MySQL and MariaDBsqlx, mysql_async, mysql, diesel, SeaORMAlso TiDB and PlanetScale
SQLiterusqlite, sqlx, libsqlEmbedded in your program; no server
SQL Server (MSSQL)tiberiusPure Rust; also reaches Azure SQL
Oracle DatabaseoracleThe oracle crate
MongoDBmongodbThe official driver
RedisredisAlso Valkey and ElastiCache
Cassandra and ScyllaDBscyllaAlso Amazon Keyspaces
Db2, Teradata, SAP HANA, Snowflakeodbc-apiThrough the database’s ODBC driver

What you get

SQL

PostgreSQL, MySQL, SQLite

sqlx, tokio-postgres, postgres, mysql_async, mysql, rusqlite, libsql, diesel and SeaORM, async and blocking, with the right features switched on.

Enterprise

SQL Server and Oracle

tiberius, a pure-Rust SQL Server driver that also reaches Azure SQL, and the oracle crate for Oracle Database.

NoSQL

MongoDB, Redis, Memcached

The official MongoDB driver, the standard redis client (Valkey and ElastiCache too) and a Memcached client.

Distributed

Cassandra and ScyllaDB

The pure-Rust scylla driver, which also talks to Apache Cassandra and Amazon Keyspaces.

Analytics

ClickHouse and DuckDB

An async ClickHouse client, and DuckDB embedded in your program.

Search and graph

Elasticsearch, OpenSearch, Neo4j, SurrealDB

The official search clients, an async Bolt driver for Neo4j and Memgraph, and the SurrealDB client.

Cloud

DynamoDB and anything with ODBC

The AWS SDK for DynamoDB, and odbc-api for Db2, Teradata, SAP HANA, Informix, Snowflake and other ODBC databases.

Packages

One API on rupm and NuGet

rs-db-sqlite, -postgres, -mysql, -sqlserver, -mongodb and -redis: connect, execute, query, transactions and JSON rows, the same in Rust and in C#.

Learn more: One API on rupm and NuGet

Compatible

Search by what you run

Type CockroachDB, MariaDB, TiDB, Valkey, Aurora or Cosmos DB for MongoDB and find the driver that speaks its protocol.

Try it

Try the database connectors

Search for a database or a compatible product, add a Rust driver to the project, and read the example it writes.

Ruststudio · Database ConnectorsInteractive · simulated

RaftDB: 1 connector(s)

  • raftdb-client: RaftDB's own client (binary protocol, no dependencies)
    Document and relational (JSON-native)blocking
    Also works with Raft DB, all in one database, JSON documents with SQL.

Try it: type “postgres”, pick sqlx or tokio-postgres, press Add to project, then read the example it wrote. Typing “cockroach” or “valkey” finds the driver that works with them.

One click: dependency and a working example

Choose a connector under Tools, Database Connectors. Ruststudio runs cargo add with the features that driver needs (and the async runtime, when it needs one), then writes examples/db_<database>_<crate>.rs and opens it. Edit the connection string and press Ctrl+F5.

The catalogue is a table in Ruststudio itself, and every entry is checked against the real crates: the crate and feature names must resolve, and the example must compile. Drivers that need a native library, such as libpq for diesel, or a long C++ build, such as DuckDB, say so in the list.

  • Async drivers come with tokio and its macros
  • Blocking drivers need nothing extra
  • Examples never contain real passwords: change the placeholder connection string
  • Add as many connectors as you like; each gets its own example file

Connectors as packages

When you choose one of the six (SQLite, PostgreSQL, MySQL, SQL Server, MongoDB, Redis), Ruststudio offers the Ruststudio connector first and the driver second, and the example it writes uses the rs-db API. The connectors are published on the rupm registry for Rust and on the Ruststudio NuGet feed for .NET, so any project can use them.

Version 0.1 sends statements as text, has no TLS for PostgreSQL, MySQL and Redis, and ships the .NET native library for Windows x64.

How does it work?

  1. Open Database Connectors

    Tools, Database Connectors, or the command palette.

  2. Search

    Type a database, a crate or a compatible product (postgres, sqlx, cockroach).

  3. Choose a driver

    Ruststudio adds it to the project of the open file, or the startup project.

  4. Run the example

    Edit the connection string in the new example and press Ctrl+F5.

Frequently asked questions

Something else? Ask in the community forum or send feedback.

How do I connect to a database in Rust?

Add a driver crate for your database, open a connection with its connection string and run queries through the driver’s API; async drivers also need a runtime such as tokio. In Ruststudio, Tools, Database Connectors adds the crate with the right features and writes a runnable example.

Which Rust crate connects to SQL Server (MSSQL)?

tiberius, a pure-Rust SQL Server driver that also reaches Azure SQL. Ruststudio adds it with an example, and has an rs-db-sqlserver connector with a smaller API.

Which is the Rust PostgreSQL driver?

tokio-postgres (async) and postgres (blocking) are the dedicated drivers; sqlx, diesel and SeaORM also support PostgreSQL. All are in the connector list.

Can Rust connect to MySQL, MariaDB and Oracle?

Yes. MySQL and MariaDB use sqlx, mysql_async or mysql; Oracle Database uses the oracle crate.

What is RaftDB?

RaftDB is the free database included with Ruststudio. Install it from Tools, Install RaftDB; it is first in the connector list, and the full-stack web templates can store their items in it.

Which databases are covered?

PostgreSQL, MySQL and MariaDB, SQLite, SQL Server, Oracle, MongoDB, Redis, Memcached, Cassandra and ScyllaDB, ClickHouse, DuckDB, Elasticsearch, OpenSearch, Neo4j, SurrealDB, DynamoDB, and any database with an ODBC driver.

What about CockroachDB, Aurora, TiDB or Valkey?

They speak the protocol of a database above, so they use the same driver: CockroachDB and Aurora PostgreSQL use the PostgreSQL drivers, TiDB and PlanetScale the MySQL ones, Valkey the Redis client.

Does it install the database server?

No. It adds the Rust driver and an example. You bring the server, local or in the cloud, and its connection string.

Are these NuGet packages?

Six are, and they are rupm crates too. SQLite, PostgreSQL, MySQL, SQL Server, MongoDB and Redis have a Ruststudio connector with one small API (rs-db): cargo add rs-db-postgres --registry rupm, or for .NET dotnet add package Ruststudio.Db.Postgres --source https://www.ruststudio.org/nuget/v3/index.json. The other connectors are the drivers themselves from crates.io. Ruststudio also packs your own Rust libraries as NuGet packages for .NET, and restores native NuGet packages for Rust.

Is Ruststudio free?

Yes. Ruststudio is free for personal and commercial use, with no licence key and nothing to pay. Use it for 7 days straight away; after that you sign up for a free account with your e-mail address. It is closed-source freeware.

Who makes Ruststudio?

Ruststudio is a product of FOWLGUARD, Inc., the company behind Fowlguard Secure and Fowlguard Productivity. It is one of its free tools; see fowlguard.com.

Which systems does Ruststudio run on?

Windows 10 and 11 (64-bit), macOS 11 or later (Apple silicon and Intel) and Linux (x86-64, X11 or Wayland). You can build for the desktop, the web and Android from it. Native iOS support is in development and will need a Mac with Xcode.