Skip to content

Commit

Permalink
WIP: Redo ws support (#7)
Browse files Browse the repository at this point in the history
* release: v0.5.4

* Fix infinite compile loop regression from recursive Lazy reference

* release: v0.5.5

* Improve root README.md and sqlx-cli/README.md (launchbadge#1262)

* readme: Fix inconsistent list style

* readme: Improve text alignment

* readme: Fix missing links

* readme: Consistently use code formatting for runtime & TLS crates and dedup links

* readme: Add SQLx is not an ORM section

* readme: Improve documentation about offline mode

* Rename _expr to expr (launchbadge#1264)

* redo changes from abhijeetbhagat:ws-support

* wip

* remove runtime-wasm-bindgen feature

* remove runtime-wasm-bindgen feature

* removed unneeded dependency

Co-authored-by: Ryan Leckey <ryan@launchbadge.com>
Co-authored-by: toshokan <toshokan@shojigate.net>
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
Co-authored-by: Rohan Sharma <rhnsharma5113@gmail.com>
  • Loading branch information
5 people authored Jul 13, 2021
1 parent a90b23f commit 18d117e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
5 changes: 5 additions & 0 deletions sqlx-bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ sqlx-rt = { version = "0.5", path = "../sqlx-rt", default-features = false }
name = "pg_pool"
harness = false
required-features = ["postgres"]

[[bench]]
name = "wasm_querying"
harness = false
required-features = ["postgres"]
26 changes: 26 additions & 0 deletions sqlx-bench/benches/wasm_querying.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use sqlx::Row;
use sqlx::{postgres::PgRow, Connection};
use sqlx::{Database, PgConnection, Postgres};
use sqlx_rt::spawn;

const URL: &str = "postgresql://paul:pass123@127.0.0.1:8080/jetasap_dev";

fn select() {
spawn(async {
let mut conn = <Postgres as Database>::Connection::connect(URL)
.await
.unwrap();

let airports = sqlx::query("select * from airports")
.fetch_all(&mut conn)
.await;
});
}

fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("fib 20", |b| b.iter(|| select()));
}

criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);
3 changes: 1 addition & 2 deletions sqlx-rt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
feature = "runtime-actix-rustls",
feature = "runtime-async-std-rustls",
feature = "runtime-tokio-rustls",
)
))]
)))]
compile_error!(
"one of the features ['runtime-actix-native-tls', 'runtime-async-std-native-tls', \
'runtime-tokio-native-tls', 'runtime-actix-rustls', 'runtime-async-std-rustls', \
Expand Down
1 change: 0 additions & 1 deletion sqlx-wasm-test/src/pg_types_tests_ipnetwork.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ test_type!(ipnetwork_vec<Vec<sqlx::types::ipnetwork::IpNetwork>>(Postgres,
"8.8.8.8/24".parse::<sqlx::types::ipnetwork::IpNetwork>().unwrap()
]
));

0 comments on commit 18d117e

Please sign in to comment.