File tree Expand file tree Collapse file tree 4 files changed +14
-18
lines changed Expand file tree Collapse file tree 4 files changed +14
-18
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " r2d2_postgres"
3- version = " 0.9.1 "
3+ version = " 0.9.2 "
44authors = [" Steven Fackler <sfackler@gmail.com>" ]
55license = " MIT"
66description = " Postgres support for the r2d2 connection pool"
77repository = " https://github.com/sfackler/r2d2-postgres"
8- documentation = " https://sfackler.github.io/r2d2-postgres/doc/v0.9.1 /r2d2_postgres"
8+ documentation = " https://sfackler.github.io/r2d2-postgres/doc/v0.9.2 /r2d2_postgres"
99keywords = [" postgres" , " sql" , " pool" , " database" ]
1010
1111[lib ]
@@ -18,5 +18,5 @@ name = "test"
1818path = " tests/test.rs"
1919
2020[dependencies ]
21- r2d2 = " 0.5 "
21+ r2d2 = " 0.6 "
2222postgres = " 0.9"
Original file line number Diff line number Diff line change 11r2d2-postgres
22=============
33
4- [ ![ Build Status] ( https://travis-ci.org/sfackler/r2d2-postgres.svg?branch=v0.6.0 )] ( https://travis-ci.org/sfackler/r2d2-postgres )
4+ [ ![ Build Status] ( https://travis-ci.org/sfackler/r2d2-postgres.svg?branch=master )] ( https://travis-ci.org/sfackler/r2d2-postgres )
55
66[ rust-postgres] ( https://github.com/sfackler/rust-postgres ) support library for the [ r2d2] ( https://github.com/sfackler/r2d2 ) connection pool.
77
8- Documentation is available at https://sfackler.github.io/r2d2-postgres/doc/v0.9.1 /r2d2_postgres
8+ Documentation is available at https://sfackler.github.io/r2d2-postgres/doc/v0.9.2 /r2d2_postgres
99
1010# Example
1111
@@ -21,11 +21,10 @@ use postgres::SslMode;
2121use r2d2_postgres :: PostgresConnectionManager ;
2222
2323fn main () {
24- let config = Default :: default ();
24+ let config = r2d2 :: Config :: default ();
2525 let manager = PostgresConnectionManager :: new (" postgres://postgres@localhost" ,
2626 SslMode :: None ). unwrap ();
27- let error_handler = Box :: new (r2d2 :: LoggingErrorHandler );
28- let pool = Arc :: new (r2d2 :: Pool :: new (config , manager , error_handler ). unwrap ());
27+ let pool = Arc :: new (r2d2 :: Pool :: new (config , manager ). unwrap ());
2928
3029 for i in 0 .. 10i32 {
3130 let pool = pool . clone ();
Original file line number Diff line number Diff line change 11//! Postgres support for the `r2d2` connection pool.
2- #![ doc( html_root_url="https://sfackler.github.io/r2d2-postgres/doc/v0.9.1 " ) ]
2+ #![ doc( html_root_url="https://sfackler.github.io/r2d2-postgres/doc/v0.9.2 " ) ]
33#![ warn( missing_docs) ]
44extern crate r2d2;
55extern crate postgres;
@@ -40,7 +40,7 @@ impl error::Error for Error {
4040 }
4141}
4242
43- /// An `r2d2::ConnectionManager ` for `postgres::Connection`s.
43+ /// An `r2d2::ManageConnection ` for `postgres::Connection`s.
4444///
4545/// ## Example
4646///
@@ -57,11 +57,10 @@ impl error::Error for Error {
5757/// use r2d2_postgres::PostgresConnectionManager;
5858///
5959/// fn main() {
60- /// let config = Default ::default();
60+ /// let config = r2d2::Config ::default();
6161/// let manager = PostgresConnectionManager::new("postgres://postgres@localhost",
6262/// SslMode::None).unwrap();
63- /// let error_handler = Box::new(r2d2::LoggingErrorHandler);
64- /// let pool = Arc::new(r2d2::Pool::new(config, manager, error_handler).unwrap());
63+ /// let pool = Arc::new(r2d2::Pool::new(config, manager).unwrap());
6564///
6665/// for i in 0..10i32 {
6766/// let pool = pool.clone();
@@ -92,7 +91,7 @@ impl PostgresConnectionManager {
9291 }
9392}
9493
95- impl r2d2:: ConnectionManager for PostgresConnectionManager {
94+ impl r2d2:: ManageConnection for PostgresConnectionManager {
9695 type Connection = postgres:: Connection ;
9796 type Error = Error ;
9897
Original file line number Diff line number Diff line change @@ -13,8 +13,7 @@ use r2d2_postgres::PostgresConnectionManager;
1313fn test_basic ( ) {
1414 let manager = PostgresConnectionManager :: new ( "postgres://postgres@localhost" , SslMode :: None ) . unwrap ( ) ;
1515 let config = r2d2:: Config :: builder ( ) . pool_size ( 2 ) . build ( ) ;
16- let handler = Box :: new ( r2d2:: NoopErrorHandler ) ;
17- let pool = Arc :: new ( r2d2:: Pool :: new ( config, manager, handler) . unwrap ( ) ) ;
16+ let pool = Arc :: new ( r2d2:: Pool :: new ( config, manager) . unwrap ( ) ) ;
1817
1918 let ( s1, r1) = mpsc:: channel ( ) ;
2019 let ( s2, r2) = mpsc:: channel ( ) ;
@@ -45,8 +44,7 @@ fn test_basic() {
4544fn test_is_valid ( ) {
4645 let manager = PostgresConnectionManager :: new ( "postgres://postgres@localhost" , SslMode :: None ) . unwrap ( ) ;
4746 let config = r2d2:: Config :: builder ( ) . pool_size ( 1 ) . test_on_check_out ( true ) . build ( ) ;
48- let handler = Box :: new ( r2d2:: NoopErrorHandler ) ;
49- let pool = r2d2:: Pool :: new ( config, manager, handler) . unwrap ( ) ;
47+ let pool = r2d2:: Pool :: new ( config, manager) . unwrap ( ) ;
5048
5149 pool. get ( ) . unwrap ( ) ;
5250}
You can’t perform that action at this time.
0 commit comments