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
use ;
use crateColumnBaseInfo;
/// Result of executing a single SQL statement.
///
/// Each SQL statement in a batch produces one `SqlResult` entry.
/// Statements that return rows (SELECT, SHOW, EXPLAIN, etc.) produce a [`SqlResult::Query`];
/// statements that do not return rows (INSERT, UPDATE, DELETE, CREATE, DROP, etc.)
/// produce a [`SqlResult::Execute`].
///
/// # Serialization
///
/// `SqlResult` is tagged with a `"type"` discriminant when serialized to JSON:
///
/// ```json
/// // Query result
/// { "type": "query", "data": [...], "columns": [...] }
///
/// // Execution result
/// { "type": "execute", "rows_affected": 3 }
/// ```