Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small improvments #448

Merged
merged 6 commits into from
Sep 25, 2022
Merged

Conversation

ikrivosheev
Copy link
Member

@ikrivosheev ikrivosheev commented Sep 19, 2022

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)

Copy link
Member

@billy1624 billy1624 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  • /// let query = Query::select()
    /// .column(Glyph::Image)
    /// .from(Glyph::Table)
    /// .cond_where(
    /// Cond::any()
    /// .add(Expr::tbl(Glyph::Table, Glyph::Aspect).is_in(vec![3, 4]))
    /// .add(Expr::tbl(Glyph::Table, Glyph::Image).like("A%"))
    /// )
    /// .to_owned();
  • vec![3, 4] can be [3, 4]

@tyt2y3
Copy link
Member

tyt2y3 commented Sep 20, 2022

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

@ikrivosheev
Copy link
Member Author

ikrivosheev commented Sep 21, 2022

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

Copy link
Member

@billy1624 billy1624 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ikrivosheev, thanks for the hard work!! :)

@tyt2y3 tyt2y3 merged commit 99fd103 into SeaQL:master Sep 25, 2022
@tyt2y3
Copy link
Member

tyt2y3 commented Sep 25, 2022

Thank you. This is lots of small improvements indeed.

@ikrivosheev ikrivosheev deleted the feature/small_improvments branch September 25, 2022 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants