Struct datafusion_sql::unparser::dialect::CustomDialectBuilder
source · pub struct CustomDialectBuilder { /* private fields */ }
Expand description
CustomDialectBuilder
to build CustomDialect
using builder pattern
§Examples
Building a custom dialect with all default options set in CustomDialectBuilder::new()
but with use_timestamp_for_date64
overridden to true
use datafusion_sql::unparser::dialect::CustomDialectBuilder;
let dialect = CustomDialectBuilder::new()
.with_use_timestamp_for_date64(true)
.build();
Implementations§
source§impl CustomDialectBuilder
impl CustomDialectBuilder
pub fn new() -> Self
pub fn build(self) -> CustomDialect
sourcepub fn with_identifier_quote_style(self, identifier_quote_style: char) -> Self
pub fn with_identifier_quote_style(self, identifier_quote_style: char) -> Self
Customize the dialect with a specific identifier quote style, e.g. ‘`’, ‘“’
sourcepub fn with_supports_nulls_first_in_sort(
self,
supports_nulls_first_in_sort: bool,
) -> Self
pub fn with_supports_nulls_first_in_sort( self, supports_nulls_first_in_sort: bool, ) -> Self
Customize the dialect to supports NULLS FIRST
in ORDER BY
clauses
sourcepub fn with_use_timestamp_for_date64(
self,
use_timestamp_for_date64: bool,
) -> Self
pub fn with_use_timestamp_for_date64( self, use_timestamp_for_date64: bool, ) -> Self
Customize the dialect to uses TIMESTAMP when casting Date64 rather than DATETIME
sourcepub fn with_interval_style(self, interval_style: IntervalStyle) -> Self
pub fn with_interval_style(self, interval_style: IntervalStyle) -> Self
Customize the dialect with a specific interval style listed in IntervalStyle
sourcepub fn with_float64_ast_dtype(self, float64_ast_dtype: DataType) -> Self
pub fn with_float64_ast_dtype(self, float64_ast_dtype: DataType) -> Self
Customize the dialect with a specific SQL type for Float64 casting: DOUBLE, DOUBLE PRECISION, etc.
sourcepub fn with_utf8_cast_dtype(self, utf8_cast_dtype: DataType) -> Self
pub fn with_utf8_cast_dtype(self, utf8_cast_dtype: DataType) -> Self
Customize the dialect with a specific SQL type for Utf8 casting: VARCHAR, CHAR, etc.
sourcepub fn with_large_utf8_cast_dtype(self, large_utf8_cast_dtype: DataType) -> Self
pub fn with_large_utf8_cast_dtype(self, large_utf8_cast_dtype: DataType) -> Self
Customize the dialect with a specific SQL type for LargeUtf8 casting: TEXT, CHAR, etc.
sourcepub fn with_date_field_extract_style(
self,
date_field_extract_style: DateFieldExtractStyle,
) -> Self
pub fn with_date_field_extract_style( self, date_field_extract_style: DateFieldExtractStyle, ) -> Self
Customize the dialect with a specific date field extract style listed in DateFieldExtractStyle
sourcepub fn with_int64_cast_dtype(self, int64_cast_dtype: DataType) -> Self
pub fn with_int64_cast_dtype(self, int64_cast_dtype: DataType) -> Self
Customize the dialect with a specific SQL type for Int64 casting: BigInt, SIGNED, etc.
sourcepub fn with_timestamp_cast_dtype(
self,
timestamp_cast_dtype: DataType,
timestamp_tz_cast_dtype: DataType,
) -> Self
pub fn with_timestamp_cast_dtype( self, timestamp_cast_dtype: DataType, timestamp_tz_cast_dtype: DataType, ) -> Self
Customize the dialect with a specific SQL type for Timestamp casting: Timestamp, Datetime, etc.