mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
style: rustfmt
This commit is contained in:
parent
d4aa3dfa5e
commit
cc2f2c1f72
@ -1,6 +1,5 @@
|
||||
use crate::Describe;
|
||||
|
||||
use super::{Close, Connect, ConnectOptions, Runtime};
|
||||
use crate::Describe;
|
||||
|
||||
/// A unique connection (session) with a specific database.
|
||||
///
|
||||
@ -21,7 +20,7 @@ where
|
||||
|
||||
fn describe<'x, 'e, 'q>(
|
||||
&'e mut self,
|
||||
query: &'q str
|
||||
query: &'q str,
|
||||
) -> crate::Result<Describe<Self::Database>>
|
||||
where
|
||||
'e: 'x,
|
||||
|
||||
@ -33,7 +33,7 @@ where
|
||||
#[cfg(feature = "async")]
|
||||
fn describe<'x, 'e, 'q>(
|
||||
&'e mut self,
|
||||
query: &'q str
|
||||
query: &'q str,
|
||||
) -> BoxFuture<'x, crate::Result<Describe<Self::Database>>>
|
||||
where
|
||||
Rt: crate::Async,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
use std::marker::PhantomData;
|
||||
use std::cmp;
|
||||
use std::marker::PhantomData;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
|
||||
use bytes::{Bytes, BytesMut};
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
use crate::protocol::backend::BackendMessageType;
|
||||
use sqlx_core::ClientError;
|
||||
use std::error::Error as StdError;
|
||||
use std::fmt::{self, Display, Formatter};
|
||||
use std::str::Utf8Error;
|
||||
|
||||
use sqlx_core::ClientError;
|
||||
|
||||
use crate::protocol::backend::BackendMessageType;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[non_exhaustive]
|
||||
pub enum PgClientError {
|
||||
|
||||
@ -0,0 +1 @@
|
||||
|
||||
@ -22,10 +22,11 @@ impl Deserialize<'_> for KeyData {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::KeyData;
|
||||
use bytes::Bytes;
|
||||
use sqlx_core::io::Deserialize;
|
||||
|
||||
use super::KeyData;
|
||||
|
||||
#[test]
|
||||
fn should_deserialize() {
|
||||
let m = KeyData::deserialize(Bytes::from_static(b"\0\0'\xc6\x89R\xc5+")).unwrap();
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
use std::convert::TryFrom;
|
||||
use std::fmt::Debug;
|
||||
|
||||
use crate::PgClientError;
|
||||
use bytes::Bytes;
|
||||
use sqlx_core::io::Deserialize;
|
||||
use sqlx_core::{Error, Result};
|
||||
|
||||
use crate::PgClientError;
|
||||
|
||||
/// Type of the *incoming* message.
|
||||
///
|
||||
/// Postgres does use the same message format for client and server messages but we are only
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
use crate::PgClientError;
|
||||
use bytes::{Buf, Bytes};
|
||||
use sqlx_core::io::Deserialize;
|
||||
use sqlx_core::{Error, Result};
|
||||
|
||||
use crate::PgClientError;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[repr(u8)]
|
||||
pub(crate) enum TransactionStatus {
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
use std::num::{NonZeroI16, NonZeroI32};
|
||||
|
||||
use bytes::{Buf, Bytes};
|
||||
use bytestring::ByteString;
|
||||
use sqlx_core::io::{BufExt, Deserialize};
|
||||
use sqlx_core::Result;
|
||||
use std::num::{NonZeroI16, NonZeroI32};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct RowDescription {
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
use sqlx_core::io::{Serialize, WriteExt};
|
||||
use sqlx_core::Result;
|
||||
|
||||
use crate::io::PgWriteExt;
|
||||
use crate::protocol::frontend::{PortalRef, StatementRef};
|
||||
use crate::PgArguments;
|
||||
use sqlx_core::io::{Serialize, WriteExt};
|
||||
use sqlx_core::Result;
|
||||
|
||||
pub(crate) struct Bind<'a> {
|
||||
pub(crate) portal: PortalRef,
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
use crate::io::PgWriteExt;
|
||||
use crate::protocol::frontend::Target;
|
||||
use sqlx_core::io::{Serialize, WriteExt};
|
||||
use sqlx_core::Result;
|
||||
|
||||
use crate::io::PgWriteExt;
|
||||
use crate::protocol::frontend::Target;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct Close {
|
||||
target: Target,
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
use crate::io::PgWriteExt;
|
||||
use crate::protocol::frontend::Target;
|
||||
use sqlx_core::io::{Serialize, WriteExt};
|
||||
use sqlx_core::Result;
|
||||
|
||||
use crate::io::PgWriteExt;
|
||||
use crate::protocol::frontend::Target;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct Describe {
|
||||
target: Target,
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
use crate::io::PgWriteExt;
|
||||
use crate::protocol::frontend::PortalRef;
|
||||
use sqlx_core::io::Serialize;
|
||||
use sqlx_core::Result;
|
||||
|
||||
use crate::io::PgWriteExt;
|
||||
use crate::protocol::frontend::PortalRef;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct Execute {
|
||||
pub(crate) portal: PortalRef,
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
use crate::io::PgWriteExt;
|
||||
use crate::protocol::frontend::{PortalRef, StatementRef};
|
||||
use sqlx_core::io::{Serialize, WriteExt};
|
||||
use sqlx_core::Result;
|
||||
|
||||
use crate::io::PgWriteExt;
|
||||
use crate::protocol::frontend::{PortalRef, StatementRef};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct Parse<'a> {
|
||||
pub(crate) statement: StatementRef,
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
use crate::io::PgWriteExt;
|
||||
use md5::{Digest, Md5};
|
||||
use sqlx_core::io::Serialize;
|
||||
use sqlx_core::Result;
|
||||
|
||||
use crate::io::PgWriteExt;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct Password<'a>(pub(crate) &'a str);
|
||||
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
use crate::io::PgWriteExt;
|
||||
use sqlx_core::io::Serialize;
|
||||
use sqlx_core::Result;
|
||||
|
||||
use crate::io::PgWriteExt;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct Query<'a>(pub(crate) &'a str);
|
||||
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
use crate::io::PgWriteExt;
|
||||
use crate::protocol::frontend::{PortalRef, StatementRef};
|
||||
use sqlx_core::io::Serialize;
|
||||
use sqlx_core::Result;
|
||||
|
||||
use crate::io::PgWriteExt;
|
||||
use crate::protocol::frontend::{PortalRef, StatementRef};
|
||||
|
||||
/// Target a command at a portal *or* statement.
|
||||
/// Used by [`Describe`] and [`Close`].
|
||||
#[derive(Debug)]
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
use crate::blocking::{Close, Connect, Connection, Executor, Runtime};
|
||||
use crate::mysql::connection::MySqlConnection;
|
||||
use crate::mysql::{MySql, MySqlConnectOptions, MySqlQueryResult, MySqlRow};
|
||||
use crate::{Blocking, Execute, Result, Describe};
|
||||
use crate::{Blocking, Describe, Execute, Result};
|
||||
|
||||
impl MySqlConnection<Blocking> {
|
||||
/// Open a new database connection.
|
||||
@ -70,10 +70,7 @@ impl<Rt: Runtime> Connection<Rt> for MySqlConnection<Rt> {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn describe<'x, 'e, 'q>(
|
||||
&'e mut self,
|
||||
query: &'q str,
|
||||
) -> Result<Describe<MySql>>
|
||||
fn describe<'x, 'e, 'q>(&'e mut self, query: &'q str) -> Result<Describe<MySql>>
|
||||
where
|
||||
'e: 'x,
|
||||
'q: 'x,
|
||||
|
||||
@ -8,7 +8,7 @@ use sqlx_core::{Execute, Executor};
|
||||
use super::{MySql, MySqlConnectOptions, MySqlQueryResult, MySqlRow};
|
||||
#[cfg(feature = "blocking")]
|
||||
use crate::blocking;
|
||||
use crate::{Arguments, Describe, Close, Connect, Connection, DefaultRuntime, Runtime};
|
||||
use crate::{Arguments, Close, Connect, Connection, DefaultRuntime, Describe, Runtime};
|
||||
#[cfg(feature = "async")]
|
||||
use crate::{Async, Result};
|
||||
|
||||
@ -134,10 +134,7 @@ impl<Rt: Runtime> Connection<Rt> for MySqlConnection<Rt> {
|
||||
|
||||
#[cfg(feature = "async")]
|
||||
#[inline]
|
||||
fn describe<'x, 'e, 'q>(
|
||||
&'e mut self,
|
||||
query: &'q str,
|
||||
) -> BoxFuture<'x, Result<Describe<MySql>>>
|
||||
fn describe<'x, 'e, 'q>(&'e mut self, query: &'q str) -> BoxFuture<'x, Result<Describe<MySql>>>
|
||||
where
|
||||
Rt: Async,
|
||||
'e: 'x,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user