1
0
mirror of https://github.com/actix/examples synced 2024-11-23 22:41:07 +01:00
examples/database_interactions/sqlx_todo
2022-02-02 01:45:20 +00:00
..
src Update db/basic, db/sqlx_todo and db/r2d2 to v4 (#506) 2022-01-29 16:25:46 +00:00
.env.example improve sqlx example 2021-10-07 03:00:13 +01:00
.gitignore ignore protobuf-example in ci 2021-10-06 23:12:42 +01:00
Cargo.toml all versions are 1.0 2022-02-02 01:45:20 +00:00
README.md Update db/basic, db/sqlx_todo and db/r2d2 to v4 (#506) 2022-01-29 16:25:46 +00:00
schema.sql Fix sqlx_todo CI checks (#415) 2021-03-03 23:37:17 +09:00
setup_db.sh Update db/basic, db/sqlx_todo and db/r2d2 to v4 (#506) 2022-01-29 16:25:46 +00:00

actix-sqlx-todo

Example Todo application using Actix-web and SQLx with sqlite

Usage

Prerequisites

  • Rust
  • SQLite

Change into the project sub-directory

All instructions assume you have changed into this directory:

$ cd database_interactions/sqlx_todo

Set up the database

  • Create new database:
./setup_db.sh
  • Copy .env.example into .env and adjust DATABASE_URL to match your SQLite address, if needed
cat schema.sql | sqlite3 test.db
cp .env.example .env

Run the application

To run the application execute:

cargo run

By default the application will be available on http://localhost:8080. If you wish to change address or port you can do it inside the .env file