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
use crate::Column;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
#[derive(Debug, Deserialize, Serialize)]
pub struct ResultSet {
id: Uuid,
ctx: String,
sql: Option<String>,
columns: Vec<Column>,
data: Vec<Vec<Option<String>>>,
duration_ms: i32
}
impl ResultSet {
pub fn new(
id: Uuid, ctx: String, sql: Option<String>, columns: Vec<Column>, data: Vec<Vec<Option<String>>>, duration_ms: i32
) -> ResultSet {
ResultSet {
id,
ctx,
sql,
columns,
data,
duration_ms
}
}
pub fn id(&self) -> &Uuid {
&self.id
}
pub fn ctx(&self) -> &String {
&self.ctx
}
pub fn sql(&self) -> &Option<String> {
&self.sql
}
pub fn columns(&self) -> &Vec<Column> {
&self.columns
}
pub fn data(&self) -> &Vec<Vec<Option<String>>> {
&self.data
}
}