mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-09 21:42:05 +00:00
Add a note discouraging new use of dialect_of
macro (#1448)
This commit is contained in:
parent
51cbd5a3e6
commit
ce2686a169
1 changed files with 7 additions and 0 deletions
|
@ -60,6 +60,13 @@ use alloc::boxed::Box;
|
|||
|
||||
/// Convenience check if a [`Parser`] uses a certain dialect.
|
||||
///
|
||||
/// Note: when possible please the new style, adding a method to the [`Dialect`]
|
||||
/// trait rather than using this macro.
|
||||
///
|
||||
/// The benefits of adding a method on `Dialect` over this macro are:
|
||||
/// 1. user defined [`Dialect`]s can customize the parsing behavior
|
||||
/// 2. The differences between dialects can be clearly documented in the trait
|
||||
///
|
||||
/// `dialect_of!(parser Is SQLiteDialect | GenericDialect)` evaluates
|
||||
/// to `true` if `parser.dialect` is one of the [`Dialect`]s specified.
|
||||
macro_rules! dialect_of {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue