Skip to content

Commit 7bf488b

Browse files
committed
chore: add some other commands to build, and run
1 parent 5dbcc5f commit 7bf488b

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Rust Service
2-
> CRUD with Rust using posgres and sqlx
2+
> CRUD with Rust using postgres, actix, and sqlx
33
44

55
## Build Setup
@@ -8,3 +8,15 @@
88
# install dependencies
99
cargo build
1010
```
11+
12+
## Migrate
13+
14+
```
15+
sqlx migrate run
16+
```
17+
18+
### Run project
19+
20+
```
21+
docker-compose up -d && cargo watch -q -c -w src/ -x run
22+
```

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async fn main() -> std::io::Result<()> {
2323
let database_url = std::env::var("DATABASE_URL").expect("DATABASE_URL must be set");
2424
let pool = match PgPoolOptions::new().max_connections(10).connect(&database_url).await {
2525
Ok(pool) => {
26-
println!("✅Connection to the database is successful!");
26+
println!("✅ Connection to the database is successful!");
2727
pool
2828
}
2929
Err(err) => {
@@ -48,4 +48,4 @@ async fn main() -> std::io::Result<()> {
4848
})
4949
.bind(("127.0.0.1", 8000))?
5050
.run().await
51-
}
51+
}

0 commit comments

Comments
 (0)