Skip to content

Commit 0f742e4

Browse files
Expose type modifier in Column struct
1 parent e3b694c commit 0f742e4

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tokio-postgres/src/prepare.rs

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ pub async fn prepare(
9999
name: field.name().to_string(),
100100
table_oid: Some(field.table_oid()).filter(|n| *n != 0),
101101
column_id: Some(field.column_id()).filter(|n| *n != 0),
102+
type_modifier: field.type_modifier(),
102103
r#type: type_,
103104
};
104105
columns.push(column);

tokio-postgres/src/statement.rs

+6
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ pub struct Column {
6767
pub(crate) name: String,
6868
pub(crate) table_oid: Option<u32>,
6969
pub(crate) column_id: Option<i16>,
70+
pub(crate) type_modifier: i32,
7071
pub(crate) r#type: Type,
7172
}
7273

@@ -86,6 +87,11 @@ impl Column {
8687
self.column_id
8788
}
8889

90+
/// Return the type modifier
91+
pub fn type_modifier(&self) -> i32 {
92+
self.type_modifier
93+
}
94+
8995
/// Returns the type of the column.
9096
pub fn type_(&self) -> &Type {
9197
&self.r#type

0 commit comments

Comments
 (0)