Now i try to use sqlx with sqlite. when i try to build and i get some errors with sql-macro.
Looks like sqlx-macro try to build with sqlite-sys which is built with ohos. For proc-macro lib that always be built with host system. And then i get this error.
use napi_derive_ohos::napi;
use sqlx::SqlitePool;
#[napi]
pub async fn test_sqlite() {
let pool = SqlitePool::connect(":memory:").await.unwrap();
let mut conn = pool.acquire().await.unwrap();
// Insert the task, then obtain the ID of this row
let id = sqlx::query(
r#"
INSERT INTO todos ( description )
VALUES ( ?1 )
"#,
)
.execute(&mut *conn)
.await
.unwrap()
.last_insert_rowid();
}
Bug Description
Now i try to use sqlx with sqlite. when i try to build and i get some errors with
sql-macro
.Looks like
sqlx-macro
try to build withsqlite-sys
which is built with ohos. Forproc-macro
lib that always be built with host system. And then i get this error.Any suggestions?
Minimal Reproduction
Use this guide to build it. https://doc.rust-lang.org/rustc/platform-support/openharmony.html
Before build it, should run this shell.
Info
rustc --version
: rustc 1.78.0 (9b00956e5 2024-04-29)