Accessors for params and columns

This commit is contained in:
Steven Fackler 2016-12-21 22:06:54 -05:00
parent ab672e42b4
commit 361c7bf395

View File

@ -615,11 +615,21 @@ impl Connection {
}
}
struct Column {
pub struct Column {
name: String,
type_: Type,
}
impl Column {
pub fn name(&self) -> &str {
&self.name
}
pub fn type_(&self) -> &Type {
&self.type_
}
}
pub struct Statement {
close_sender: Sender<(u8, String)>,
name: String,
@ -635,6 +645,14 @@ impl Drop for Statement {
}
impl Statement {
pub fn parameters(&self) -> &[Type] {
&self.params
}
pub fn columns(&self) -> &[Column] {
&self.columns
}
pub fn execute(self,
params: &[&ToSql],
conn: Connection)