Skip to content

Commit 4f98460

Browse files
committed
Allowed specifying timestamp literals in SQL.
1 parent ce40135 commit 4f98460

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

crates/expr/src/statement.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,10 @@ pub fn type_insert(insert: SqlInsert, tx: &impl SchemaView) -> TypingResult<Tabl
128128
(SqlLiteral::Bool(v), AlgebraicType::Bool) => {
129129
values.push(AlgebraicValue::Bool(v));
130130
}
131-
(SqlLiteral::Str(v), AlgebraicType::String) => {
132-
values.push(AlgebraicValue::String(v));
133-
}
134131
(SqlLiteral::Bool(_), _) => {
135132
return Err(UnexpectedType::new(ty, &AlgebraicType::Bool).into());
136133
}
137-
(SqlLiteral::Str(_), _) => {
138-
return Err(UnexpectedType::new(ty, &AlgebraicType::String).into());
139-
}
140-
(SqlLiteral::Hex(v), ty) | (SqlLiteral::Num(v), ty) => {
134+
(SqlLiteral::Num(v), ty) | (SqlLiteral::Hex(v), ty) | (SqlLiteral::Str(v), ty) => {
141135
values.push(parse(&v, ty).map_err(|_| InvalidLiteral::new(v.into_string(), ty))?);
142136
}
143137
}

0 commit comments

Comments
 (0)