Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to open database file via dsn path #341

Closed
thoongnv opened this issue Jul 25, 2024 · 3 comments
Closed

unable to open database file via dsn path #341

thoongnv opened this issue Jul 25, 2024 · 3 comments
Labels
A-sqlite Area: SQLite / deadpool-sqlite invalid The issue is invalid and has been raised in error.

Comments

@thoongnv
Copy link

I want to open the SQLite database file in read-only mode (to allow read access, e.g. SELECT) so I tried these DSN URLs:

let path = "sqlite:///data/mydb.sqlite?mode=ro";
// let path = "sqlite:/data/mydb.sqlite?mode=ro";
// let path = "sqlite:/data/mydb.sqlite";

let pool = deadpool_sqlite::Config::new(path).create_pool(deadpool_sqlite::Runtime::Tokio1).unwrap();

But none of this works, is there any wrong in config, or deadpool-sqlite/ rusqlite not support this?

@bikeshedder
Copy link
Owner

I think this is related to #214.
There is PR #292 which is a bit stale.

It should be fairly simple to complete this. I just haven't come around implementing it, yet.

PRs are always welcome! 👍

@bikeshedder bikeshedder added enhancement New feature or request A-sqlite Area: SQLite / deadpool-sqlite labels Jul 25, 2024
@thoongnv
Copy link
Author

thoongnv commented Jul 25, 2024

oops, looks like it works now with file: prefix. I have used the wrong prefix: https://www.sqlite.org/c3ref/open.html

let path = "file:/data/mydb.sqlite?mode=ro";

@bikeshedder
Copy link
Owner

Thanks for the feedback! 👍

@bikeshedder bikeshedder added invalid The issue is invalid and has been raised in error. and removed enhancement New feature or request labels Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sqlite Area: SQLite / deadpool-sqlite invalid The issue is invalid and has been raised in error.
Projects
None yet
Development

No branches or pull requests

2 participants