Skip to content

ryykdev/restapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup Postgres and Diesel

link: https://blog.ediri.io/rust-development-creating-a-rest-api-with-actix-web-for-beginners https://blog.ediri.io/building-a-restful-api-with-actix-web-and-diesel-for-persistent-data-storage

https://github.com/dirien/quick-bites/tree/main/rust-actix-web-rest-api-diesel

Setup postgres

postgres port is set to port 5432 is routed to 5432 database-name: data name: superuser pass: superpassword

deploy and start db in docker:

docker-compose -f postgres.yaml up -d

Migrations

  • To make a migration run:

diesel setup

diesel migration generate create_targets

  • To generate the postgres tabel: diesel migration run

generate table

diesel migration generate targets

migrate

  • run diesel migration run

Connect to your db

or

psql -h localhost -p 5432 -U superuser

NEXT

deploy db to docker, access db using pgAdmin

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published