Skip to content

krazyuniks/rust-sqlx-postgres-uow-async-threads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TODOs Example

Setup

  1. Create .env file if needed. Run docker-compose up -d to run Postgres in the background.

  2. Declare the database URL

    export DATABASE_URL="postgres://postgres:password@localhost/todos"
    

    Access from command line like:

    psql postgresql://postgres:password@localhost/todos -c 'select * from t
    

odos' ```

  1. Create the database.

    $ sqlx db create
    
  2. Run sql migrations

    $ sqlx migrate run
    

Usage

Add a todo

cargo run -- add "todo description"

Complete a todo.

cargo run -- done <todo id>

List all todos

cargo run

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages