You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/v3/sqlite-api-guide.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,6 @@ serde_json = "1.0"
57
57
SQLite functions are available in the `spin_sdk::sqlite` module. The function names match the operations above. For example:
58
58
59
59
```rust
60
-
useanyhow::Result;
61
60
useserde::Serialize;
62
61
usespin_sdk::{
63
62
http::{Request, Response, IntoResponse},
@@ -108,7 +107,7 @@ struct ToDo {
108
107
}
109
108
```
110
109
111
-
**General Notes**
110
+
**General Notes**
112
111
* All functions are on the `spin_sdk::sqlite::Connection` type.
113
112
* Parameters are instances of the `Value` enum; you must wrap raw values in this type.
114
113
* 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.
@@ -165,7 +164,7 @@ class IncomingHandler(http.IncomingHandler):
165
164
with sqlite.open_default() as db:
166
165
result = db.execute("SELECT * FROM todos WHERE id > (?);", [ValueInteger(1)])
0 commit comments