Skip to content

Commit a54a568

Browse files
cursoragentlovasoa
andcommitted
feat: Add FromStr constraint for connection options
Co-authored-by: contact <[email protected]>
1 parent 14309cb commit a54a568

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sqlx-test/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pub fn setup_if_needed() {
1212
pub async fn new<DB>() -> anyhow::Result<DB::Connection>
1313
where
1414
DB: Database,
15+
<DB::Connection as Connection>::Options: std::str::FromStr<Err = sqlx::error::Error>,
1516
{
1617
setup_if_needed();
1718

@@ -23,6 +24,7 @@ where
2324
pub async fn pool<DB>() -> anyhow::Result<Pool<DB>>
2425
where
2526
DB: Database,
27+
<DB::Connection as Connection>::Options: std::str::FromStr<Err = sqlx::error::Error>,
2628
{
2729
setup_if_needed();
2830

0 commit comments

Comments
 (0)