'unable to open database file' when running the sqlite/todos example

ousado created this issue on 2021-05-28 · The issue is replied 0 times

When following the exact steps given in the sqlite todos example, I get several of these errors when trying to execute cargo run -- add "todo description":

error: error returned from database: unable to open database file
  --> examples/sqlite/todos/src/main.rs:80:16
   |
80 |       let recs = sqlx::query!(

At the time of the execution of the macro query::expand_from_db, a std::env::current_dir(), that I inserted for debugging, returns the root directory of the sqlx repository, and not the sqlx/examples/sqlite/todos directory, which is where I'm running the example from. The macro attempts to open the sqlite database relative to the repository root, and fails.

This is using the 0.5.5 release

🤔
Didn't find what you were looking for ?
Create your own issue
More Details About Repo
Owner Name launchbadge
Repo Name sqlx
Full Name launchbadge/sqlx
Language Rust
Created Date 2019-12-28
Updated Date 2022-01-11
Star Count 5157
Watcher Count 56
Fork Count 513
Issue Count 321

YOU MAY BE INTERESTED

Issue Title State Comments Created Date Updated Date Closed Date