
Rust
Following are the recommended projects for implementing Rust Applications for YugabyteDB YSQL API.
Project | Type | Support Level |
---|---|---|
Diesel | ORM | Full |
Build a Hello World app
Learn how to establish a connection to YugabyteDB database and begin basic CRUD operations using the steps in Build an Application in the Quick Start section.
Prerequisites for building a Rust application
Install Rust
Make sure that your system has Rust installed. You can find installation instructions on the Rust site. To check the version of Rust installed, 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 a Cargo.toml
file (this contains the project metadata) and a src
directory containing the main code file, main.rs
.
To run the Rust project, execute the following command in the project directory:
$ cargo run
Create a YugabyteDB cluster
Create a free cluster on YugabyteDB Managed. Refer to Create a free cluster.
You can also set up a standalone YugabyteDB cluster by following the steps in Install YugabyteDB.
Usage examples
For fully runnable code snippets and explanations of common operations, see the specific Rust driver and ORM section. The following table provides links to driver-specific documentation and examples.
Project | Type | Usage Examples |
---|---|---|
Diesel | ORM | HelloWorld App CRUD App |