Commit Graph

56 Commits

Author SHA1 Message Date
Steven Fackler
a54ee29704 Allow opt-out of transaction settings
If you changed the default transaction settings of the session, you may
need an explicit opt-out.
2020-01-10 17:49:18 -08:00
Steven Fackler
214413d9dc Add transaction builders
Closes #543
2020-01-08 17:23:28 -08:00
Nikhil Benesch
33dbbcbee7
Support cancellation in synchronous client 2019-12-29 14:08:17 -05:00
Steven Fackler
4a5a277878 query_opt test 2019-12-10 16:34:04 -08:00
Steven Fackler
bf8b335d2b Move binary copy stuff directly into main crate 2019-12-08 18:30:47 -08:00
Steven Fackler
5c33bf8b30 Don't take parameters in copy_in and copy_out
Postgres doesn't support them, so we may as well not provide the option!

Closes #523
2019-12-04 18:51:59 -08:00
Steven Fackler
b4694471ad Add query_opt
Closes #510
2019-11-30 18:18:50 -05:00
Steven Fackler
e5e03b0064 Change the copy_in interface
Rather than taking in a Stream and advancing it internally, return a
Sink that can be advanced by the calling code. This significantly
simplifies encoding logic for things like tokio-postgres-binary-copy.

Similarly, the blocking interface returns a Writer.

Closes #489
2019-11-30 11:04:59 -05:00
Steven Fackler
12c2ef79b6 Upgrade to tokio 0.2/futures 0.3 2019-11-26 16:32:36 -08:00
Steven Fackler
01cc7e4715 Clean up derived code 2019-10-10 16:03:48 -07:00
Steven Fackler
31855141d2 Add query_one 2019-10-09 17:45:53 -07:00
Steven Fackler
8c28f8b363 Overhaul simple_query 2019-10-09 17:04:24 -07:00
Steven Fackler
a3f611d609 Overhaul copy_out 2019-10-08 19:01:34 -07:00
Steven Fackler
b8577b45b1 Overhaul query_portal 2019-10-08 17:22:56 -07:00
Steven Fackler
2517100132 Overhaul query
This is the template that we'll use for all other methods taking
parameters. The `foo_raw` variant is the most flexible (but annoying to
use), while `foo` covers the expected common case.
2019-10-08 17:15:41 -07:00
Steven Fackler
0d2d554122 Add a ToStatement trait in tokio-postgres 2019-10-08 19:36:24 -04:00
Steven Fackler
6c3a4ab192 Add channel_binding=disable/prefer/require to config
Closes #487
2019-09-24 17:03:37 -07:00
Steven Fackler
b7fe6bece5 Update to newest nightly 2019-09-11 22:20:22 -04:00
Steven Fackler
2a2b76d1b8 Upgrade to tokio alpha.4 2019-08-29 18:10:58 -07:00
Steven Fackler
c026644820 async_await is stable on nightly now 2019-08-21 07:48:36 -04:00
Steven Fackler
2a97c20bf2 Clean up old test 2019-08-02 20:31:15 -07:00
Steven Fackler
26a17ac4ed Support portals 2019-08-01 20:43:13 -07:00
Steven Fackler
5dccb9988a Test notifications 2019-07-31 21:19:56 -07:00
Steven Fackler
9c178ad816 Support copy_out 2019-07-31 20:15:17 -07:00
Steven Fackler
beb509f3f3 rustfmt 2019-07-30 21:29:18 -07:00
Steven Fackler
f45884711f Support copy_in 2019-07-30 21:25:30 -07:00
Steven Fackler
4afd5235db Transaction support 2019-07-30 19:54:30 -07:00
Steven Fackler
88399a790c Cancel query support 2019-07-29 21:36:07 -07:00
Steven Fackler
dea6c3ebc5 Fix target_session_attrs handling 2019-07-28 17:48:32 -07:00
Steven Fackler
9938ffff1a Test and fix simple_query 2019-07-28 16:34:07 -07:00
Steven Fackler
51f02c89ee Fully working prepare 2019-07-28 09:26:04 -07:00
Steven Fackler
4396f38fcc Setup socket 2019-07-25 07:21:53 -07:00
Steven Fackler
77caff91ef Add query/select 2019-07-24 21:28:52 -07:00
Steven Fackler
90eb58dc8e Some prep for custom type lookup 2019-07-23 20:16:31 -07:00
Steven Fackler
f9e46510ba Implement prepare 2019-07-23 19:54:22 -07:00
Steven Fackler
2480fefd2c Connection IO logic 2019-07-22 21:27:21 -07:00
Steven Fackler
32fe52490e Runtime connect 2019-07-22 20:17:29 -07:00
Steven Fackler
89501f66d9 Start on std::futures rewrite
connect_raw works!
2019-07-21 21:44:43 -07:00
Steven Fackler
db462eb018 Avoid copies in copy_in
copy_in data was previously copied ~3 times - once into the copy_in
buffer, once more to frame it into a CopyData frame, and once to write
that into the stream.

Our Codec is now a bit more interesting. Rather than just writing out
pre-encoded data, we can also send along unencoded CopyData so they can
be framed directly into the stream output buffer. In the future we can
extend this to e.g. avoid allocating for simple commands like Sync.

This also allows us to directly pass large copy_in input directly
through without rebuffering it.
2019-06-25 18:54:17 -07:00
Steven Fackler
31534b5734 Fix serde docs 2019-03-04 21:51:44 -08:00
Steven Fackler
48af741192 Add a simple_query test 2019-01-31 20:47:42 -08:00
Steven Fackler
32e09dbb91 Change batch_execute into simple_query
Closes #413
2019-01-31 20:35:17 -08:00
Steven Fackler
725b7153b6 Move futures/streams to a submodule 2019-01-17 21:14:09 -08:00
Steven Fackler
b3fdf168e5 Add a warning about transaction semantics 2019-01-17 20:35:12 -08:00
Steven Fackler
2d3b9bb1c6 Move the TLS mode into config 2019-01-13 15:07:20 -08:00
Steven Fackler
5b045940f4 Rename handshake to connect_raw 2019-01-07 21:45:09 -08:00
Steven Fackler
03d1a5aed3 Fix build 2019-01-07 21:10:15 -08:00
Steven Fackler
1f6d9ddc06 Overhaul query cancellation
Multi-host support means we can't simply take the old approach - we need
to know which of the hosts we actually connected to. It's also nice to
move this from the connection to the client since that's what you'd
normally have access to.
2019-01-06 18:03:51 -08:00
Steven Fackler
e0d113791c Rename raw cancel query 2019-01-06 11:33:22 -08:00
Steven Fackler
9116147aee Rename Builder to Config 2018-12-29 21:00:58 -08:00