Skip to content

This is a simple POC for a Rust Service Layer on top of Postgres using Diesel for database management and tokio_postgres for serving up data.

License

Notifications You must be signed in to change notification settings

musictopeople/tokio_postgres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a fun little POC for a Rust service layer. Click on my cute friend to make sure you have the latest version of Rust and Cargo.

cute rustacean

Next Click on the sweet Diesel logo to snag the diesel CLI and get up to speed.

diesel logo

I use a Linux machine so feel free to tweak these steps but the way I run this POC is by doing the following.

If you don't have docker on your computer now would be a great time to get it.

https://www.docker.com/

make sure you have docker on your machine.

docker -v

cd to your app directory and open the terminal in your IDE

start docker.

sudo systemctl start docker

check and see if the docker daemon is running

sudo docker ps -a

build and start the postgres db docker container

docker compose up

use diesel to run the migration which will add the greeting to the first row of the db.

diesel migration run

The table stucture is the exact same as the Diesel getting started example.

run the application, and see the greeting.

cargo run

About

This is a simple POC for a Rust Service Layer on top of Postgres using Diesel for database management and tokio_postgres for serving up data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published