MCPcopy Create free account
hub / github.com/buffdb/buffdb / Queryable

Interface Queryable

src/queryable.rs:9–31  ·  view source on GitHub ↗

A trait for types that can execute raw queries.

Source from the content-addressed store, hash-verified

7
8/// A trait for types that can execute raw queries.
9pub trait Queryable {
10 /// The type of a connection to the database.
11 type Connection;
12
13 /// The type of a stream containing the query results.
14 type QueryStream: Stream<Item = Result<QueryResult, Status>> + Unpin;
15
16 /// Execute a query and return a stream of results.
17 ///
18 /// The connection is passed by ownership, but must be returned in the output tuple.
19 fn query(
20 query: String,
21 conn: Self::Connection,
22 ) -> impl Future<Output = (Self::QueryStream, Self::Connection)> + Send;
23
24 /// Execute a query that does not return rows, but returns the number of rows changed.
25 ///
26 /// This is used for queries that modify the database.
27 fn execute(
28 query: String,
29 conn: Self::Connection,
30 ) -> impl Future<Output = (Result<RowsChanged, Status>, Self::Connection)> + Send;
31}

Callers

nothing calls this directly

Implementers 1

sqlite.rssrc/backend/sqlite.rs

Calls

no outgoing calls

Tested by

no test coverage detected