MCPcopy Create free account
hub / github.com/TankHQ/tank / execute

Method execute

tank-core/src/executor.rs:77–90  ·  view source on GitHub ↗

Executes a query and returns the total number of affected rows.

(
        &'s mut self,
        query: impl AsQuery<Self::Driver> + 's,
    )

Source from the content-addressed store, hash-verified

75
76 /// Executes a query and returns the total number of affected rows.
77 fn execute<'s>(
78 &'s mut self,
79 query: impl AsQuery<Self::Driver> + 's,
80 ) -> impl Future<Output = Result<RowsAffected>> + Send {
81 self.run(query)
82 .filter_map(|v| async move {
83 match v {
84 Ok(QueryResult::Affected(v)) => Some(Ok(v)),
85 Err(e) => Some(Err(e)),
86 _ => None,
87 }
88 })
89 .try_collect()
90 }
91
92 /// Efficiently inserts a collection of entities bypassing regular SQL execution when supported by the driver.
93 fn append<It>(&mut self, entities: It) -> impl Future<Output = Result<RowsAffected>> + Send

Callers

nothing calls this directly

Implementers 13

connection.rstank-sqlite/src/connection.rs
connection.rstank-duckdb/src/connection.rs
executor.rstank-mysql/src/executor.rs
pool.rstank-core/src/pool.rs
executor.rstank-core/src/executor.rs
connection.rstank-postgres/src/connection.rs
transaction.rstank-postgres/src/transaction.rs
connection.rstank-valkey/src/connection.rs
transaction.rstank-valkey/src/transaction.rs
connection.rstank-yourdb/src/connection.rs
connection.rstank-scylladb/src/connection.rs
transaction.rstank-scylladb/src/transaction.rs

Calls 2

SomeClass · 0.85
runMethod · 0.45

Tested by

no test coverage detected