Skip to content

Commit 4beb5d8

Browse files
committed
Add cancel_data to pooled connection
1 parent 0a9dcfd commit 4beb5d8

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ impl<'self> PostgresTransaction<'self> {
848848
self.conn.update(query, params)
849849
}
850850

851-
/// Like `PostrgresConnection::transaction`.
851+
/// Like `PostgresConnection::transaction`.
852852
pub fn transaction<'a>(&self) -> PostgresTransaction<'self> {
853853
self.conn.quick_query("SAVEPOINT sp");
854854
PostgresTransaction {

pool.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ extern mod extra;
55
use extra::arc::MutexArc;
66

77
use super::{PostgresNotificationIterator,
8+
PostgresCancelData,
89
PostgresConnection,
910
NormalPostgresStatement,
1011
PostgresDbError,
@@ -144,4 +145,9 @@ impl PooledPostgresConnection {
144145
pub fn notifications<'a>(&'a self) -> PostgresNotificationIterator<'a> {
145146
self.conn.get_ref().notifications()
146147
}
148+
149+
/// Like `PostgresConnection::cancel_data`.
150+
pub fn cancel_data(&self) -> PostgresCancelData {
151+
self.conn.get_ref().cancel_data()
152+
}
147153
}

tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ fn test_notification_iterator_some() {
471471
472472
#[test]
473473
// This test is pretty sad, but I don't think there's a better way :(
474-
fn test_cancel_request() {
474+
fn test_cancel_query() {
475475
let conn = PostgresConnection::connect("postgres://postgres@localhost");
476476
let cancel_data = conn.cancel_data();
477477

0 commit comments

Comments
 (0)