From b6240ec43b3ada7d71bb40612aee18d53079a6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCller?= Date: Sun, 30 Apr 2023 14:27:14 +0200 Subject: [PATCH] using i32 for the post_id using i32 for the post_id was required on Windows with postgres 15.0.1 else the following error occurred: Rust type `i64` (as SQL type `INT8`) is not compatible with SQL type `INT4` --- src/bin/markd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/markd.rs b/src/bin/markd.rs index 2c09f2f..e7e86b7 100644 --- a/src/bin/markd.rs +++ b/src/bin/markd.rs @@ -26,7 +26,7 @@ async fn main() -> Result<(), sqlx::Error>{ .await .expect("couldn't create pool"); - let row: (i64,) = sqlx::query_as("insert into myposts (post_title, post_body) values ($1, $2) returning post_id") + let row: (i32,) = sqlx::query_as("insert into myposts (post_title, post_body) values ($1, $2) returning post_id") .bind(&args[1]) .bind(inserter) .fetch_one(&pool)