1
0
mirror of https://github.com/actix/examples synced 2024-11-27 16:02:57 +01:00
examples/async_db
Stefano Probst 25f7ce87b4
Fix bug in database script
Fix error that occurs if script is used like in the async_db readme.

Error before this change:
``` bash
$ LANG=C bash db/setup_db.sh
db/setup_db.sh: line 2: db.sql: No such file or directory
Error: cannot open "nyc_centralpark_weather.csv
```
2019-05-24 20:34:08 +02:00
..
db Fix bug in database script 2019-05-24 20:34:08 +02:00
src update to beta.1 2019-04-21 09:36:31 -07:00
Cargo.toml upgrade actix-web 2019-05-12 11:58:26 -07:00
README.md added async_db project 2018-05-26 17:05:12 -04: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 (or ``cargo watch -x run``)
# Started http server: 127.0.0.1:8080

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;