Skip to content

Commit 3e28a5f

Browse files
committed
Impl a few features & refactor some code based on design discussion.
Added async-trait as an optional dep. For now, included only when postgres is enabled. 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.
1 parent 652f412 commit 3e28a5f

File tree

4 files changed

+224
-119
lines changed

4 files changed

+224
-119
lines changed

Cargo.lock

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sqlx-core/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ authors = [
1515
[features]
1616
default = [ "runtime-async-std" ]
1717
unstable = []
18-
postgres = [ "md-5", "sha2", "base64", "sha-1", "rand", "hmac" ]
18+
postgres = [ "md-5", "sha2", "base64", "sha-1", "rand", "hmac", "async-trait" ]
1919
mysql = [ "sha-1", "sha2", "generic-array", "num-bigint", "base64", "digest", "rand" ]
2020
tls = [ "async-native-tls" ]
2121
runtime-async-std = [ "async-native-tls/runtime-async-std", "async-std" ]
@@ -24,6 +24,7 @@ runtime-tokio = [ "async-native-tls/runtime-tokio", "tokio" ]
2424
[dependencies]
2525
async-native-tls = { version = "0.3.2", default-features = false, optional = true }
2626
async-std = { version = "1.4.0", optional = true }
27+
async-trait = { version = "0.1.22", optional = true }
2728
tokio = { version = "0.2.9", default-features = false, features = [ "dns", "fs", "time", "tcp" ], optional = true }
2829
async-stream = { version = "0.2.0", default-features = false }
2930
base64 = { version = "0.11.0", default-features = false, optional = true, features = [ "std" ] }

0 commit comments

Comments
 (0)