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

[Postgres] Add support for LISTEN/NOTIFY #131

Merged
merged 51 commits into from
Mar 17, 2020
Merged

[Postgres] Add support for LISTEN/NOTIFY #131

merged 51 commits into from
Mar 17, 2020

Commits on Mar 15, 2020

  1. Add Connection::begin

    mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    c7d416a View commit details
    Browse the repository at this point in the history
  2. postgres: clean up protocol

    mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    7a98253 View commit details
    Browse the repository at this point in the history
  3. mysql: clean up protocol

    mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    27cd552 View commit details
    Browse the repository at this point in the history
  4. Run rustfmt

    mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    cca0963 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    553f03f View commit details
    Browse the repository at this point in the history
  6. sqlite: stub

    mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    5d042e3 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7ab0701 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1a48cf3 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    0421c9f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    30897dd View commit details
    Browse the repository at this point in the history
  11. Run rustfmt

    mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    444ffff View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    751efdf View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    a3799c3 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    5f27026 View commit details
    Browse the repository at this point in the history
  15. sqlite: implement describe

    mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    0130fe1 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    63ef321 View commit details
    Browse the repository at this point in the history
  17. sqlite: make the implementation far less naive

     * WAL
     * sync = NORMAL, thought on this for awhile, all signs point to this being a very good default for WAL usage
     * separate worker thread per SQLite connection
    mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    69ea41d View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    c661fdd View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    cddaf1b View commit details
    Browse the repository at this point in the history
  20. suppress unused warnings

    mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    dd99fc3 View commit details
    Browse the repository at this point in the history
  21. Add SQLite to CI

    mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    68853ad View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    21097e1 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    2abc451 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    97b50b9 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    69b1d7f View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    426361f View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    f667910 View commit details
    Browse the repository at this point in the history
  28. sqlite: produce connection specific errors

    postgres, mysql: use derive for Debug for error types
    mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    68d4a0d View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    ab20db1 View commit details
    Browse the repository at this point in the history
  30. Implement Postgres LISTEN interface.

    This changeset introduces an interface for using PostgreSQL's LISTEN
    functionality from within sqlx.
    
    The listen interface is implemented over the PgConnection, PgPool & the
    PgPoolConnection types for ease of use. In the case of PgPool, a new
    connection is acquired, and is then used for LISTEN functionality.
    
    Closes #87
    thedodd authored and mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    a52f364 View commit details
    Browse the repository at this point in the history
  31. Updates from review and from testing.

    thedodd authored and mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    cb186e6 View commit details
    Browse the repository at this point in the history
  32. Impl a few features & refactor some code based on design discussion.

    Extension traits are now being used for PgConnection, PgPoolConnection &
    PgPool for listen/notify functionality. Only two extension traits were
    introduced.
    
    Only a single trait method is present on the extension traits and it
    works for single or multi channel listening setups.
    
    Automatic reconnect behavior is implemented for PgPool based listeners.
    All logic has been cut over to the `recv` impls for the PgListener
    variants.
    
    Use async-stream for a nice Stream interface.
    thedodd authored and mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    f831808 View commit details
    Browse the repository at this point in the history
  33. A good bit of refactoring.

    Broke up PgListener into two types. PgListener for basic one-off
    connections, and PgPoolListener for the listener created from the
    PgPool.
    
    The API is a bit more clear now with this change in terms of reconnect
    behavior and the like.
    
    Update `fn stream` to be `fn into_stream`, as that nomenclature is a bit
    more normative in the Rust ecosystem.
    thedodd authored and mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    a0da99e View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    ae7e15c View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    75a7639 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    608556f View commit details
    Browse the repository at this point in the history
  37. Update stream impls.

    The basic PgListener stream impl now yields `Result<PgNotification>`
    elements without an `Option` in the result. The option condition
    originally represented the closure of the underlying connection. Now
    such conditions will terminate the stream, as one would expect. The
    `PgListener.recv()` method signature has not been changed.
    
    PgPoolListener has also been updated. The interfaces on this struct will
    never yield an inner `Option` as it will instead acquire a new
    connection and continue its work. Both the stream impl & the `recv`
    method have received an update to their signatures.
    thedodd authored and mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    82923a1 View commit details
    Browse the repository at this point in the history
  38. Remove the Drop impl for PgPoolListener.

    This is being removed as it was causing undesired behavior under some
    contexts.
    thedodd authored and mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    3db54dd View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    4419aea View commit details
    Browse the repository at this point in the history
  40. Inline MaybeOwned in ConnectionSource and add another variant to stor…

    …e owned or ref connections
    mehcode committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    12e250b View commit details
    Browse the repository at this point in the history

Commits on Mar 17, 2020

  1. Configuration menu
    Copy the full SHA
    dc8e36c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5cb0d9d View commit details
    Browse the repository at this point in the history
  3. Add DatabaseError::code

    mehcode committed Mar 17, 2020
    Configuration menu
    Copy the full SHA
    1d0100b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0ecacfa View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b80080a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f677748 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    ed9d6c3 View commit details
    Browse the repository at this point in the history
  8. listen: merge PgListener and PgPoolListener; allow PgListener to be u…

    …sed as an Executor; allow channels to be adjusted at run-time
    mehcode committed Mar 17, 2020
    Configuration menu
    Copy the full SHA
    e99e80c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    57d414f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    0e3eb7c View commit details
    Browse the repository at this point in the history
  11. move around re-exports

    mehcode committed Mar 17, 2020
    Configuration menu
    Copy the full SHA
    c44084d View commit details
    Browse the repository at this point in the history