sqlx_exasol_impl/responses/
session_info.rs

1use semver::Version;
2use serde::Deserialize;
3
4use crate::options::ProtocolVersion;
5
6/// Struct representing database information returned after establishing a connection.
7#[derive(Debug, Deserialize)]
8#[serde(rename_all = "camelCase")]
9pub struct SessionInfo {
10    protocol_version: ProtocolVersion,
11    session_id: u64,
12    release_version: Version,
13    database_name: String,
14    product_name: String,
15    max_data_message_size: u64,
16    max_identifier_length: u64,
17    max_varchar_length: u64,
18    identifier_quote_string: String,
19    time_zone: String,
20    time_zone_behavior: String,
21}
22
23impl SessionInfo {
24    #[must_use]
25    pub fn protocol_version(&self) -> ProtocolVersion {
26        self.protocol_version
27    }
28
29    #[must_use]
30    pub fn session_id(&self) -> u64 {
31        self.session_id
32    }
33
34    #[must_use]
35    pub fn release_version(&self) -> &Version {
36        &self.release_version
37    }
38
39    #[must_use]
40    pub fn database_name(&self) -> &str {
41        &self.database_name
42    }
43
44    #[must_use]
45    pub fn product_name(&self) -> &str {
46        &self.product_name
47    }
48
49    #[must_use]
50    pub fn max_data_message_size(&self) -> u64 {
51        self.max_data_message_size
52    }
53
54    #[must_use]
55    pub fn max_identifier_length(&self) -> u64 {
56        self.max_identifier_length
57    }
58
59    #[must_use]
60    pub fn max_varchar_length(&self) -> u64 {
61        self.max_varchar_length
62    }
63
64    #[must_use]
65    pub fn identifier_quote_string(&self) -> &str {
66        &self.identifier_quote_string
67    }
68
69    #[must_use]
70    pub fn timezone(&self) -> &str {
71        &self.time_zone
72    }
73
74    #[must_use]
75    pub fn time_zone_behavior(&self) -> &str {
76        &self.time_zone_behavior
77    }
78}