use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Capabilities {
pub transactions: bool,
pub cancellation: bool,
pub multiple_schemas: bool,
pub prepared_statements: bool,
pub savepoints: bool,
pub rows_affected: bool,
pub streaming: bool,
pub row_level_dml: bool,
}
impl Capabilities {
#[must_use]
pub const fn with_transactions(mut self, value: bool) -> Self {
self.transactions = value;
self
}
#[must_use]
pub const fn with_cancellation(mut self, value: bool) -> Self {
self.cancellation = value;
self
}
#[must_use]
pub const fn with_multiple_schemas(mut self, value: bool) -> Self {
self.multiple_schemas = value;
self
}
#[must_use]
pub const fn with_prepared_statements(mut self, value: bool) -> Self {
self.prepared_statements = value;
self
}
#[must_use]
pub const fn with_savepoints(mut self, value: bool) -> Self {
self.savepoints = value;
self
}
#[must_use]
pub const fn with_rows_affected(mut self, value: bool) -> Self {
self.rows_affected = value;
self
}
#[must_use]
pub const fn with_streaming(mut self, value: bool) -> Self {
self.streaming = value;
self
}
#[must_use]
pub const fn with_row_level_dml(mut self, value: bool) -> Self {
self.row_level_dml = value;
self
}
}