mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-24 18:01:37 +08:00
Add a function to return the path of a Connection (#963)
This commit is contained in:
parent
5511a12e57
commit
a2d48a8c15
10
src/lib.rs
10
src/lib.rs
@ -537,6 +537,16 @@ impl Connection {
|
|||||||
.and_then(|mut stmt| stmt.check_no_tail().and_then(|_| stmt.execute(params)))
|
.and_then(|mut stmt| stmt.check_no_tail().and_then(|_| stmt.execute(params)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the path to the database file, if one exists and is known.
|
||||||
|
///
|
||||||
|
/// Note that in some cases [PRAGMA
|
||||||
|
/// database_list](https://sqlite.org/pragma.html#pragma_database_list) is
|
||||||
|
/// likely to be more robust.
|
||||||
|
#[inline]
|
||||||
|
pub fn path(&self) -> Option<&Path> {
|
||||||
|
self.path.as_deref()
|
||||||
|
}
|
||||||
|
|
||||||
/// Convenience method to prepare and execute a single SQL statement with
|
/// Convenience method to prepare and execute a single SQL statement with
|
||||||
/// named parameter(s).
|
/// named parameter(s).
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user