-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
Introduce dynamic query/schema builder factory method #362
Conversation
let connection = AnyPool::connect(url).await.unwrap(); | ||
let mut pool = connection.try_acquire().unwrap(); | ||
let box_query_builder = query_builder_from_kind(pool.kind()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interesting scenario here is to read the DB address from command-line, env or a config file, and as long as it's valid (connection was successful), build a query builder from whatever it resolved to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nitnelave thank you for PR, some comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Since the PR targets sqlx 0.5 (which you are still using) I can only merge that into 0.25.x. master now only targets sqlx 0.6. Would appreciate that you open a PR on that when you upgraded. |
Thanks, opened #371.
…On Fri, Jul 1, 2022 at 2:33 PM Chris Tsang ***@***.***> wrote:
Since the PR targets sqlx 0.5 (which you are still using) I can only merge
that into 0.25.x. master now only targets sqlx 0.6. Would appreciate that
you open a PR on that when you upgraded.
—
Reply to this email directly, view it on GitHub
<#362 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGCPWP42GTHQBS5NLZH3JLVR3QSJANCNFSM5Z3TTK4Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Valentin Tolmer
|
PR Info
Follow-up of #275 to clean up the interface, using launchbadge/sqlx#1228.
Adds
sea_query_binder::query_builder_from_kind
to get a query builder from a dynamic SQLX DB connection.sea_query_binder::schema_builder_from_kind
same for schema.Breaking Changes