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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// connection.rs
//
// This file is a part of the eXtremeDB source code
// Copyright (c) 2020 McObject LLC
// All Rights Reserved
//! Database connection management.
//!
//! A connection must be established to perform operations on the database,
//! including creating an SQL engine.
//!
//! # Example
//!
//! Connecting to an existing database instance:
//!
//! ```
//! # use extremedb::{connection, database, device, runtime, Result};
//! # use extremedb::device::util;
//! #
//! # fn main() -> Result<()> {
//! # let runtime = runtime::Runtime::start(vec![]);
//! #
//! # let mut devs = util::DeviceContainer::new();
//! #
//! let db = database::Database::open(
//! # &runtime,
//! # "test_db",
//! # None,
//! # devs.devices(),
//! # database::Params::new(),
//! // ...
//! )?;
//!
//! let conn = connection::Connection::new(&db)?;
//!
//! // ...
//! #
//! # drop(conn);
//! # drop(db);
//! # drop(runtime);
//! #
//! # Ok(())
//! # }
//! ```
use PhantomData;
use MaybeUninit;
use crateDatabase;
use crate::;
/// A database connection.
///
/// Connections are neither `Sync` nor `Send`; they must be used only by
/// the threads that create them.
///
/// A connection is closed when it is dropped.