File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
1
# Rust Service
2
- > CRUD with Rust using posgres and sqlx
2
+ > CRUD with Rust using postgres, actix, and sqlx
3
3
4
4
5
5
## Build Setup
8
8
# install dependencies
9
9
cargo build
10
10
```
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
+ ```
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ async fn main() -> std::io::Result<()> {
23
23
let database_url = std:: env:: var ( "DATABASE_URL" ) . expect ( "DATABASE_URL must be set" ) ;
24
24
let pool = match PgPoolOptions :: new ( ) . max_connections ( 10 ) . connect ( & database_url) . await {
25
25
Ok ( pool) => {
26
- println ! ( "✅Connection to the database is successful!" ) ;
26
+ println ! ( "✅ Connection to the database is successful!" ) ;
27
27
pool
28
28
}
29
29
Err ( err) => {
@@ -48,4 +48,4 @@ async fn main() -> std::io::Result<()> {
48
48
} )
49
49
. bind ( ( "127.0.0.1" , 8000 ) ) ?
50
50
. run ( ) . await
51
- }
51
+ }
You can’t perform that action at this time.
0 commit comments