arrow_tiberius/schema/mapping.rs
1//! Arrow/MSSQL column mapping.
2
3use crate::{ArrowFieldRef, MssqlColumn};
4
5/// Planned mapping between one Arrow field and one MSSQL column.
6#[derive(Debug, Clone, PartialEq, Eq)]
7pub struct SchemaMapping {
8 arrow: ArrowFieldRef,
9 mssql: MssqlColumn,
10}
11
12impl SchemaMapping {
13 /// Creates a schema mapping.
14 pub const fn new(arrow: ArrowFieldRef, mssql: MssqlColumn) -> Self {
15 Self { arrow, mssql }
16 }
17
18 /// Returns the Arrow side of the mapping.
19 pub const fn arrow(&self) -> &ArrowFieldRef {
20 &self.arrow
21 }
22
23 /// Returns the MSSQL side of the mapping.
24 pub const fn mssql(&self) -> &MssqlColumn {
25 &self.mssql
26 }
27}