Skip to content

Commit 361c7bf

Browse files
committed
Accessors for params and columns
1 parent ab672e4 commit 361c7bf

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

postgres-tokio/src/lib.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,11 +615,21 @@ impl Connection {
615615
}
616616
}
617617

618-
struct Column {
618+
pub struct Column {
619619
name: String,
620620
type_: Type,
621621
}
622622

623+
impl Column {
624+
pub fn name(&self) -> &str {
625+
&self.name
626+
}
627+
628+
pub fn type_(&self) -> &Type {
629+
&self.type_
630+
}
631+
}
632+
623633
pub struct Statement {
624634
close_sender: Sender<(u8, String)>,
625635
name: String,
@@ -635,6 +645,14 @@ impl Drop for Statement {
635645
}
636646

637647
impl Statement {
648+
pub fn parameters(&self) -> &[Type] {
649+
&self.params
650+
}
651+
652+
pub fn columns(&self) -> &[Column] {
653+
&self.columns
654+
}
655+
638656
pub fn execute(self,
639657
params: &[&ToSql],
640658
conn: Connection)

0 commit comments

Comments
 (0)