datafusion_sql::unparser::dialect

Struct 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

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 support 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_int32_cast_dtype(self, int32_cast_dtype: DataType) -> Self

Customize the dialect with a specific SQL type for Int32 casting: Integer, 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.

Source

pub fn with_date32_cast_dtype(self, date32_cast_dtype: DataType) -> Self

Source

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

Source

pub fn with_requires_derived_table_alias( self, requires_derived_table_alias: bool, ) -> Self

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> 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, 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<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,