Skip to content

Guide to logging in with Axum + Diesel + PostgreSQL 😜

Notifications You must be signed in to change notification settings

kyunghyunHan/axum_login_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

axum_login_example

  • In this example, axum, diesel, and postgresSQL are used to log in and sign up.

Axum

postgresSQL

Diesel

rustup update stable.

diesel = { version = "2.1.0", features = ["postgres"] }
dotenvy = "0.15"
cargo install diesel_cli --no-default-features --features postgres

DATABASE_URL=postgres://username:password@localhost/diesel_demo

diesel setup

diesel migration generate "migration name"

  • up.sql
CREATE TABLE posts (
  id SERIAL PRIMARY KEY,
  title VARCHAR NOT NULL,
  body TEXT NOT NULL,
  published BOOLEAN NOT NULL DEFAULT FALSE
)
  • down.sql
DROP TABLE posts
diesel migration run

About

Guide to logging in with Axum + Diesel + PostgreSQL 😜

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published