1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
use Path;
use ;
pub use insert;
pub use select;
/// Open a database connection.
///
/// This function opens a connection to a SQLite database located at the specified path.
///
/// # Arguments
///
/// * `db_path` - A reference to the path where the SQLite database is located.
///
/// # Returns
///
/// Returns a `Result` containing a `Connection` if the operation was successful, or an `Error` if an error occurred.
///
/// # Errors
///
/// This function can return an error if:
///
/// * The specified database path does not exist.
/// * There are permission issues when trying to access the database.
/// * The database is corrupted or not a valid SQLite database.
/// Open an in-memory database connection.
///
/// This function opens a connection to an in-memory SQLite database.
///
/// # Returns
///
/// Returns a `Result` containing a `Connection` if the operation was successful, or an `Error` if an error occurred.
///
/// # Errors
///
/// This function can return an error if:
///
/// * There was an issue creating the in-memory database connection.