Skip to content

Commit f4f6d87

Browse files
committed
test(any): adjust date handling for SQLite compatibility in chrono tests
1 parent 92a40fb commit f4f6d87

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/any/any.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ async fn it_has_chrono() -> anyhow::Result<()> {
4343
use sqlx_oldapi::types::chrono::NaiveDate;
4444
assert_eq!(
4545
NaiveDate::from_ymd_opt(2020, 1, 2).unwrap(),
46-
get_val::<NaiveDate>("CAST('2020-01-02' AS DATE)").await?
46+
get_val::<NaiveDate>(if cfg!(feature = "sqlite") {
47+
"'2020-01-02'" // SQLite does not have a DATE type
48+
} else {
49+
"CAST('2020-01-02' AS DATE)"
50+
})
51+
.await?
4752
);
4853
Ok(())
4954
}

0 commit comments

Comments
 (0)