@@ -6,7 +6,7 @@ use pyo3::{
66use tokio_postgres:: { config:: Host , Config } ;
77
88use crate :: {
9- exceptions:: rust_errors:: { RustPSQLDriverError , RustPSQLDriverPyResult } ,
9+ exceptions:: rust_errors:: { PSQLPyResult , RustPSQLDriverError } ,
1010 query_result:: PSQLDriverPyQueryResult ,
1111 runtime:: rustdriver_future,
1212} ;
@@ -23,9 +23,9 @@ trait CursorObjectTrait {
2323 querystring : & str ,
2424 prepared : & Option < bool > ,
2525 parameters : & Option < Py < PyAny > > ,
26- ) -> RustPSQLDriverPyResult < ( ) > ;
26+ ) -> PSQLPyResult < ( ) > ;
2727
28- async fn cursor_close ( & self , closed : & bool , cursor_name : & str ) -> RustPSQLDriverPyResult < ( ) > ;
28+ async fn cursor_close ( & self , closed : & bool , cursor_name : & str ) -> PSQLPyResult < ( ) > ;
2929}
3030
3131impl CursorObjectTrait for PsqlpyConnection {
@@ -43,7 +43,7 @@ impl CursorObjectTrait for PsqlpyConnection {
4343 querystring : & str ,
4444 prepared : & Option < bool > ,
4545 parameters : & Option < Py < PyAny > > ,
46- ) -> RustPSQLDriverPyResult < ( ) > {
46+ ) -> PSQLPyResult < ( ) > {
4747 let mut cursor_init_query = format ! ( "DECLARE {cursor_name}" ) ;
4848 if let Some ( scroll) = scroll {
4949 if * scroll {
@@ -70,7 +70,7 @@ impl CursorObjectTrait for PsqlpyConnection {
7070 ///
7171 /// # Errors
7272 /// May return Err Result if cannot execute querystring.
73- async fn cursor_close ( & self , closed : & bool , cursor_name : & str ) -> RustPSQLDriverPyResult < ( ) > {
73+ async fn cursor_close ( & self , closed : & bool , cursor_name : & str ) -> PSQLPyResult < ( ) > {
7474 if * closed {
7575 return Err ( RustPSQLDriverError :: CursorCloseError (
7676 "Cursor is already closed" . into ( ) ,
@@ -232,7 +232,7 @@ impl Cursor {
232232 slf
233233 }
234234
235- async fn __aenter__ < ' a > ( slf : Py < Self > ) -> RustPSQLDriverPyResult < Py < Self > > {
235+ async fn __aenter__ < ' a > ( slf : Py < Self > ) -> PSQLPyResult < Py < Self > > {
236236 let ( db_transaction, cursor_name, scroll, querystring, prepared, parameters) =
237237 Python :: with_gil ( |gil| {
238238 let self_ = slf. borrow ( gil) ;
@@ -265,7 +265,7 @@ impl Cursor {
265265 _exception_type : Py < PyAny > ,
266266 exception : Py < PyAny > ,
267267 _traceback : Py < PyAny > ,
268- ) -> RustPSQLDriverPyResult < ( ) > {
268+ ) -> PSQLPyResult < ( ) > {
269269 let ( db_transaction, closed, cursor_name, is_exception_none, py_err) =
270270 pyo3:: Python :: with_gil ( |gil| {
271271 let self_ = slf. borrow ( gil) ;
@@ -307,7 +307,7 @@ impl Cursor {
307307 /// we didn't find any solution how to implement it without
308308 /// # Errors
309309 /// May return Err Result if can't execute querystring.
310- fn __anext__ ( & self ) -> RustPSQLDriverPyResult < Option < PyObject > > {
310+ fn __anext__ ( & self ) -> PSQLPyResult < Option < PyObject > > {
311311 let db_transaction = self . db_transaction . clone ( ) ;
312312 let fetch_number = self . fetch_number ;
313313 let cursor_name = self . cursor_name . clone ( ) ;
@@ -343,7 +343,7 @@ impl Cursor {
343343 /// # Errors
344344 /// May return Err Result
345345 /// if cannot execute querystring for cursor declaration.
346- pub async fn start ( & mut self ) -> RustPSQLDriverPyResult < ( ) > {
346+ pub async fn start ( & mut self ) -> PSQLPyResult < ( ) > {
347347 let db_transaction_arc = self . db_transaction . clone ( ) ;
348348
349349 if let Some ( db_transaction) = db_transaction_arc {
@@ -370,7 +370,7 @@ impl Cursor {
370370 ///
371371 /// # Errors
372372 /// May return Err Result if cannot execute query.
373- pub async fn close ( & mut self ) -> RustPSQLDriverPyResult < ( ) > {
373+ pub async fn close ( & mut self ) -> PSQLPyResult < ( ) > {
374374 let db_transaction_arc = self . db_transaction . clone ( ) ;
375375
376376 if let Some ( db_transaction) = db_transaction_arc {
@@ -396,7 +396,7 @@ impl Cursor {
396396 pub async fn fetch < ' a > (
397397 slf : Py < Self > ,
398398 fetch_number : Option < usize > ,
399- ) -> RustPSQLDriverPyResult < PSQLDriverPyQueryResult > {
399+ ) -> PSQLPyResult < PSQLDriverPyQueryResult > {
400400 let ( db_transaction, inner_fetch_number, cursor_name) = Python :: with_gil ( |gil| {
401401 let self_ = slf. borrow ( gil) ;
402402 (
@@ -437,7 +437,7 @@ impl Cursor {
437437 ///
438438 /// # Errors
439439 /// May return Err Result if cannot execute query.
440- pub async fn fetch_next < ' a > ( slf : Py < Self > ) -> RustPSQLDriverPyResult < PSQLDriverPyQueryResult > {
440+ pub async fn fetch_next < ' a > ( slf : Py < Self > ) -> PSQLPyResult < PSQLDriverPyQueryResult > {
441441 let ( db_transaction, cursor_name) = Python :: with_gil ( |gil| {
442442 let self_ = slf. borrow ( gil) ;
443443 ( self_. db_transaction . clone ( ) , self_. cursor_name . clone ( ) )
@@ -464,7 +464,7 @@ impl Cursor {
464464 ///
465465 /// # Errors
466466 /// May return Err Result if cannot execute query.
467- pub async fn fetch_prior < ' a > ( slf : Py < Self > ) -> RustPSQLDriverPyResult < PSQLDriverPyQueryResult > {
467+ pub async fn fetch_prior < ' a > ( slf : Py < Self > ) -> PSQLPyResult < PSQLDriverPyQueryResult > {
468468 let ( db_transaction, cursor_name) = Python :: with_gil ( |gil| {
469469 let self_ = slf. borrow ( gil) ;
470470 ( self_. db_transaction . clone ( ) , self_. cursor_name . clone ( ) )
@@ -491,7 +491,7 @@ impl Cursor {
491491 ///
492492 /// # Errors
493493 /// May return Err Result if cannot execute query.
494- pub async fn fetch_first < ' a > ( slf : Py < Self > ) -> RustPSQLDriverPyResult < PSQLDriverPyQueryResult > {
494+ pub async fn fetch_first < ' a > ( slf : Py < Self > ) -> PSQLPyResult < PSQLDriverPyQueryResult > {
495495 let ( db_transaction, cursor_name) = Python :: with_gil ( |gil| {
496496 let self_ = slf. borrow ( gil) ;
497497 ( self_. db_transaction . clone ( ) , self_. cursor_name . clone ( ) )
@@ -518,7 +518,7 @@ impl Cursor {
518518 ///
519519 /// # Errors
520520 /// May return Err Result if cannot execute query.
521- pub async fn fetch_last < ' a > ( slf : Py < Self > ) -> RustPSQLDriverPyResult < PSQLDriverPyQueryResult > {
521+ pub async fn fetch_last < ' a > ( slf : Py < Self > ) -> PSQLPyResult < PSQLDriverPyQueryResult > {
522522 let ( db_transaction, cursor_name) = Python :: with_gil ( |gil| {
523523 let self_ = slf. borrow ( gil) ;
524524 ( self_. db_transaction . clone ( ) , self_. cursor_name . clone ( ) )
@@ -548,7 +548,7 @@ impl Cursor {
548548 pub async fn fetch_absolute < ' a > (
549549 slf : Py < Self > ,
550550 absolute_number : i64 ,
551- ) -> RustPSQLDriverPyResult < PSQLDriverPyQueryResult > {
551+ ) -> PSQLPyResult < PSQLDriverPyQueryResult > {
552552 let ( db_transaction, cursor_name) = Python :: with_gil ( |gil| {
553553 let self_ = slf. borrow ( gil) ;
554554 ( self_. db_transaction . clone ( ) , self_. cursor_name . clone ( ) )
@@ -582,7 +582,7 @@ impl Cursor {
582582 pub async fn fetch_relative < ' a > (
583583 slf : Py < Self > ,
584584 relative_number : i64 ,
585- ) -> RustPSQLDriverPyResult < PSQLDriverPyQueryResult > {
585+ ) -> PSQLPyResult < PSQLDriverPyQueryResult > {
586586 let ( db_transaction, cursor_name) = Python :: with_gil ( |gil| {
587587 let self_ = slf. borrow ( gil) ;
588588 ( self_. db_transaction . clone ( ) , self_. cursor_name . clone ( ) )
@@ -613,9 +613,7 @@ impl Cursor {
613613 ///
614614 /// # Errors
615615 /// May return Err Result if cannot execute query.
616- pub async fn fetch_forward_all < ' a > (
617- slf : Py < Self > ,
618- ) -> RustPSQLDriverPyResult < PSQLDriverPyQueryResult > {
616+ pub async fn fetch_forward_all < ' a > ( slf : Py < Self > ) -> PSQLPyResult < PSQLDriverPyQueryResult > {
619617 let ( db_transaction, cursor_name) = Python :: with_gil ( |gil| {
620618 let self_ = slf. borrow ( gil) ;
621619 ( self_. db_transaction . clone ( ) , self_. cursor_name . clone ( ) )
@@ -649,7 +647,7 @@ impl Cursor {
649647 pub async fn fetch_backward < ' a > (
650648 slf : Py < Self > ,
651649 backward_count : i64 ,
652- ) -> RustPSQLDriverPyResult < PSQLDriverPyQueryResult > {
650+ ) -> PSQLPyResult < PSQLDriverPyQueryResult > {
653651 let ( db_transaction, cursor_name) = Python :: with_gil ( |gil| {
654652 let self_ = slf. borrow ( gil) ;
655653 ( self_. db_transaction . clone ( ) , self_. cursor_name . clone ( ) )
@@ -680,9 +678,7 @@ impl Cursor {
680678 ///
681679 /// # Errors
682680 /// May return Err Result if cannot execute query.
683- pub async fn fetch_backward_all < ' a > (
684- slf : Py < Self > ,
685- ) -> RustPSQLDriverPyResult < PSQLDriverPyQueryResult > {
681+ pub async fn fetch_backward_all < ' a > ( slf : Py < Self > ) -> PSQLPyResult < PSQLDriverPyQueryResult > {
686682 let ( db_transaction, cursor_name) = Python :: with_gil ( |gil| {
687683 let self_ = slf. borrow ( gil) ;
688684 ( self_. db_transaction . clone ( ) , self_. cursor_name . clone ( ) )
0 commit comments