35 Commits

Author SHA1 Message Date
Ryan Leckey
f462343787 Split Executor into Executor and RefExecutor
* Allow `conn.fetch(" ... ")` to be called where `conn` is an owned Connection
 * Executor::fetch -> RefExecutor::fetch_by_ref
 * Executor::fetch_by_ref -> Executor::fetch
 * Move `Connection::describe` to `Executor::describe`
 * `Transaction` is no longer a `Connection`
 * `Connection` has `Executor` as a super-trait again which greatly simplifies bounds
2020-03-11 01:43:27 -07:00
Ryan Leckey
0afcf33395 rename Executor::execute to Executor::fetch 2020-03-11 01:43:27 -07:00
Ryan Leckey
72b60e8a7d remove the DB type parameter from HasCursor and push to an associated type; remove Cursor::first 2020-03-11 01:43:27 -07:00
Ryan Leckey
a374c18a18 postgres: rewrite protocol in more iterative and lazy fashion 2020-03-11 01:43:17 -07:00
Ryan Leckey
3795d15e1c postgres: break out TLS and SASL into their own files 2020-03-11 01:43:04 -07:00
Ryan Leckey
ea1a4fb042 add Cursor and rewrite Executor/Query over it
* this breaks a lot internally as-is
 * mysql needs a restructure
2020-03-11 01:43:04 -07:00
Ryan Leckey
bb17ebfbbd make Connect extend Connection to simplify bounds 2020-03-11 01:42:34 -07:00
Austin Bonander
eff7c9e125
fix Pool to remove possibility of "leaking" connections (#84)
* fix `Pool` to reduce possibility of "leaking" connections

now uses RAII guards to control `SharedPool::size`

* add smoke test for `Pool` to both Postgres and MySQL tests

add `Pool::is_closed()`

* fix documentation re: pool

* refactor pool implementation to not use futures oneshot channels

https://github.com/launchbadge/sqlx/pull/84#issuecomment-580476223

* run cargo fmt

* Pool: remove superfluous guard struct, document some internal methods
2020-01-31 23:33:42 -08:00
Wesley Norris
1461891901 Fix passwords not being percent decoded
The password portion of the `Url` type is post-percent encoding
and needs to be manually decoded before processing and being
sent to the server.
2020-01-21 18:53:07 -05:00
Austin Bonander
beba141aec PgConnection: clear buffers after TLS upgrade 2020-01-16 13:30:48 -08:00
Ryan Leckey
809bc3964c Run rustfmt 2020-01-15 01:34:20 -08:00
Ryan Leckey
92f12e11aa Add support for Tokio 2020-01-15 01:17:33 -08:00
Ryan Leckey
b1a27ddac2 Add a Transaction type to simplify dealing with Transactions 2020-01-15 00:22:01 -08:00
Ryan Leckey
28ed854b03 Extract Connection::open into a new trait Connect::connect 2020-01-14 23:58:17 -08:00
Austin Bonander
fc66c8fa3f give examples of connection strings enabling SSL 2020-01-14 12:07:43 -08:00
Ryan Leckey
0a5b527d79 fix import errors and run rustfmt 2020-01-14 10:35:50 -08:00
Austin Bonander
f04e4bdbeb document TLS options for Postgres 2020-01-13 14:54:29 -08:00
Austin Bonander
638852a2dd implement TLS support for Postgres 2020-01-13 11:52:09 -08:00
Ryan Leckey
c4a0ac50df Indicate that we support both forms of SCRAM (just always reject channel binding for now) 2020-01-11 03:52:12 -08:00
Daniel Akhterov
db230e2ce0 Resolve Comments
- Remove `hex` from root `Cargo.toml`
    - Make `hmac` crate optional
    - Clean up checking mechanisms for "SCRAM-SHA-256"
    - Use `str::from_utf8` instead of `String::from_utf8_lossyf
    - Update `Sasl*Response` structs be tuple structs
    - Factor out `len` in `SaslInitialResponse.encode()`
    - Use `protocol_err` instead of `expect` when constructing `Hmacf
      instances
    - Remove `it_connects_to_database_user` test as it was too fragile
    - Move `sasl_auth` function into `postgres/connection` as it more
      related to `Connection` rather than `protocl`
    - Return an error when decoding base64 salt rather than panicing
      in `Authentication::SaslContinue`
2020-01-11 03:33:38 -08:00
Daniel Akhterov
507d988fc4 Implememnt SASL Authentication 2020-01-11 03:33:21 -08:00
Ryan Leckey
e16c043bf9 Add basic docs to MySql and Postgres Connection 2019-12-28 01:01:45 -08:00
Austin Bonander
7d745f98ea implement query_as!() et al, document query macros 2019-12-27 21:45:31 -08:00
Ryan Leckey
d76b1357da Audit MySql and Postgres protocols 2019-12-27 17:31:01 -08:00
Austin Bonander
5192983093 implement Executor::send() 2019-12-19 18:46:37 -08:00
Austin Bonander
8aa931356f WIP implement statement caching for MySQL, perform discussed refactors 2019-12-18 23:02:01 -08:00
Austin Bonander
d8d93867b7 implement prepared statement caching for postgres 2019-12-18 23:02:01 -08:00
Ryan Leckey
871183d23b Minor fixes and run rustfmt 2019-12-03 00:22:02 -08:00
Ryan Leckey
9558ab1c50 Remove bytes usage and update dependencies 2019-12-02 23:26:44 -08:00
Ryan Leckey
6925d5999c Fix mariadb compile errors and remove useless Row wrapper 2019-12-02 21:11:49 -08:00
Ryan Leckey
2227303f20 Have Backend require Executor and de-duplicate some logic 2019-11-27 23:26:20 -08:00
Ryan Leckey
b87edd5a9a Unify sqlx::CompiledSql and sqlx::SqlQuery into sqlx::Query as a common return type between sqlx::query and sqlx::query! 2019-11-22 22:41:37 +00:00
Austin Bonander
4d033963ce use protocol_err! instead of InvalidData in more places 2019-11-22 17:57:00 +00:00
Ryan Leckey
061b7819ab Remove the RawConnection concept and fold into Backend 2019-11-22 11:48:49 +00:00
Austin Bonander
fc07830639 implement facade crate so macros can be used from same namespace 2019-11-22 10:30:16 +00:00