mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-28 22:12:24 +00:00
Add docstrings for Dialects, update README (#1016)
This commit is contained in:
parent
8b2a248d7b
commit
6739d377bd
14 changed files with 37 additions and 12 deletions
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
use crate::dialect::Dialect;
|
||||
|
||||
/// A [`Dialect`] for [ANSI SQL](https://en.wikipedia.org/wiki/SQL:2011).
|
||||
#[derive(Debug)]
|
||||
pub struct AnsiDialect {}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
use crate::dialect::Dialect;
|
||||
|
||||
/// A [`Dialect`] for [Google Bigquery](https://cloud.google.com/bigquery/)
|
||||
#[derive(Debug, Default)]
|
||||
pub struct BigQueryDialect;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
use crate::dialect::Dialect;
|
||||
|
||||
// A [`Dialect`] for [ClickHouse](https://clickhouse.com/).
|
||||
#[derive(Debug)]
|
||||
pub struct ClickHouseDialect {}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
use crate::dialect::Dialect;
|
||||
|
||||
/// A [`Dialect`] for [DuckDB](https://duckdb.org/)
|
||||
#[derive(Debug, Default)]
|
||||
pub struct DuckDbDialect;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
use crate::dialect::Dialect;
|
||||
|
||||
/// A permissive, general purpose [`Dialect`], which parses a wide variety of SQL
|
||||
/// statements, from many different dialects.
|
||||
#[derive(Debug, Default)]
|
||||
pub struct GenericDialect;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
use crate::dialect::Dialect;
|
||||
|
||||
/// A [`Dialect`] for [Hive](https://hive.apache.org/).
|
||||
#[derive(Debug)]
|
||||
pub struct HiveDialect {}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,9 @@ macro_rules! dialect_of {
|
|||
/// custom extensions or various historical reasons. This trait
|
||||
/// encapsulates the parsing differences between dialects.
|
||||
///
|
||||
/// [`GenericDialect`] is the most permissive dialect, and parses the union of
|
||||
/// all the other dialects, when there is no ambiguity.
|
||||
///
|
||||
/// # Examples
|
||||
/// Most users create a [`Dialect`] directly, as shown on the [module
|
||||
/// level documentation]:
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
use crate::dialect::Dialect;
|
||||
|
||||
// [Microsoft SQL Server](https://www.microsoft.com/en-us/sql-server/) dialect
|
||||
/// A [`Dialect`] for [Microsoft SQL Server](https://www.microsoft.com/en-us/sql-server/)
|
||||
#[derive(Debug)]
|
||||
pub struct MsSqlDialect {}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use crate::{
|
|||
keywords::Keyword,
|
||||
};
|
||||
|
||||
/// [MySQL](https://www.mysql.com/)
|
||||
/// A [`Dialect`] for [MySQL](https://www.mysql.com/)
|
||||
#[derive(Debug)]
|
||||
pub struct MySqlDialect {}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ use crate::keywords::Keyword;
|
|||
use crate::parser::{Parser, ParserError};
|
||||
use crate::tokenizer::Token;
|
||||
|
||||
/// A [`Dialect`] for [PostgreSQL](https://www.postgresql.org/)
|
||||
#[derive(Debug)]
|
||||
pub struct PostgreSqlDialect {}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ use core::str::Chars;
|
|||
|
||||
use super::PostgreSqlDialect;
|
||||
|
||||
/// A [`Dialect`] for [RedShift](https://aws.amazon.com/redshift/)
|
||||
#[derive(Debug)]
|
||||
pub struct RedshiftSqlDialect {}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ use alloc::vec::Vec;
|
|||
#[cfg(not(feature = "std"))]
|
||||
use alloc::{format, vec};
|
||||
|
||||
/// A [`Dialect`] for [Snowflake](https://www.snowflake.com/)
|
||||
#[derive(Debug, Default)]
|
||||
pub struct SnowflakeDialect;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ use crate::dialect::Dialect;
|
|||
use crate::keywords::Keyword;
|
||||
use crate::parser::{Parser, ParserError};
|
||||
|
||||
/// A [`Dialect`] for [SQLite](https://www.sqlite.org)
|
||||
#[derive(Debug)]
|
||||
pub struct SQLiteDialect {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue