mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-10-03 15:55:45 +00:00
add more documentation
This commit is contained in:
parent
c2dee0cf5a
commit
2a8906d1e5
@ -24,6 +24,7 @@ mod types;
|
|||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
/// An alias for [`Pool`], specialized for **MySQL**.
|
/// An alias for [`Pool`], specialized for **MySQL**.
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "mysql")))]
|
||||||
pub type MySqlPool = crate::pool::Pool<MySqlConnection>;
|
pub type MySqlPool = crate::pool::Pool<MySqlConnection>;
|
||||||
|
|
||||||
make_query_as!(MySqlQueryAs, MySql, MySqlRow);
|
make_query_as!(MySqlQueryAs, MySql, MySqlRow);
|
||||||
|
@ -16,7 +16,7 @@ use crate::postgres::stream::PgStream;
|
|||||||
use crate::postgres::{sasl, tls};
|
use crate::postgres::{sasl, tls};
|
||||||
use crate::url::Url;
|
use crate::url::Url;
|
||||||
|
|
||||||
/// An asynchronous connection to a [Postgres][super::Postgres] database.
|
/// An asynchronous connection to a [Postgres](struct.Postgres.html) database.
|
||||||
///
|
///
|
||||||
/// The connection string expected by [Connect::connect] should be a PostgreSQL connection
|
/// The connection string expected by [Connect::connect] should be a PostgreSQL connection
|
||||||
/// string, as documented at
|
/// string, as documented at
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
//! Types which represent various database drivers.
|
||||||
|
|
||||||
use crate::database::{Database, HasCursor, HasRawValue, HasRow};
|
use crate::database::{Database, HasCursor, HasRawValue, HasRow};
|
||||||
use crate::postgres::row::PgValue;
|
use crate::postgres::row::PgValue;
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ mod tls;
|
|||||||
pub mod types;
|
pub mod types;
|
||||||
|
|
||||||
/// An alias for [`Pool`][crate::Pool], specialized for **Postgres**.
|
/// An alias for [`Pool`][crate::Pool], specialized for **Postgres**.
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "postgres")))]
|
||||||
pub type PgPool = crate::pool::Pool<PgConnection>;
|
pub type PgPool = crate::pool::Pool<PgConnection>;
|
||||||
|
|
||||||
make_query_as!(PgQueryAs, Postgres, PgRow);
|
make_query_as!(PgQueryAs, Postgres, PgRow);
|
||||||
|
@ -2,4 +2,4 @@ mod numeric;
|
|||||||
mod record;
|
mod record;
|
||||||
|
|
||||||
pub use numeric::{PgNumeric, PgNumericSign};
|
pub use numeric::{PgNumeric, PgNumericSign};
|
||||||
pub use record::{PgRecordEncoder, PgRecordDecoder};
|
pub use record::{PgRecordDecoder, PgRecordEncoder};
|
||||||
|
@ -22,7 +22,7 @@ use crate::url::Url;
|
|||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
pub(super) struct SqliteConnectionHandle(pub(super) NonNull<sqlite3>);
|
pub(super) struct SqliteConnectionHandle(pub(super) NonNull<sqlite3>);
|
||||||
|
|
||||||
/// A connection to a [SQLite][super::Sqlite] database.
|
/// A connection to a [Sqlite](struct.Sqlite.html) database.
|
||||||
pub struct SqliteConnection {
|
pub struct SqliteConnection {
|
||||||
pub(super) handle: SqliteConnectionHandle,
|
pub(super) handle: SqliteConnectionHandle,
|
||||||
pub(super) worker: Worker,
|
pub(super) worker: Worker,
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
//! **SQLite** database and connection types.
|
||||||
|
|
||||||
mod arguments;
|
mod arguments;
|
||||||
mod connection;
|
mod connection;
|
||||||
mod cursor;
|
mod cursor;
|
||||||
@ -20,6 +22,7 @@ pub use types::SqliteTypeInfo;
|
|||||||
pub use value::SqliteValue;
|
pub use value::SqliteValue;
|
||||||
|
|
||||||
/// An alias for [`Pool`][crate::Pool], specialized for **Sqlite**.
|
/// An alias for [`Pool`][crate::Pool], specialized for **Sqlite**.
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "sqlite")))]
|
||||||
pub type SqlitePool = crate::pool::Pool<SqliteConnection>;
|
pub type SqlitePool = crate::pool::Pool<SqliteConnection>;
|
||||||
|
|
||||||
make_query_as!(SqliteQueryAs, Sqlite, SqliteRow);
|
make_query_as!(SqliteQueryAs, Sqlite, SqliteRow);
|
||||||
|
@ -55,6 +55,7 @@ pub mod ty_match;
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub mod result_ext;
|
pub mod result_ext;
|
||||||
|
|
||||||
|
/// Types and traits for encoding values for the database.
|
||||||
pub mod encode {
|
pub mod encode {
|
||||||
pub use sqlx_core::encode::{Encode, IsNull};
|
pub use sqlx_core::encode::{Encode, IsNull};
|
||||||
|
|
||||||
@ -62,6 +63,7 @@ pub mod encode {
|
|||||||
pub use sqlx_macros::Encode;
|
pub use sqlx_macros::Encode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Types and traits for decoding values from the database.
|
||||||
pub mod decode {
|
pub mod decode {
|
||||||
pub use sqlx_core::decode::Decode;
|
pub use sqlx_core::decode::Decode;
|
||||||
|
|
||||||
@ -69,6 +71,7 @@ pub mod decode {
|
|||||||
pub use sqlx_macros::Decode;
|
pub use sqlx_macros::Decode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Convenience re-export of common traits.
|
||||||
pub mod prelude {
|
pub mod prelude {
|
||||||
pub use super::Connect;
|
pub use super::Connect;
|
||||||
pub use super::Connection;
|
pub use super::Connection;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user