Skip to content

Commit

Permalink
feat: add column_struct_operation.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
iajoiner committed Nov 1, 2024
1 parent 7598b5c commit e002ee2
Show file tree
Hide file tree
Showing 3 changed files with 2,297 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/proof-of-sql-parser/src/posql_time/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ pub enum PoSQLTimeUnit {
Nanosecond,
}

impl From<PoSQLTimeUnit> for i8 {
fn from(value: PoSQLTimeUnit) -> i8 {
match value {
PoSQLTimeUnit::Second => 0,
PoSQLTimeUnit::Millisecond => 3,
PoSQLTimeUnit::Microsecond => 6,
PoSQLTimeUnit::Nanosecond => 9,
}
}
}

impl TryFrom<&str> for PoSQLTimeUnit {
type Error = PoSQLTimestampError;
fn try_from(value: &str) -> Result<Self, PoSQLTimestampError> {
Expand Down
Loading

0 comments on commit e002ee2

Please sign in to comment.