sea-query icon indicating copy to clipboard operation
sea-query copied to clipboard

Small improvments

Open ikrivosheev opened this issue 3 years ago • 2 comments

PR Info

Changes

  • deprecated: OnConflict::update_value, we can now use OnConflict::update_expr
  • deprecated: OnConflict::update_values, we can now use OnConflict::update_exprs
  • Remove unneeded vec!, we can use array (rust version 1.51)
  • Improve OrderedStatement::order_by_customs (instead Vec<_> parameter is generic)
  • Improve OrderedStatement::order_by_columns (instead Vec<_> parameter is generic)
  • Improve OverStatement::partition_by_customs (instead Vec<_> parameter is generic)
  • Improve OverStatement::partition_by_columns (instead Vec<_> parameter is generic)

ikrivosheev avatar Sep 19 '22 21:09 ikrivosheev

I felt like I have cleaned up some portion in 1dffb72e195bef76fbfffd8d3ead45d12d57bbba

tyt2y3 avatar Sep 20 '22 16:09 tyt2y3

Hey @ikrivosheev, nice one!

I always want to do it but haven't start loll Can we also refactor all other vec![]? I believe most of them can be simplify to [] slice. For example:

* https://github.com/SeaQL/sea-query/blob/c9b9c66af932c6f8f34b63b17ad6242af79a1f0e/src/query/condition.rs#L130-L138

* `vec![3, 4]` can be `[3, 4]`

@billy1624 @tyt2y3 Done! Remove all unneeded vec! and some other improvements! I updated PR description

ikrivosheev avatar Sep 21 '22 17:09 ikrivosheev

Thank you. This is lots of small improvements indeed.

tyt2y3 avatar Sep 25 '22 06:09 tyt2y3