-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Blog post about SeaQuery release #64
Conversation
ikrivosheev
commented
Oct 30, 2022
- Closes What's new in SeaQuery 0.27.0 #55
✅ Deploy Preview for seaql ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Thank you! I want to add something about the (huge effort) of binder: """ // 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(); """ |
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>" |
@tyt2y3 thank you for review! Done! |
I changed the slug to https://www.sea-ql.org/blog/2022-10-31-whats-new-in-seaquery-0.27.0/ |
Yes, I can. |