Skip to content

Commit cef116c

Browse files
authored
Merge pull request #6 from mxmgorin/main
Improve Error Message for Getting SQL Type
2 parents 1588681 + 5bce65f commit cef116c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

my-postgres-core/src/sql_value/sql_value_metadata.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[derive(Debug)]
12
pub struct SqlValueMetadata {
23
pub sql_type: Option<&'static str>,
34
pub operator: Option<&'static str>,

my-postgres-core/src/table_schema/sql_type_provider.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl SqlTypeProvider for bool {
132132

133133
impl SqlTypeProvider for DateTimeAsMicroseconds {
134134
fn get_sql_type(metadata: Option<SqlValueMetadata>) -> TableColumnType {
135-
if let Some(metadata) = metadata {
135+
if let Some(metadata) = &metadata {
136136
if let Some(sql_type) = metadata.sql_type {
137137
if sql_type == "timestamp" {
138138
return TableColumnType::Timestamp;
@@ -144,6 +144,6 @@ impl SqlTypeProvider for DateTimeAsMicroseconds {
144144
}
145145
}
146146

147-
panic!("Sql type is not set")
147+
panic!("Sql type is not set: {:?}", metadata)
148148
}
149149
}

0 commit comments

Comments
 (0)