Anthony Dodd
a0da99e128
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.
2020-03-15 02:17:14 -07:00
Anthony Dodd
f83180861b
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.
2020-03-15 02:17:14 -07:00
Anthony Dodd
cb186e6a13
Updates from review and from testing.
2020-03-15 02:17:14 -07:00
Anthony Dodd
a52f36468b
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
2020-03-15 02:17:14 -07:00
Ryan Leckey
ab20db14a2
Remove Sqlite prefix from SqliteStatement as it is an internal API
2020-03-15 02:16:31 -07:00
Ryan Leckey
68d4a0d258
sqlite: produce connection specific errors
...
postgres, mysql: use derive for Debug for error types
2020-03-15 02:14:23 -07:00
Ryan Leckey
f667910cbf
sqlite: SqliteResultValue -> SqliteValue to match other drivers
2020-03-15 01:54:43 -07:00
Ryan Leckey
426361f361
sqlite: make SqliteConnection and Statement !Sync
2020-03-15 01:48:51 -07:00
Ryan Leckey
69b1d7feaa
sqlite: add even more notes about Send/Sync
2020-03-15 00:34:13 -07:00
Ryan Leckey
97b50b95c0
sqlite: ensure that we additionally clear the bindings when resetting the statement
2020-03-14 23:48:00 -07:00
Ryan Leckey
2abc451655
sqlite: re-order Executor methods
2020-03-14 23:45:14 -07:00
Ryan Leckey
21097e1436
sqlite: clarlify Sync guarantee
2020-03-14 23:45:03 -07:00
Ryan Leckey
68853adc31
Add SQLite to CI
2020-03-14 20:17:59 -07:00
Ryan Leckey
dd99fc351c
suppress unused warnings
2020-03-14 19:54:19 -07:00
Ryan Leckey
cddaf1b34e
remove unused import for spawn_blocking
2020-03-14 19:47:36 -07:00
Ryan Leckey
c661fdde19
sqlite: macros: initial support for the query macros
2020-03-14 19:45:28 -07:00
Ryan Leckey
69ea41de1e
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
2020-03-14 19:45:01 -07:00
Ryan Leckey
63ef32189d
sqlite: implement support for multiple statements
2020-03-14 17:43:44 -07:00
Ryan Leckey
0130fe1479
sqlite: implement describe
2020-03-14 17:43:44 -07:00
Ryan Leckey
5f27026459
sqlite: implement remainder of query API
2020-03-14 17:43:44 -07:00
Ryan Leckey
a3799c3496
sqlite: implement command execution
2020-03-14 17:43:44 -07:00
Ryan Leckey
751efdf31b
generalize MaybeOwnedConnection and clean up the connection file
2020-03-14 17:43:44 -07:00
Ryan Leckey
444ffff127
Run rustfmt
2020-03-14 17:43:44 -07:00
Ryan Leckey
30897dd6d9
Add additional notes to Executor
2020-03-14 17:43:44 -07:00
Ryan Leckey
0421c9fb42
Add explicit life times to Cursor
2020-03-14 17:43:44 -07:00
Ryan Leckey
1a48cf3b2c
Reduce some duplication in type parsing
2020-03-14 17:43:44 -07:00
Ryan Leckey
7ab07016da
sqlite: initial work in connection
2020-03-14 17:43:44 -07:00
Ryan Leckey
5d042e35b1
sqlite: stub
2020-03-14 17:43:44 -07:00
Ryan Leckey
553f03fa05
Add Database::RawBuffer to parameterize Encode
2020-03-14 17:43:44 -07:00
Ryan Leckey
cca096355f
Run rustfmt
2020-03-14 17:43:44 -07:00
Ryan Leckey
27cd552a8c
mysql: clean up protocol
2020-03-14 17:43:44 -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
d269506899
Merge pull request #111 from launchbadge/develop
...
0.3: Introduce life 🧬 into an otherwise static ⛰️ environment
2020-03-14 17:42:23 -07:00
Ryan Leckey
cc88efe436
mysql: handle EOF packets if the server still requires them (MariaDB 10.1)
2020-03-14 17:29:59 -07:00
Ryan Leckey
12fa401556
log: trace the MySQL capability flags
2020-03-14 17:29:22 -07:00
Austin Bonander
a9f0fca1b2
fix Postgres UI tests for 1.41 stable
2020-03-11 15:43:07 -07:00
Austin Bonander
fdff5ef4c6
update trybuild
2020-03-11 13:24:05 -07:00
Ryan Leckey
0a7415f542
Run rustfmt
2020-03-11 03:34:51 -07:00
Ryan Leckey
76431141e5
postgres: add type test for NULL
2020-03-11 03:34:23 -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
9609a62ed1
Run rustfmt
2020-03-11 02:51:24 -07:00
Ryan Leckey
ffa4420c08
remove dead_code allow (lints fixed now)
2020-03-11 02:49:06 -07:00
Ryan Leckey
b9fe70ffa4
macros: fix trailing commas one more time from rebase
2020-03-11 02:48:30 -07:00
Ryan Leckey
63200a5044
test: postgres: fix query string (form -> from)
2020-03-11 02:48:20 -07:00
Ryan Leckey
c14338d329
remove unused imports
2020-03-11 02:29:20 -07:00
Ryan Leckey
6924b4fe6d
macros: fix trailing commas from rebase
2020-03-11 02:29:12 -07:00
Ryan Leckey
0eed8c5866
mysql: fix handling of multiple query statements for affected_rows
2020-03-11 02:18:45 -07:00
Ryan Leckey
69489caa4b
mysql: initialize sql-mode and other options on establish
2020-03-11 02:18:27 -07:00
Ryan Leckey
17f52a819b
Fix doctests for macros
2020-03-11 02:01:48 -07:00