Struct libsql_client::ResultSet
source · pub struct ResultSet {
pub columns: Vec<String>,
pub rows: Vec<Row>,
pub rows_affected: u64,
pub last_insert_rowid: Option<i64>,
}
Expand description
Represents the result of a database query
§Examples
let db = libsql_client::SyncClient::in_memory().unwrap();
let rs = db.execute("create table example(num integer, str text)").unwrap();
assert_eq!(rs.columns.is_empty(), true);
assert_eq!(rs.rows.is_empty(), true);
assert_eq!(rs.rows_affected, 0);
assert_eq!(rs.last_insert_rowid, None);
db.execute("insert into example (num, str) values (0, 'zero')").unwrap();
let rs = db.execute("select * from example").unwrap();
assert_eq!(rs.columns, ["num", "str"]);
assert_eq!(rs.rows.len(), 1)
Fields§
§columns: Vec<String>
name of the columns present in this ResultSet
.
rows: Vec<Row>
One entry per row returned from the database. See Row for details.
rows_affected: u64
How many rows were changed by this statement
last_insert_rowid: Option<i64>
the rowid for last insertion. See https://www.sqlite.org/c3ref/last_insert_rowid.html for details
Trait Implementations§
source§impl<'de> Deserialize<'de> for ResultSet
impl<'de> Deserialize<'de> for ResultSet
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<StmtResult> for ResultSet
impl From<StmtResult> for ResultSet
source§fn from(value: StmtResult) -> Self
fn from(value: StmtResult) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for ResultSet
impl Send for ResultSet
impl Sync for ResultSet
impl Unpin for ResultSet
impl UnwindSafe for ResultSet
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request