MCPcopy Create free account
hub / github.com/chatmail/core / row_get_vec

Function row_get_vec

src/sql.rs:916–923  ·  view source on GitHub ↗

Get the value of a column `idx` of the `row` as `Vec `.

(row: &Row, idx: usize)

Source from the content-addressed store, hash-verified

914
915/// Get the value of a column `idx` of the `row` as `Vec<u8>`.
916pub fn row_get_vec(row: &Row, idx: usize) -> rusqlite::Result<Vec<u8>> {
917 row.get(idx).or_else(|err| match row.get_ref(idx)? {
918 ValueRef::Null => Ok(Vec::new()),
919 ValueRef::Text(text) => Ok(text.to_vec()),
920 ValueRef::Blob(blob) => Ok(blob.to_vec()),
921 ValueRef::Integer(_) | ValueRef::Real(_) => Err(err),
922 })
923}
924
925/// Enumerates used files in the blobdir and removes unused ones.
926#[expect(clippy::arithmetic_side_effects)]

Callers 1

get_htmlMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected