This commit is contained in:
Chris Tsang 2021-10-12 12:32:25 +08:00
parent e57975930e
commit f9dd9d242a
3 changed files with 5 additions and 6 deletions

View File

@ -148,7 +148,7 @@ jobs:
with: with:
command: test command: test
args: > args: >
--path sea-orm-rocket --manifest-path sea-orm-rocket/Cargo.toml
cli: cli:
name: CLI name: CLI

View File

@ -27,8 +27,8 @@ features = ["macros", "runtime-tokio-native-tls"]
default-features = false default-features = false
[dependencies.sea-orm-rocket] [dependencies.sea-orm-rocket]
path = "../../sea-orm-rocket/lib" # remove this line in your own project path = "../../sea-orm-rocket/lib" # remove this line in your own project and use the git line
git = "https://github.com/SeaQL/sea-orm" # git = "https://github.com/SeaQL/sea-orm"
[features] [features]
default = ["sqlx-postgres"] default = ["sqlx-postgres"]

View File

@ -3,8 +3,7 @@ use rocket::figment::Figment;
/// Generic [`Database`](crate::Database) driver connection pool trait. /// Generic [`Database`](crate::Database) driver connection pool trait.
/// ///
/// This trait provides a generic interface to various database pooling /// This trait provides a generic interface to various database pooling
/// implementations in the Rust ecosystem. It can be implemented by anyone, but /// implementations in the Rust ecosystem. It can be implemented by anyone.
/// this crate provides implementations for common drivers.
/// ///
/// This is adapted from the original `rocket_db_pools`. But on top we require /// This is adapted from the original `rocket_db_pools`. But on top we require
/// `Connection` itself to be `Sync`. Hence, instead of cloning or allocating /// `Connection` itself to be `Sync`. Hence, instead of cloning or allocating
@ -36,7 +35,7 @@ pub trait Pool: Sized + Send + Sync + 'static {
/// insufficient resources, or another database-specific error. /// insufficient resources, or another database-specific error.
async fn init(figment: &Figment) -> Result<Self, Self::Error>; async fn init(figment: &Figment) -> Result<Self, Self::Error>;
/// Borrow a database connection /// Borrows a reference to the pool
fn borrow(&self) -> &Self::Connection; fn borrow(&self) -> &Self::Connection;
} }