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
//! Database drivers: the bridge between the backend-neutral query layer and a
//! concrete database engine.
//!
//! A driver owns its connections, runs SQL with bound parameters off the async
//! runtime, and reads results back into [`Row`](crate::Row)s. This phase ships a
//! single SQLite driver; future backends add a sibling module behind their feature.
//!
//! # Adding a backend
//!
//! Dispatch lives in [`Database`](crate::Database) over a private `Backend` enum
//! (a static enum, not dynamic dispatch). A new driver provides this surface and
//! gets a new enum arm:
//!
//! - `fetch_all(sql, params) -> Vec<Row>`
//! - `execute(sql, params) -> ExecuteResult`
//! - `execute_batch(sql) -> ()`
//! - `statement_count() -> u64`
//! - `close()`
//! - `acquire_pinned() -> <pinned connection>` exposing `fetch_all` / `execute` /
//! `execute_batch` / `rollback_now` for transactions and migrations.
//!
//! A formal `Driver` trait is intentionally deferred until a second driver exists,
//! so its shape is informed by a real second backend rather than guessed.
/// The outcome of a statement that does not return rows.
///
/// Returned by execute-style calls (`INSERT` / `UPDATE` / `DELETE` and DDL).