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 support 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_int32_cast_dtype(self, int32_cast_dtype: DataType) -> Self
pub fn with_int32_cast_dtype(self, int32_cast_dtype: DataType) -> Self
Customize the dialect with a specific SQL type for Int32 casting: Integer, 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.
pub fn with_date32_cast_dtype(self, date32_cast_dtype: DataType) -> Self
Sourcepub fn with_supports_column_alias_in_table_alias(
self,
supports_column_alias_in_table_alias: bool,
) -> Self
pub fn with_supports_column_alias_in_table_alias( self, supports_column_alias_in_table_alias: bool, ) -> Self
Customize the dialect to support column aliases as part of alias table definition
pub fn with_requires_derived_table_alias( self, requires_derived_table_alias: bool, ) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CustomDialectBuilder
impl RefUnwindSafe for CustomDialectBuilder
impl Send for CustomDialectBuilder
impl Sync for CustomDialectBuilder
impl Unpin for CustomDialectBuilder
impl UnwindSafe for CustomDialectBuilder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more