rustdoc: example for Connection::open file

This commit is contained in:
gwenn 2019-06-24 20:05:36 +02:00
parent b632c0f8be
commit 147168184f

View File

@ -338,6 +338,16 @@ impl Connection {
/// OpenFlags::SQLITE_OPEN_READ_WRITE | /// OpenFlags::SQLITE_OPEN_READ_WRITE |
/// OpenFlags::SQLITE_OPEN_CREATE)`. /// 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 /// # Failure
/// ///
/// Will return `Err` if `path` cannot be converted to a C-compatible /// Will return `Err` if `path` cannot be converted to a C-compatible