1
0
mirror of https://github.com/actix/examples synced 2024-11-27 16:02:57 +01:00
examples/databases/sqlite
2023-01-07 15:23:31 +00:00
..
db Fix incorrect spelling of file setup_db.sh (#593) 2022-12-17 15:33:03 +00:00
src group imports 2022-07-09 21:08:11 +01:00
.gitignore restructure folders 2022-02-18 02:01:48 +00:00
Cargo.toml update deps 2023-01-07 15:23:31 +00:00
README.md format markdown 2022-03-06 00:43:10 +00:00

Getting started using databases with Actix Web, asynchronously.

Usage

init database sqlite

From the root directory of this project:

bash db/setup_db.sh

This creates a sqlite database, weather.db, in the root.

server

# if ubuntu : sudo apt-get install libsqlite3-dev
# if fedora : sudo dnf install libsqlite3x-devel
cargo run

web client

http://127.0.0.1:8080/asyncio_weather

http://127.0.0.1:8080/parallel_weather

sqlite client

# if ubuntu : sudo apt-get install sqlite3
# if fedora : sudo dnf install sqlite3x
sqlite3 weather.db
sqlite> .tables
sqlite> select * from nyc_weather;

Dependencies

On Ubuntu 19.10:

sudo apt install libsqlite3-dev