mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-10-02 15:25:32 +00:00
Fix maraidb build errors
This commit is contained in:
parent
952fb0e7fc
commit
4d28424af5
@ -26,5 +26,5 @@ impl Backend for MariaDb {
|
||||
}
|
||||
}
|
||||
|
||||
impl_from_row_for_backend!(MariaDb);
|
||||
impl_from_row_for_backend!(MariaDb, ResultRow);
|
||||
impl_into_query_parameters_for_backend!(MariaDb);
|
||||
|
@ -24,8 +24,6 @@ impl Executor for MariaDb {
|
||||
query: &'q str,
|
||||
params: MariaDbQueryParameters,
|
||||
) -> BoxFuture<'e, crate::Result<u64>> {
|
||||
let params = params.into_params();
|
||||
|
||||
Box::pin(async move {
|
||||
let prepare = self.send_prepare(query).await?;
|
||||
self.send_execute(prepare.statement_id, params).await?;
|
||||
@ -64,16 +62,14 @@ impl Executor for MariaDb {
|
||||
})
|
||||
}
|
||||
|
||||
fn fetch<'e, 'q: 'e, O: 'e, T: 'e>(
|
||||
fn fetch<'e, 'q: 'e, T: 'e>(
|
||||
&'e mut self,
|
||||
query: &'q str,
|
||||
params: MariaDbQueryParameters,
|
||||
) -> BoxStream<'e, crate::Result<T>>
|
||||
where
|
||||
T: FromRow<Self::Backend, O> + Send + Unpin,
|
||||
T: FromRow<Self::Backend> + Send + Unpin,
|
||||
{
|
||||
let params = params.into_params();
|
||||
|
||||
Box::pin(async_stream::try_stream! {
|
||||
let prepare = self.send_prepare(query).await?;
|
||||
self.send_execute(prepare.statement_id, params).await?;
|
||||
@ -104,16 +100,14 @@ impl Executor for MariaDb {
|
||||
})
|
||||
}
|
||||
|
||||
fn fetch_optional<'e, 'q: 'e, O: 'e, T: 'e>(
|
||||
fn fetch_optional<'e, 'q: 'e, T: 'e>(
|
||||
&'e mut self,
|
||||
query: &'q str,
|
||||
params: MariaDbQueryParameters,
|
||||
) -> BoxFuture<'e, crate::Result<Option<T>>>
|
||||
where
|
||||
T: FromRow<Self::Backend, O> + Send,
|
||||
T: FromRow<Self::Backend> + Send,
|
||||
{
|
||||
let params = params.into_params();
|
||||
|
||||
Box::pin(async move {
|
||||
let prepare = self.send_prepare(query).await?;
|
||||
self.send_execute(prepare.statement_id, params).await?;
|
||||
@ -148,8 +142,6 @@ impl Executor for MariaDb {
|
||||
|
||||
fn describe<'e, 'q: 'e>(
|
||||
&'e mut self,
|
||||
query: &'q str,
|
||||
) -> BoxFuture<'e, crate::Result<Describe<Self::Backend>>> {
|
||||
unimplemented!();
|
||||
}
|
||||
_query: &'q str,
|
||||
) -> BoxFuture<'e, crate::Result<Describe<Self::Backend>>> { unimplemented!(); }
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ impl QueryParameters for MariaDbQueryParameters {
|
||||
self.null_bitmap.resize(index / 8, 0);
|
||||
|
||||
if let IsNull::Yes = value.encode(&mut self.params) {
|
||||
self.null_bitmap[index / 8] &= (1 << index % 8);
|
||||
self.null_bitmap[index / 8] &= 1 << index % 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,8 @@ macro_rules! impl_into_query_parameters {
|
||||
$($T: crate::encode::Encode<$B>,)+
|
||||
{
|
||||
fn into_params(self) -> <$B as crate::backend::Backend>::QueryParameters {
|
||||
use crate::params::QueryParameters;
|
||||
|
||||
let mut params = <$B as crate::backend::Backend>::QueryParameters::default();
|
||||
|
||||
let binds = 0 $(+ { $idx; 1 } )+;
|
||||
|
Loading…
x
Reference in New Issue
Block a user