Rust
Supported projects
The following project is recommended for implementing Rust applications using the YugabyteDB YSQL API.
Project | Documentation and Guides | Example Apps |
---|---|---|
Diesel | Documentation Hello World |
Diesel app |
Learn how to establish a connection to a YugabyteDB database and begin basic CRUD operations using the Hello World examples.
For fully-runnable code snippets and explanations of common operations, see the example apps. Before running the example apps, make sure you have installed the prerequisites.
Prerequisites
To develop Rust applications for YugabyteDB, you need the following:
-
Rust
To download and install Rust, refer to the Rust documentation.
To check the version of Rust, use the following command:$ rustc --version
-
Create a Rust project
To create a new Rust project, run the following command:$ cargo new HelloWorld-rust
This creates the project as
HelloWorld-rust
which consists of aCargo.toml
file (project metadata) and asrc
directory containing the main code file,main.rs
. -
YugabyteDB cluster
- Create a free cluster on YugabyteDB Managed. Refer to Use a cloud cluster. Note that YugabyteDB Managed requires SSL.
- Alternatively, set up a standalone YugabyteDB cluster by following the steps in Install YugabyteDB.