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() -> CustomDialectBuilder
pub fn build(self) -> CustomDialect
sourcepub fn with_identifier_quote_style(
self,
identifier_quote_style: char,
) -> CustomDialectBuilder
pub fn with_identifier_quote_style( self, identifier_quote_style: char, ) -> CustomDialectBuilder
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,
) -> CustomDialectBuilder
pub fn with_supports_nulls_first_in_sort( self, supports_nulls_first_in_sort: bool, ) -> CustomDialectBuilder
Customize the dialect to supports NULLS FIRST in ORDER BY clauses
sourcepub fn with_use_timestamp_for_date64(
self,
use_timestamp_for_date64: bool,
) -> CustomDialectBuilder
pub fn with_use_timestamp_for_date64( self, use_timestamp_for_date64: bool, ) -> CustomDialectBuilder
Customize the dialect to uses TIMESTAMP when casting Date64 rather than DATETIME
sourcepub fn with_interval_style(
self,
interval_style: IntervalStyle,
) -> CustomDialectBuilder
pub fn with_interval_style( self, interval_style: IntervalStyle, ) -> CustomDialectBuilder
Customize the dialect with a specific interval style listed in IntervalStyle
sourcepub fn with_float64_ast_dtype(
self,
float64_ast_dtype: DataType,
) -> CustomDialectBuilder
pub fn with_float64_ast_dtype( self, float64_ast_dtype: DataType, ) -> CustomDialectBuilder
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,
) -> CustomDialectBuilder
pub fn with_utf8_cast_dtype( self, utf8_cast_dtype: DataType, ) -> CustomDialectBuilder
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,
) -> CustomDialectBuilder
pub fn with_large_utf8_cast_dtype( self, large_utf8_cast_dtype: DataType, ) -> CustomDialectBuilder
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,
) -> CustomDialectBuilder
pub fn with_date_field_extract_style( self, date_field_extract_style: DateFieldExtractStyle, ) -> CustomDialectBuilder
Customize the dialect with a specific date field extract style listed in DateFieldExtractStyle
sourcepub fn with_int64_cast_dtype(
self,
int64_cast_dtype: DataType,
) -> CustomDialectBuilder
pub fn with_int64_cast_dtype( self, int64_cast_dtype: DataType, ) -> CustomDialectBuilder
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,
) -> CustomDialectBuilder
pub fn with_timestamp_cast_dtype( self, timestamp_cast_dtype: DataType, timestamp_tz_cast_dtype: DataType, ) -> CustomDialectBuilder
Customize the dialect with a specific SQL type for Timestamp casting: Timestamp, Datetime, etc.
Trait Implementations§
source§impl Default for CustomDialectBuilder
impl Default for CustomDialectBuilder
source§fn default() -> CustomDialectBuilder
fn default() -> CustomDialectBuilder
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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