forked from launchbadge/sqlx
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
a90b23f
commit 18d117e
Showing
4 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters