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

SQLx 0.6.0 Release Tracking Issue #1413

Closed
2 of 8 tasks
abonander opened this issue Aug 30, 2021 · 12 comments
Closed
2 of 8 tasks

SQLx 0.6.0 Release Tracking Issue #1413

abonander opened this issue Aug 30, 2021 · 12 comments
Milestone

Comments

@abonander
Copy link
Collaborator

abonander commented Aug 30, 2021

Our SQLx-Next initiative (#1163) has been pushed back to 0.7.0 as we wait for Generic Associated Types to be stabilized, as GATs will make it possible to do a lot of cleanup in the API.

In the meantime, we've decided to backport a handful of features we're really excited for, as well as merge in some feature work from contributors that has been in the pipeline for a while.

Backport

Database-agnostic syntax for bind parameters, providing named parameters and comma-expansion for arrays.

Additionally, the query!() family of macros will support implicit bindings from scope like that proposed for format_args! in RFC #2795:

let bars = vec!["bar1", "bar2", "bar3"];
let baz = 1i32;

sqlx::query!("UPDATE foo SET baz = {baz} WHERE bar IN ({bars+})")
    .execute(&mut conn)
    .await?;
sqlx::query("INSERT INTO foo(bar, baz) VALUES (%bar, %baz)")
    .bind_as("bar", &bar)
    .bind_as("baz", &baz)

Contributions

Eliminates dealing with constant merge conflicts in sqlx-data.json with multiple people contributing to the same repository.

The macros will be able to save their data automatically which means you shouldn't need to remember cargo sqlx prepare as long as you've built the project at least once after adding or changing a macro definition.

Compiling in offline mode should be faster as projects with many query!() invocations won't need to repeatedly re-parse the same gigantic file. This would be further improved by using a binary file format supporting zero-copy parsing, like Cap'N'Proto.

The PR currently open (#1345) implements a basic low-level API which we can build on later with a strongly typed interface. Still, if you're looking to shove a giant CSV file into your database, this would be the place to start.

This should finally allow use of Vec<T> where T is a custom type with #[derive(sqlx::Type)].

Misc

We will probably need to retain support for time 0.2 under a time-02 feature for at least the next couple releases.

@abonander abonander pinned this issue Aug 30, 2021
@abonander abonander added this to the 0.6.0 milestone Aug 30, 2021
@jplatte
Copy link
Contributor

jplatte commented Aug 31, 2021

I'm excited for one-file-per-query, but I'm worried a bit that it will take a while before that will be done, and it's not clear how far along generalized query placeholders are either / how much work it is to backport them.

Can we have a 0.5.8 release first with a bunch of features that already have PRs? From a quick skim of the open PRs, these all seem to likely be mergeable as-is and non-breaking.

@abonander
Copy link
Collaborator Author

abonander commented Aug 31, 2021

I was planning on preparing a 0.5.8 release, though I initially wanted to keep it to just bugfixes as I was thinking of saving all the new features for the 0.6.0 release. It feels weird to me adding features in what is ostensibly a "patch" release. However, looking back through the changelog it appears we have added backwards-compatible features in 0.x.{y + 1} releases before so I'm fine with following that precedent.

Limiting the scope of 0.6.0 would also help get it out sooner, I suppose.

For generalized placeholders, I have the parsing implemented and was starting to integrate it into the Postgres and MySQL drivers on the next branch. That got a bit complicated with the whole "supporting both sync and async APIs" stuff so I think it's probably easier to backport it than integrate it into next.

Incidentally, your PR #1385 also effectively backports some of that work as I was also wanting to fix the trait impls for arrays. I would also like to add impl<T, const N: usize> Type for [T; N] but that would bump our MSRV (although officially we only support the latest stable Rust release, I think it would be inconsiderate to add a feature in 0.5.8 that requires a significantly newer Rust than 0.5.0 did) so I am probably going to save that for 0.6.0.

One file per query, I think I have a solid implementation plan for. I haven't looked at your old PR in too much depth but I may either reuse that or start from scratch, I'm not sure yet. I don't think it'll be all that much work, though.

@paolobarbolini
Copy link
Contributor

Misc

* [ ]  Add support for `time 0.3` ([`time` dependency out of date #1277](https://github.com/launchbadge/sqlx/issues/1277))

There are a few more dependencies that need updating (see https://deps.rs/repo/github/launchbadge/sqlx).
I just sent a PR for ipnetwork (#1426) but I could also do a few more if I find the time to send them.

@ericsampson
Copy link

Hi Austin, it would be really useful for us to have the proposed #[sqlx(flatten)] FromRow attribute discussed in #156 as part of 0.6.0

I'm willing to give it a shot, if someone can provide some hints as to how I might approach the changes needed in derives/row.rs

@LukeMathWalker
Copy link
Contributor

The features you are planning to backport will have a significant (positive!) impact on the ergonomics of sqlx - really looking forward to the release! 😁

@msdrigg
Copy link

msdrigg commented Nov 3, 2021

I read some discussion earlier (#909) that mentioned efficient batch insertion as a point of interest for the 0.6 release. Is this still being considered? I might have missed it, but the tasks mentioned above didn't seem to cover it.

@abonander
Copy link
Collaborator Author

That is one of the main goals of #875 with the comma-expanded lists.

@paolobarbolini
Copy link
Contributor

I'd love to also be able to get uuid v1 in when it's ready
https://github.com/uuid-rs/uuid/releases/tag/1.0.0-alpha.1

@mara-schulke
Copy link

I would love to see built in support for multiple schemas / schemas with names other than public, scoping types to schemas (#1171)

@djc
Copy link
Contributor

djc commented Jun 9, 2022

I'd like to better understand what's blocking this. None of the PRs in the linked milestone seem to have seen recent progress, which of them are supposed to be blocking at this point? Maybe it could make sense to at least put out a beta or something so it's a little bit easier to test this?

(It looks like there was a plan to get 0.6 out soon back in April, but nothing seems to have come out of that, without any followup in this issue.)

@djc
Copy link
Contributor

djc commented Jun 20, 2022

Seems to have been released 3 days ago. Thanks!

@abonander
Copy link
Collaborator Author

We unfortunately didn't land most of the planned features due to lack of development time to dedicate to them, but 0.6.0 still ended up being quite substantial. See the changelog entry for details: https://github.com/launchbadge/sqlx/blob/main/CHANGELOG.md#060---2022-06-16

@abonander abonander unpinned this issue Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants