Skip to content

mikebelanger/ntex_sqlx_experiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ntex_sqlx_experiment

Just fooling around with ntex and sqlx

Stack

  • ntex
  • sqlx
  • markup.rs

To Run

  1. Make sure Postgres and latest Rust are installed. (I'm using rustc 1.73.0 (cc66ad468 2023-10-03)). Probably any newish Postgres will work.
  2. Install sqlx_cli:
cargo install sqlx-cli
  1. Set the database url env variable, and run migrations:
DATABASE_URL=postgres://postgres@localhost/path-to-my-db
sqlx migrate
  1. Boot up a process in this repo's root directory:
DATABASE_URL=postgres://postgres@localhost/path-to-my-db cargo run
  1. Visit localhost:8080 in your browser

Notes

  • Very WIP. Probably doesn't make sense. I'm just posting because I want help with something, and its easier to point to a repo than recreate on some forum.

  • You will have to manually create data in the db. First make a user row, then create some Todos based on that user id.