Skip to content

Commit 39cbdf5

Browse files
committed
fix
1 parent 4bd2240 commit 39cbdf5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

crates/squawk_ide/src/column_name.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ fn name_from_type(ty: ast::Type, unknown_column: bool) -> Option<(ColumnName, Sy
110110
"time".to_owned()
111111
};
112112
if let Some(ast::Timezone::WithTimezone(_)) = time_type.timezone() {
113-
// time -> timez
114-
// timestamp -> timestampz
115-
name.push('z');
113+
// time -> timetz
114+
// timestamp -> timestamptz
115+
name.push_str("tz");
116116
};
117117
return Some((
118118
ColumnName::new(name.to_string(), unknown_column),
@@ -377,9 +377,9 @@ fn examples() {
377377

378378
// time types
379379
assert_snapshot!(name("cast('12:00:00' as time(6) without time zone)"), @"time");
380-
assert_snapshot!(name("cast('12:00:00' as time(6) with time zone)"), @"time");
381-
assert_snapshot!(name("cast('12:00:00' as timestamp(6) with time zone)"), @"timestamptz");
382-
assert_snapshot!(name("cast('12:00:00' as timestamp(6) without time zone)"), @"timestampt");
380+
assert_snapshot!(name("cast('12:00:00' as time(6) with time zone)"), @"timetz");
381+
assert_snapshot!(name("cast('2024-01-01 12:00:00' as timestamp(6) with time zone)"), @"timestamptz");
382+
assert_snapshot!(name("cast('2024-01-01 12:00:00' as timestamp(6) without time zone)"), @"timestamp");
383383

384384
#[track_caller]
385385
fn name(sql: &str) -> String {

0 commit comments

Comments
 (0)