Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions content/v3/sqlite-api-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ serde_json = "1.0"
SQLite functions are available in the `spin_sdk::sqlite` module. The function names match the operations above. For example:

```rust
use anyhow::Result;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this used on line 69 (the return value of handle_request? I might be misunderstanding.

use serde::Serialize;
use spin_sdk::{
http::{Request, Response, IntoResponse},
Expand Down Expand Up @@ -108,7 +107,7 @@ struct ToDo {
}
```

**General Notes**
**General Notes**
* All functions are on the `spin_sdk::sqlite::Connection` type.
* Parameters are instances of the `Value` enum; you must wrap raw values in this type.
* The `execute` function returns a `QueryResult`. To iterate over the rows use the `rows()` function. This returns an iterator; use `collect()` if you want to load it all into a collection.
Expand Down Expand Up @@ -165,7 +164,7 @@ class IncomingHandler(http.IncomingHandler):
with sqlite.open_default() as db:
result = db.execute("SELECT * FROM todos WHERE id > (?);", [ValueInteger(1)])
rows = result.rows

return Response(
200,
{"content-type": "text/plain"},
Expand Down