-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: Implement "ESCAPE" #23538
Copy link
Copy link
Closed
Labels
A-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)good first issue
Milestone
Description
FEATURE REQUEST
Please, implement the keyword ESCAPE, it is used by ORM (like ebean or hibernate) when a LIKE predicate is present.
Official PostgreSQL says:
string LIKE pattern [ESCAPE escape-character]
string NOT LIKE pattern [ESCAPE escape-character]
string SIMILAR TO pattern [ESCAPE escape-character]
string NOT SIMILAR TO pattern [ESCAPE escape-character]The default escape character is the backslash but a different one can be selected by using the ESCAPE clause. To match the escape character itself, write two escape characters.
Query sample:
SELECT * FROM account WHERE first_name LIKE 'bob' ESCAPE ''; -- ORM generated query
SELECT 'A' LIKE '\A' ESCAPE '\'; -- return true
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)good first issue