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

Blog post about SeaQuery release #64

Merged
merged 4 commits into from
Oct 31, 2022

Conversation

ikrivosheev
Copy link
Member

@netlify
Copy link

netlify bot commented Oct 30, 2022

Deploy Preview for seaql ready!

Name Link
🔨 Latest commit f1fc64e
🔍 Latest deploy log https://app.netlify.com/sites/seaql/deploys/635ed094ab0865000dab5c1e
😎 Deploy Preview https://deploy-preview-64--seaql.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@tyt2y3
Copy link
Member

tyt2y3 commented Oct 30, 2022

Thank you!

I want to add something about the (huge effort) of binder:

"""
We have reworked the way drivers work in SeaQuery: priori to 0.27, users have to invoke the sea_query_driver* macro. Now each driver sqlx, postgres & rusqlite has their own supporting crate, which integrates tightly with the corresponding libraries.

// before
sea_query::sea_query_driver_postgres!();
use sea_query_driver_postgres::{bind_query, bind_query_as};

    let (sql, values) = Query::select()
        .from(Character::Table)
        .expr(Func::count(Expr::col(Character::Id)))
        .build(PostgresQueryBuilder);

    let row = bind_query(sqlx::query(&sql), &values)
        .fetch_one(&mut pool)
        .await
        .unwrap();

// now
use sea_query_binder::SqlxBinder;

    let (sql, values) = Query::select()
        .from(Character::Table)
        .expr(Func::count(Expr::col(Character::Id)))
        .build_sqlx(PostgresQueryBuilder);

    let row = sqlx::query_with(&sql, values)
        .fetch_one(&mut pool)
        .await
        .unwrap();

// You can now make use of SQLx's `query_as_with` nicely:

    let rows = sqlx::query_as_with::<_, StructWithFromRow, _>(&sql, values)
        .fetch_all(&mut pool)
        .await
        .unwrap();

"""

@tyt2y3
Copy link
Member

tyt2y3 commented Oct 30, 2022

I also think it's worth giving examples for SeaQL/sea-query#347 "Table Column with Default Expression" and "InsertStatement::values, UpdateStatement::values now accepts IntoIterator<Item = SimpleExpr> instead of IntoIterator<Item = Value>"
and "Added OnConflict::value and OnConflict::values"

@ikrivosheev
Copy link
Member Author

I also think it's worth giving examples for SeaQL/sea-query#347 "Table Column with Default Expression" and "InsertStatement::values, UpdateStatement::values now accepts IntoIterator<Item = SimpleExpr> instead of IntoIterator<Item = Value>" and "Added OnConflict::value and OnConflict::values"

@tyt2y3 thank you for review! Done!

@tyt2y3 tyt2y3 merged commit 156b719 into SeaQL:master Oct 31, 2022
@tyt2y3
Copy link
Member

tyt2y3 commented Oct 31, 2022

@ikrivosheev
Copy link
Member Author

@ikrivosheev ikrivosheev deleted the feature/sea-query_release_0.27 branch November 1, 2022 08:32
@ikrivosheev
Copy link
Member Author

@tyt2y3
Copy link
Member

tyt2y3 commented Nov 5, 2022

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.

What's new in SeaQuery 0.27.0
2 participants