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() -> CustomDialectBuilder

source

pub fn build(self) -> CustomDialect

source

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

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, ) -> CustomDialectBuilder

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, ) -> CustomDialectBuilder

Customize the dialect to uses TIMESTAMP when casting Date64 rather than DATETIME

source

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

Customize the dialect with a specific interval style listed in IntervalStyle

source

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.

source

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.

source

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.

source

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

source

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.

source

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

source§

fn default() -> CustomDialectBuilder

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

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

source§

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>,

source§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

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

source§

impl<T> Ungil for T
where T: Send,