Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/dialect/duckdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ impl Dialect for DuckDbDialect {
true
}

/// Returns true if this dialect allows the `EXTRACT` function to use single quotes in the part being extracted.
fn allow_extract_single_quotes(&self) -> bool {
true
}

// DuckDB is compatible with PostgreSQL syntax for this statement,
// although not all features may be implemented.
fn supports_explain_with_utility_options(&self) -> bool {
Expand Down
6 changes: 6 additions & 0 deletions tests/sqlparser_duckdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -869,3 +869,9 @@ fn test_duckdb_trim() {
duckdb().parse_sql_statements(error_sql).unwrap_err()
);
}

#[test]
fn parse_extract_single_quotes() {
let sql = "SELECT EXTRACT('month' FROM my_timestamp) FROM my_table";
duckdb().verified_stmt(sql);
}
Loading