MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / stream

Method stream

src/database/db_connection.rs:219–242  ·  view source on GitHub ↗
(
        &'a self,
        stmt: Statement,
    )

Source from the content-addressed store, hash-verified

217 #[instrument(level = "trace")]
218 #[allow(unused_variables)]
219 fn stream<'a>(
220 &'a self,
221 stmt: Statement,
222 ) -> Pin<Box<dyn Future<Output = Result<Self::Stream<'a>, DbErr>> + 'a + Send>> {
223 Box::pin(async move {
224 match self {
225 #[cfg(feature = "sqlx-mysql")]
226 DatabaseConnection::SqlxMySqlPoolConnection(conn) => conn.stream(stmt).await,
227 #[cfg(feature = "sqlx-postgres")]
228 DatabaseConnection::SqlxPostgresPoolConnection(conn) => conn.stream(stmt).await,
229 #[cfg(feature = "sqlx-sqlite")]
230 DatabaseConnection::SqlxSqlitePoolConnection(conn) => conn.stream(stmt).await,
231 #[cfg(feature = "mock")]
232 DatabaseConnection::MockDatabaseConnection(conn) => {
233 Ok(crate::QueryStream::from((Arc::clone(conn), stmt, None)))
234 }
235 #[cfg(feature = "proxy")]
236 DatabaseConnection::ProxyDatabaseConnection(conn) => {
237 Ok(crate::QueryStream::from((Arc::clone(conn), stmt, None)))
238 }
239 DatabaseConnection::Disconnected => Err(conn_err("Disconnected")),
240 }
241 })
242 }
243}
244
245#[async_trait::async_trait]

Callers

nothing calls this directly

Calls 1

conn_errFunction · 0.85

Tested by

no test coverage detected