mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 16:29:20 +08:00
Merge pull request #538 from gwenn/open-file-example
rustdoc: example for Connection::open file
This commit is contained in:
commit
454899f612
10
src/lib.rs
10
src/lib.rs
@ -338,6 +338,16 @@ impl Connection {
|
||||
/// OpenFlags::SQLITE_OPEN_READ_WRITE |
|
||||
/// OpenFlags::SQLITE_OPEN_CREATE)`.
|
||||
///
|
||||
/// ```rust,no_run
|
||||
/// # use rusqlite::{Connection, Result};
|
||||
/// fn open_my_db() -> Result<()> {
|
||||
/// let path = "./my_db.db3";
|
||||
/// let db = Connection::open(&path)?;
|
||||
/// println!("{}", db.is_autocommit());
|
||||
/// Ok(())
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// # Failure
|
||||
///
|
||||
/// Will return `Err` if `path` cannot be converted to a C-compatible
|
||||
|
Loading…
Reference in New Issue
Block a user