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: wasm/wasi/wit/deps/hermes-sqlite/api.wit
+21-2Lines changed: 21 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,14 @@ interface api {
61
61
text(string)
62
62
}
63
63
64
+
/// The result of advancing a prepared SQLite statement by one step.
65
+
enumstep-result {
66
+
/// Indicates that the statement has finished executing.
67
+
done,
68
+
/// Indicates that there is a new row of result.
69
+
row,
70
+
}
71
+
64
72
/// The database connection object.
65
73
resourcesqlite {
66
74
/// Closes a database connection, destructor for `sqlite3`.
@@ -115,7 +123,11 @@ interface api {
115
123
/// Advances a statement to the next result row or to completion.
116
124
///
117
125
/// After a prepared statement has been prepared, this function must be called one or more times to evaluate the statement.
118
-
step:func() ->result<_, errno>;
126
+
///
127
+
/// ## Returns
128
+
///
129
+
/// A `step-result` indicating the status of the step.
130
+
step:func() ->result<step-result, errno>;
119
131
120
132
/// Returns information about a single column of the current result row of a query.
121
133
///
@@ -130,6 +142,13 @@ interface api {
130
142
/// The value of a result column in a specific data format.
131
143
column:func(index:u32) ->result<value, errno>;
132
144
145
+
/// Reset a prepared statement object back to its initial state, ready to be re-executed.
146
+
///
147
+
/// This function clears all previous bindings, resets the statement to the beginning,
148
+
/// and prepares it for another execution. This must be called before reusing a statement
149
+
/// with new parameter bindings.
150
+
reset:func() ->result<_, errno>;
151
+
133
152
/// Destroys a prepared statement object. If the most recent evaluation of the statement encountered no errors or if the statement is never been evaluated,
134
153
/// then the function results without errors. If the most recent evaluation of statement failed, then the function results the appropriate error code.
0 commit comments