Commit graph

26 commits

Author SHA1 Message Date
Ryan Leckey
f83e0296cc don't use now private module runtime in tests 2020-03-24 03:13:12 -07:00
Oliver Bøving
b7e53e885a First draft of JSON/JSONB support for postgres
This introduces two new wrapper types `Json` and `Jsonb`, currently
exported by `sqlx::postgres::{Json, Jsonb}` and adds serde and
serde_json as optional dependencies, under the feature flag `json`.
Wrapping types in `Json[b]` that implement `serde::Deserialize` and
`serde::Serialize` allows them to be decoded and encoded respectivly.
2020-03-20 23:59:25 -07:00
Ryan Leckey
1fc18460b0 transaction: document, test, and fix operation of nested transactions 2020-03-18 22:46:44 -07:00
Ryan Leckey
d380f4b4a8 remove is_null_type and use Option<TypeInfo> 2020-03-17 21:43:41 -07:00
Ryan Leckey
ff722d0e62 Run rustfmt 2020-03-17 19:35:01 -07:00
Ryan Leckey
d77b2b1e97 derives: update for new Decode/Encode traits and extensively test in usage 2020-03-17 19:26:59 -07:00
Ryan Leckey
7a98253840 postgres: clean up protocol 2020-03-14 17:43:06 -07:00
Ryan Leckey
c7d416a1c3 Add Connection::begin 2020-03-14 17:43:06 -07:00
Ryan Leckey
a165615f53 row: Row::get panics, Row::try_get is fallible, Query::map panics, Query::try_map is fallible 2020-03-11 03:32:52 -07:00
Ryan Leckey
672f83c00e use pin-project and fix impl of GuardedFlush 2020-03-11 01:47:29 -07:00
Austin Bonander
4163388298 add nullability info to Describe
implement nullability check for Postgres as a query on pg_attribute

implement type name fetching for Postgres as part of `describe()`

add nullability for describe() to MySQL

improve errors with unknown result column type IDs in `query!()`

run cargo fmt and fix warnings

improve error when feature gates for chrono/uuid types is not turned on

workflows/rust: add step to UI-test missing optional features

improve error for unsupported/feature-gated input parameter types

fix `PgConnection::get_type_names()` for empty type IDs list

fix `tests::mysql::test_describe()` on MariaDB 10.4

copy-edit unsupported/feature-gated type errors in `query!()`

Postgres: fix SQL type of string array

closes #107
closes #17

Co-Authored-By: Anthony Dodd <Dodd.AnthonyJosiah@gmail.com>
2020-03-11 01:46:06 -07:00
Ryan Leckey
f18ab2fecb tweak type decoding in text mode for floats 2020-03-11 01:44:06 -07:00
Ryan Leckey
8e8cf6db20 postgres: fix various issues and add more tests 2020-03-11 01:44:06 -07:00
Ryan Leckey
433aab1e5b postgres: use RawValue in Decode and implement row-returning simple queries 2020-03-11 01:44:06 -07:00
Austin Bonander
0cb7bd1185 make macros work again 2020-03-11 01:43:27 -07:00
Ryan Leckey
7404708bab adjust Cursor::map to work through black magic hacks and hope we get GATs soon 2020-03-11 01:43:17 -07:00
Ryan Leckey
a374c18a18 postgres: rewrite protocol in more iterative and lazy fashion 2020-03-11 01:43:17 -07:00
Ryan Leckey
7201f637bf Fix #104, need to advance buffer index to account for the null (one 32-bit length val of -1) 2020-02-01 00:33:59 -08: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
Ryan Leckey
92f12e11aa Add support for Tokio 2020-01-15 01:17:33 -08:00
Austin Bonander
638852a2dd implement TLS support for Postgres 2020-01-13 11:52:09 -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
92f3f8cf6f Finish reallocation strategy for BufStream
Fixes #30
2020-01-06 10:53:56 -08:00
Ryan Leckey
56a82346f2 Run cargo fmt 2019-12-27 20:44:03 -08:00
Ryan Leckey
d76b1357da Audit MySql and Postgres protocols 2019-12-27 17:31:01 -08:00