Support for postgres String Constants with Unicode Escapes (#1355)

This commit is contained in:
Ophir LOJKINE 2024-07-29 23:18:16 +02:00 committed by GitHub
parent c3ba2f33c6
commit bc15f7b4ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 180 additions and 0 deletions

View file

@ -145,6 +145,21 @@ pub trait Dialect: Debug + Any {
fn supports_string_literal_backslash_escape(&self) -> bool {
false
}
/// Determine if the dialect supports string literals with `U&` prefix.
/// This is used to specify Unicode code points in string literals.
/// For example, in PostgreSQL, the following is a valid string literal:
/// ```sql
/// SELECT U&'\0061\0062\0063';
/// ```
/// This is equivalent to the string literal `'abc'`.
/// See
/// - [Postgres docs](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS-UESCAPE)
/// - [H2 docs](http://www.h2database.com/html/grammar.html#string)
fn supports_unicode_string_literal(&self) -> bool {
false
}
/// Does the dialect support `FILTER (WHERE expr)` for aggregate queries?
fn supports_filter_during_aggregation(&self) -> bool {
false