pub struct SnowflakeColumnType { /* private fields */ }
Expand description
Represents the type information of a Snowflake column.
This struct contains metadata about a column including its Snowflake data type, whether it allows NULL values, and optional size/precision/scale parameters.
§Examples
use snowflake_connector_rs::SnowflakeColumnType;
// Create a text column type (VARCHAR/STRING in Snowflake)
let text_type = SnowflakeColumnType::new(
"text".to_string(),
true,
Some(255),
None,
None
);
// Create a fixed column type (DECIMAL/NUMBER in Snowflake)
let fixed_type = SnowflakeColumnType::new(
"fixed".to_string(),
false,
None,
Some(10),
Some(2)
);
Implementations§
Source§impl SnowflakeColumnType
impl SnowflakeColumnType
Sourcepub fn new(
snowflake_type: String,
nullable: bool,
length: Option<i64>,
precision: Option<i64>,
scale: Option<i64>,
) -> Self
pub fn new( snowflake_type: String, nullable: bool, length: Option<i64>, precision: Option<i64>, scale: Option<i64>, ) -> Self
Creates a new SnowflakeColumnType
.
§Arguments
snowflake_type
- The Snowflake data type name (e.g., “text”, “fixed”, “boolean”)nullable
- Whether the column allows NULL valueslength
- Optional length for character types (e.g., text with length 255)precision
- Optional precision for numeric types (e.g., fixed(10,2))scale
- Optional scale for numeric types (e.g., fixed(10,2))
§Examples
use snowflake_connector_rs::SnowflakeColumnType;
let text_type = SnowflakeColumnType::new(
"text".to_string(),
true,
Some(100),
None,
None
);
assert_eq!(text_type.snowflake_type(), "text");
assert_eq!(text_type.nullable(), true);
assert_eq!(text_type.length(), Some(100));
pub fn snowflake_type(&self) -> &str
pub fn nullable(&self) -> bool
pub fn length(&self) -> Option<i64>
pub fn precision(&self) -> Option<i64>
pub fn scale(&self) -> Option<i64>
Trait Implementations§
Source§impl Clone for SnowflakeColumnType
impl Clone for SnowflakeColumnType
Source§fn clone(&self) -> SnowflakeColumnType
fn clone(&self) -> SnowflakeColumnType
Returns a duplicate of the value. Read more
1.0.0 · 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 SnowflakeColumnType
impl Debug for SnowflakeColumnType
Source§impl PartialEq for SnowflakeColumnType
impl PartialEq for SnowflakeColumnType
impl Eq for SnowflakeColumnType
impl StructuralPartialEq for SnowflakeColumnType
Auto Trait Implementations§
impl Freeze for SnowflakeColumnType
impl RefUnwindSafe for SnowflakeColumnType
impl Send for SnowflakeColumnType
impl Sync for SnowflakeColumnType
impl Unpin for SnowflakeColumnType
impl UnwindSafe for SnowflakeColumnType
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