1
0
mirror of https://github.com/actix/examples synced 2025-06-26 17:17:42 +02:00

update sqlx dep to 0.7

This commit is contained in:
Rob Ede
2023-07-09 02:05:10 +01:00
parent 4bfe63857e
commit 1ca11e70e8
11 changed files with 524 additions and 103 deletions

View File

@ -14,5 +14,5 @@ env_logger.workspace = true
log.workspace = true
serde.workspace = true
serde_json.workspace = true
sqlx = { version = "0.6", features = ["runtime-tokio-rustls", "sqlite", "offline"] }
sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "sqlite"] }
tera = "1.5"

View File

@ -6,12 +6,13 @@ A simple Todo project using a SQLite database.
- SQLite 3
## Change Into This Project Sub Directory
## Change Into The Examples Workspace Root Directory
All instructions assume you have changed into this folder:
All instructions assume you have changed into the examples workspace root:
```sh
cd basics/todo
```pwd
$ pwd
.../examples
```
## Set Up The Database
@ -34,7 +35,7 @@ sqlx migrate run
Start the application with:
```sh
cargo run
cargo run --bin=todo
```
The app will be viewable in the browser at <http://localhost:8080>.
@ -44,5 +45,5 @@ The app will be viewable in the browser at <http://localhost:8080>.
For simplicity, this example uses SQLx's offline mode. If you make any changes to the database schema, this must be turned off or the `sqlx-data.json` file regenerated using the following command:
```sh
DATABASE_URL="sqlite://$(pwd)/todo.db" cargo sqlx prepare
cargo sqlx prepare --database-url=sqlite://./todo.db
```

View File

@ -1,63 +0,0 @@
{
"db": "SQLite",
"2f4086eab47b13298a107ed8c0feaadab903468b8e4fbd39e465f581c7189272": {
"query": "\n DELETE FROM tasks\n WHERE id = $1\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 1
},
"nullable": []
}
},
"37443376215969e31bc6bc1ee00f01044647d95caf8efc61df7bf333b6a2149d": {
"query": "\n UPDATE tasks\n SET completed = NOT completed\n WHERE id = $1\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 1
},
"nullable": []
}
},
"3a5b2a81088aa91ade3106165f926c337a88f4e29ae3bb170c4b687208aba20d": {
"query": "\n SELECT *\n FROM tasks\n ",
"describe": {
"columns": [
{
"name": "id",
"ordinal": 0,
"type_info": "Int64"
},
{
"name": "description",
"ordinal": 1,
"type_info": "Text"
},
{
"name": "completed",
"ordinal": 2,
"type_info": "Bool"
}
],
"parameters": {
"Right": 0
},
"nullable": [
false,
false,
false
]
}
},
"ab058898a8a1b13174d03c9972af33214619f8aa3080bc27f88bd5b9212b8c0f": {
"query": "\n INSERT INTO tasks (description)\n VALUES ($1)\n ",
"describe": {
"columns": [],
"parameters": {
"Right": 1
},
"nullable": []
}
}
}