Skip to content

Commit 4fd03ec

Browse files
committed
use feature flags for query format
1 parent 63e4340 commit 4fd03ec

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/any/any.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,14 @@ async fn it_encodes_decodes_json() -> anyhow::Result<()> {
168168
.execute(&mut conn)
169169
.await?;
170170

171+
#[cfg(feature = "postgres")]
172+
let query = "insert into json_test (data) values ($1)";
173+
174+
#[cfg(not(feature = "postgres"))]
175+
let query = "insert into json_test (data) values (?)";
176+
171177
// Insert into the temporary table:
172-
sqlx::query("insert into json_test (data) values ($1)")
178+
sqlx::query(query)
173179
.bind(Json(&json_value))
174180
.execute(&mut conn)
175181
.await?;

0 commit comments

Comments
 (0)