pub struct TimestampDataType {
pub precision: u8,
}Expand description
Timestamp (date and time) without timezone.
Maps to: TIMESTAMP (PostgreSQL), DATETIME2 (SQL Server),
TIMESTAMP_NTZ (Snowflake), TIMESTAMP (Databricks), DateTime (ClickHouse).
§Precision
PostgreSQL: 0-6- SQL Server: 0-7
- Snowflake: 0-9
ClickHouse: 0-9
§Example
use razeri_plugin_contract::data_type::{DataType, TimestampDataType};
// Default: precision 6
let ts = TimestampDataType::default();
assert_eq!(ts.precision, 6);
// Custom precision
let ts3 = TimestampDataType::new(3);
assert_eq!(ts3.precision, 3);
// Via DataType convenience
let created = DataType::timestamp();Fields§
§precision: u8Fractional seconds precision (0-9).
PostgreSQL: 0-6- SQL Server: 0-7
- Snowflake: 0-9
ClickHouse: 0-9
Implementations§
Source§impl TimestampDataType
impl TimestampDataType
Sourcepub fn new(precision: u8) -> Self
pub fn new(precision: u8) -> Self
Creates a new TimestampDataType with the given fractional seconds precision.
§Panics
Panics if precision exceeds 9.
§Example
use razeri_plugin_contract::data_type::TimestampDataType;
let ts = TimestampDataType::new(3);
assert_eq!(ts.precision, 3);ⓘ
use razeri_plugin_contract::data_type::TimestampDataType;
let _ = TimestampDataType::new(10); // panics: precision must be 0-9Trait Implementations§
Source§impl Clone for TimestampDataType
impl Clone for TimestampDataType
Source§impl Debug for TimestampDataType
impl Debug for TimestampDataType
Source§impl Default for TimestampDataType
impl Default for TimestampDataType
impl Eq for TimestampDataType
Source§impl Hash for TimestampDataType
impl Hash for TimestampDataType
Source§impl PartialEq for TimestampDataType
impl PartialEq for TimestampDataType
impl StructuralPartialEq for TimestampDataType
Auto Trait Implementations§
impl Freeze for TimestampDataType
impl RefUnwindSafe for TimestampDataType
impl Send for TimestampDataType
impl Sync for TimestampDataType
impl Unpin for TimestampDataType
impl UnsafeUnpin for TimestampDataType
impl UnwindSafe for TimestampDataType
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