Skip to content

Commit 18d117e

Browse files
vbeffamehcodetoshokanjplatteRhnSharma
authored
WIP: Redo ws support (#7)
* 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 <[email protected]> Co-authored-by: toshokan <[email protected]> Co-authored-by: Jonas Platte <[email protected]> Co-authored-by: Rohan Sharma <[email protected]>
1 parent a90b23f commit 18d117e

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

sqlx-bench/Cargo.toml

+5
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,8 @@ sqlx-rt = { version = "0.5", path = "../sqlx-rt", default-features = false }
4545
name = "pg_pool"
4646
harness = false
4747
required-features = ["postgres"]
48+
49+
[[bench]]
50+
name = "wasm_querying"
51+
harness = false
52+
required-features = ["postgres"]

sqlx-bench/benches/wasm_querying.rs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use criterion::{black_box, criterion_group, criterion_main, Criterion};
2+
use sqlx::Row;
3+
use sqlx::{postgres::PgRow, Connection};
4+
use sqlx::{Database, PgConnection, Postgres};
5+
use sqlx_rt::spawn;
6+
7+
const URL: &str = "postgresql://paul:[email protected]:8080/jetasap_dev";
8+
9+
fn select() {
10+
spawn(async {
11+
let mut conn = <Postgres as Database>::Connection::connect(URL)
12+
.await
13+
.unwrap();
14+
15+
let airports = sqlx::query("select * from airports")
16+
.fetch_all(&mut conn)
17+
.await;
18+
});
19+
}
20+
21+
fn criterion_benchmark(c: &mut Criterion) {
22+
c.bench_function("fib 20", |b| b.iter(|| select()));
23+
}
24+
25+
criterion_group!(benches, criterion_benchmark);
26+
criterion_main!(benches);

sqlx-rt/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
feature = "runtime-actix-rustls",
66
feature = "runtime-async-std-rustls",
77
feature = "runtime-tokio-rustls",
8-
)
9-
))]
8+
)))]
109
compile_error!(
1110
"one of the features ['runtime-actix-native-tls', 'runtime-async-std-native-tls', \
1211
'runtime-tokio-native-tls', 'runtime-actix-rustls', 'runtime-async-std-rustls', \

sqlx-wasm-test/src/pg_types_tests_ipnetwork.rs

-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,3 @@ test_type!(ipnetwork_vec<Vec<sqlx::types::ipnetwork::IpNetwork>>(Postgres,
5050
"8.8.8.8/24".parse::<sqlx::types::ipnetwork::IpNetwork>().unwrap()
5151
]
5252
));
53-

0 commit comments

Comments
 (0)