pub struct MapDataType {
pub key_type: Box<DataType>,
pub value_type: Box<DataType>,
}Expand description
Map/Dictionary type with key-value pairs.
Supported by: ClickHouse, Snowflake (OBJECT), Databricks (MAP).
PostgreSQL uses JSONB, SQL Server uses JSON string.
§Example
use razeri_plugin_contract::DataType;
use razeri_plugin_contract::data_type::MapDataType;
let map = MapDataType::new(DataType::varchar(50), DataType::int());
assert_eq!(*map.key_type, DataType::varchar(50));
assert_eq!(*map.value_type, DataType::int());Fields§
§key_type: Box<DataType>The data type of map keys.
value_type: Box<DataType>The data type of map values.
Implementations§
Source§impl MapDataType
impl MapDataType
Sourcepub fn new(key_type: DataType, value_type: DataType) -> Self
pub fn new(key_type: DataType, value_type: DataType) -> Self
Creates a new map type with the given key and value types.
§Example
use razeri_plugin_contract::DataType;
use razeri_plugin_contract::data_type::MapDataType;
let map = MapDataType::new(DataType::varchar(50), DataType::int());
assert_eq!(*map.key_type, DataType::varchar(50));
assert_eq!(*map.value_type, DataType::int());Trait Implementations§
Source§impl Clone for MapDataType
impl Clone for MapDataType
Source§fn clone(&self) -> MapDataType
fn clone(&self) -> MapDataType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MapDataType
impl Debug for MapDataType
impl Eq for MapDataType
Source§impl PartialEq for MapDataType
impl PartialEq for MapDataType
impl StructuralPartialEq for MapDataType
Auto Trait Implementations§
impl Freeze for MapDataType
impl RefUnwindSafe for MapDataType
impl Send for MapDataType
impl Sync for MapDataType
impl Unpin for MapDataType
impl UnsafeUnpin for MapDataType
impl UnwindSafe for MapDataType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more