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

source

pub fn new() -> Self

source

pub fn build(self) -> CustomDialect

source

pub fn with_identifier_quote_style(self, identifier_quote_style: char) -> Self

Customize the dialect with a specific identifier quote style, e.g. ‘`’, ‘“’

source

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

source

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

source

pub fn with_interval_style(self, interval_style: IntervalStyle) -> Self

Customize the dialect with a specific interval style listed in IntervalStyle

source

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.

source

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.

source

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.

source

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

source

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.

source

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.

Trait Implementations§

source§

impl Default for CustomDialectBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,