diff --git a/libsql-sys/src/connection.rs b/libsql-sys/src/connection.rs index a9959837e4..da8c917d16 100644 --- a/libsql-sys/src/connection.rs +++ b/libsql-sys/src/connection.rs @@ -271,11 +271,23 @@ impl Connection { conn }; + #[cfg(not(target_os = "windows"))] + use std::os::unix::ffi::OsStrExt; + + #[cfg(target_os = "windows")] + use std::os::windows::ffi::OsStrExt; + #[cfg(not(feature = "rusqlite"))] let conn = unsafe { - use std::os::unix::ffi::OsStrExt; + + #[cfg(target_os = "windows")] + let path = std::ffi::CString::new(path.as_ref().as_os_str().as_encoded_bytes()) + .map_err(|_| crate::error::Error::Bug("invalid database path"))?; + + #[cfg(not(target_os = "windows"))] let path = std::ffi::CString::new(path.as_ref().as_os_str().as_bytes()) .map_err(|_| crate::error::Error::Bug("invalid database path"))?; + let mut conn: *mut crate::ffi::sqlite3 = std::ptr::null_mut(); // We pass a pointer to the WAL methods data to the database connection. This means // that the reference must outlive the connection. This is guaranteed by the marker in diff --git a/vendored/sqlite3-parser/lemon.obj b/vendored/sqlite3-parser/lemon.obj new file mode 100644 index 0000000000..cc3f118b04 Binary files /dev/null and b/vendored/sqlite3-parser/lemon.obj differ