mirror of
https://github.com/flibusta-apps/library_updater.git
synced 2025-12-06 07:45:35 +01:00
Fix position
This commit is contained in:
@@ -402,7 +402,7 @@ impl Update for Sequence {
|
|||||||
pub struct SequenceInfo {
|
pub struct SequenceInfo {
|
||||||
pub book_id: u64,
|
pub book_id: u64,
|
||||||
pub sequence_id: u64,
|
pub sequence_id: u64,
|
||||||
pub position: i64,
|
pub position: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FromVecExpression<SequenceInfo> for SequenceInfo {
|
impl FromVecExpression<SequenceInfo> for SequenceInfo {
|
||||||
@@ -417,14 +417,14 @@ impl FromVecExpression<SequenceInfo> for SequenceInfo {
|
|||||||
_ => panic!("SequenceInfo.sequence_id"),
|
_ => panic!("SequenceInfo.sequence_id"),
|
||||||
},
|
},
|
||||||
position: match &value[2] {
|
position: match &value[2] {
|
||||||
sql_parse::Expression::Integer(v) => v.0.try_into().unwrap(),
|
sql_parse::Expression::Integer(v) => v.0,
|
||||||
sql_parse::Expression::Unary {
|
sql_parse::Expression::Unary {
|
||||||
op,
|
op,
|
||||||
op_span: _,
|
op_span: _,
|
||||||
operand,
|
operand,
|
||||||
} => match (op, operand.as_ref()) {
|
} => match (op, operand.as_ref()) {
|
||||||
(sql_parse::UnaryOperator::Minus, Expression::Integer(v)) => {
|
(sql_parse::UnaryOperator::Minus, Expression::Integer(v)) => {
|
||||||
v.0.try_into().unwrap()
|
v.0
|
||||||
}
|
}
|
||||||
(_, _) => panic!("SequenceInfo.position = {:?}", &value[2]),
|
(_, _) => panic!("SequenceInfo.position = {:?}", &value[2]),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user