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

Method count

src/sql.rs:410–413  ·  view source on GitHub ↗

Used for executing `SELECT COUNT` statements only. Returns the resulting count.

(&self, query: &str, params: impl rusqlite::Params + Send)

Source from the content-addressed store, hash-verified

408
409 /// Used for executing `SELECT COUNT` statements only. Returns the resulting count.
410 pub async fn count(&self, query: &str, params: impl rusqlite::Params + Send) -> Result<usize> {
411 let count: isize = self.query_row(query, params, |row| row.get(0)).await?;
412 Ok(usize::try_from(count)?)
413 }
414
415 /// Used for executing `SELECT COUNT` statements only. Returns `true`, if the count is at least
416 /// one, `false` otherwise.

Callers 15

startMethod · 0.80
format_flowedFunction · 0.80
truncateFunction · 0.80
get_real_cntMethod · 0.80
existsMethod · 0.80
decide_chat_assignmentFunction · 0.80
shorten_nameFunction · 0.80
get_msg_cntMethod · 0.80
get_fresh_msg_cntMethod · 0.80
donation_request_maybeFunction · 0.80

Calls 2

query_rowMethod · 0.80
getMethod · 0.45

Tested by 4

test_save_self_key_twiceFunction · 0.64
is_deletedFunction · 0.64
get_chat_cntFunction · 0.64