Connect a Rust application to Neon
Set up a Neon project in seconds and connect from a Rust application
This guide describes how to create a Neon project and connect to it from a Rust application.
Create a Neon project
If you do not have one already, create a Neon project. Save your connection string and password. They are required when defining connection settings.
To create a Neon project:
- Navigate to the Projects page in the Neon Console.
- Click New Project.
- Specify your project settings and click Create Project.
Configure the connection
Add the Neon connection details to your main.rs
file, as in the following example:
where:
<user>
is the database user.<password>
is the database user's password.<dbname>
is the name of the database. The default Neon database isneondb
<hostname>
is the hostname of the branch's compute endpoint. The hostname has anep-
prefix and appears similar to this:ep-tight-salad-272396.us-east-2.aws.neon.tech
.
You can find all of the connection details listed above in the Connection Details widget on the Neon Dashboard. For more information, see Connect from any application.
Need help?
Send a request to support@neon.tech, or join the Neon community forum.