Skip to content

Commit

Permalink
Fix schema datetime and updated types from Date to DateTime
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrDeveloper committed Nov 12, 2024
1 parent d533cfc commit 436edf7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions crates/gitql-parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2242,7 +2242,7 @@ fn parse_comparison_expression(

// Return error if this operator can't be performed even with implicit cast
return Err(Diagnostic::error(&format!(
"Operator `<` can't be performed between types `{}` and `{}`",
"Operator `>` can't be performed between types `{}` and `{}`",
lhs_type.literal(),
rhs_type.literal()
))
Expand Down Expand Up @@ -2281,7 +2281,7 @@ fn parse_comparison_expression(

// Return error if this operator can't be performed even with implicit cast
return Err(Diagnostic::error(&format!(
"Operator `<=` can't be performed between types `{}` and `{}`",
"Operator `>=` can't be performed between types `{}` and `{}`",
lhs_type.literal(),
rhs_type.literal()
))
Expand Down Expand Up @@ -2320,7 +2320,7 @@ fn parse_comparison_expression(

// Return error if this operator can't be performed even with implicit cast
return Err(Diagnostic::error(&format!(
"Operator `>` can't be performed between types `{}` and `{}`",
"Operator `<` can't be performed between types `{}` and `{}`",
lhs_type.literal(),
rhs_type.literal()
))
Expand Down Expand Up @@ -2359,7 +2359,7 @@ fn parse_comparison_expression(

// Return error if this operator can't be performed even with implicit cast
return Err(Diagnostic::error(&format!(
"Operator `>=` can't be performed between types `{}` and `{}`",
"Operator `<=` can't be performed between types `{}` and `{}`",
lhs_type.literal(),
rhs_type.literal()
))
Expand Down
6 changes: 3 additions & 3 deletions src/git_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::sync::OnceLock;

use gitql_ast::types::base::DataType;
use gitql_ast::types::boolean::BoolType;
use gitql_ast::types::date::DateType;
use gitql_ast::types::datetime::DateTimeType;
use gitql_ast::types::integer::IntType;
use gitql_ast::types::text::TextType;

Expand All @@ -23,12 +23,12 @@ pub fn tables_fields_types() -> HashMap<&'static str, Box<dyn DataType>> {
map.insert("files_changed", Box::new(IntType));
map.insert("email", Box::new(TextType));
map.insert("type", Box::new(TextType));
map.insert("datetime", Box::new(DateType));
map.insert("datetime", Box::new(DateTimeType));
map.insert("is_head", Box::new(BoolType));
map.insert("is_remote", Box::new(BoolType));
map.insert("commit_count", Box::new(IntType));
map.insert("parents_count", Box::new(IntType));
map.insert("updated", Box::new(DateType));
map.insert("updated", Box::new(DateTimeType));
map.insert("repo", Box::new(TextType));
map
}
Expand Down

0 comments on commit 436edf7

Please sign in to comment.