Skip to content

SQLx Next (0.7+) Tracking Issue #1163

Closed as not planned
Closed as not planned

Description

@mehcode

Things are taking longer than we'd like on this so I'm putting up a tracking issue to share some insight on what remains to be done in the next branch.

  • Type-safe macros ( query!, etc. )

  • Transactions

  • Streams (fetch)

  • Pool

       PgConnectOptions::parse("postgres://....")?
         .tls( .... )
         .pooled() // -> PgPoolOptions
         .max_connections(10)
         .connect().await? // Pool (either this or finish)
         .finish() // Pool (either this or connect) 
  • Database Errors

  • Generalized Query Placeholders [Next] [Feature] Generalized query placeholders (including support for expanding arrays into multiple placeholders) #875

    • Positional {0} becomes $n or ?n or @pn, etc.
    • Named {name} is resolved to a positional parameter so this works anywhere - not just sqlite
    • Zero or More Repetition {name+} = NULL or $1, $2, ...
    • Field Expressions in parens {(x.y.z)}
    • Implicit parameter scope
    • Explicit parameter scope with ..some_struct Struct update rest pattern syntax support for named bindings #591
  • Runtime named parameters

  • TLS

  • Any (Driver)

  • Derives

    • FromRow
    • Type
  • Query logging

  • Statement caching

  • MySQL

    • Type parity
    • Support for MySQL 5.5
    • Use Error::Client for client errors
  • PostgreSQL

    • Support for SASL (authentication)
    • Type parity
    • Listener
    • Database error
  • SQLite

The PostgreSQL and MySQL drivers are done enough to test and prod the basics if anyone has time to poke it.

Activity

  1. pinned this issue on Apr 9, 2021
  2. link2xt commented on Apr 17, 2021

    @link2xt
    Contributor

    Does the next branch include all the fixes from the master branch? Are fixes cherry-picked, merged or is the branch occasionally rebased? Currently it says the branch is 1850 commits behind master.

  3. mehcode commented on Apr 17, 2021

    @mehcode
    ContributorAuthor

    The next branch is a full rewrite of at least the core that is being developed in parallel at the moment. Postgres and MySQL are nearing feature parity with master. Once that happens we'll port the test suite and then audit the comparison to ensure we don't miss anything important. I know there will probably be some bumps but there are some good reasons for why a lot of these changes couldn't have easily been done iteratively, notably the runtimes and cancellation safety.

  4. gyzerok commented on Aug 12, 2021

    @gyzerok

    @mehcode how up to date are checkboxes? Would you mind updating them?

  5. amitavaghosh1 commented on Aug 17, 2021

    @amitavaghosh1

    Could you guys also please look at the enum issue in mysql? where query_as! works fine but query_as() fails to do it properly. Right now we are overriding FromRow manually

  6. changed the title [-]SQLx Next (0.6+) Tracking Issue[/-] [+]SQLx Next (0.7+) Tracking Issue[/+] on Aug 30, 2021
  7. nyurik commented on Feb 17, 2023

    @nyurik
    Contributor

    Would it be possible to re-release the old 0.6 as 0.7 with just the breaking libsqlite3-sys bump to 0.25.2?

    All pending changes in the main would then go to 0.8 instead. It's not like numbers have much "value" in of itself, easy to increment - and minor bump would indicate the breaking nature of the change, even though it would contain just a tiny but breaking fix.

  8. galah92 commented on Mar 19, 2023

    @galah92

    Would it be possible to re-release the old 0.6 as 0.7 with just the breaking libsqlite3-sys bump to 0.25.2?

    +1

  9. lu-zero commented on Apr 5, 2023

    @lu-zero

    If somebody volunteers time to prepare such 0.6+sqlite-fix branch could it be published once ready?

  10. nyurik commented on Apr 13, 2023

    @nyurik
    Contributor

    I created a new PR that just bumps the sqlite3 #2455 based on the v0.6.3 release. See the description there, as it requires a new branch in order to be merged.

  11. mrl5 commented on Jul 9, 2023

    @mrl5
    Contributor

    hello, I noticed that changelog doesn't mention breaking change related to sqlx prepare - namely --merged flag is no longer supported.

    to reproduce

    cargo install --version 0.7.0 sqlx-cli

    and then run

    cargo sqlx prepare --merged -D "${DB_URI}"

    actual result

    error: Found argument '--merged' which wasn't expected, or isn't valid in this context
    
    	If you tried to supply `--merged` as a value rather than a flag, use `-- --merged`
    
    USAGE:
        cargo sqlx prepare [OPTIONS] --database-url <DATABASE_URL> [-- <ARGS>...]
    
    For more information try --help
    

    expected result
    I'm not really sure. Does it mean that with 0.7.0 I no longer need to have sqlx-data.json?

  12. stefankreutz commented on Jul 9, 2023

    @stefankreutz
  13. mrl5 commented on Jul 9, 2023

    @mrl5
    Contributor

    unfortunately after migrating to 0.7.0 and changing --merged to --workspace here

    I'm getting:

    warning: no queries found
    

    and empty .sqlx directory on top level - I've tried to audit https://github.com/launchbadge/sqlx/blob/v0.7.0/sqlx-cli/src/prepare.rs but I have no clue why it's unable to find queries :/

    update

    ok so I had to:

    1. bump sqlx version also in Cargo.toml - seems like sqlx-cli requires version compatibility
    2. remove offline feature:
    -sqlx = { version = "^0", features = [
    +sqlx = { version = "0.7.0", features = [
         "chrono",
         "macros",
         "migrate",
    -    "offline",
         "postgres",
  14. mrl5 commented on Jul 12, 2023

    @mrl5
    Contributor

    seems like #2086 introduced breaking change also for projects that don't do custom impl of PgHasArrayType (contrary to #2086 (comment))

    more info in #2611

  15. unpinned this issue on Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions