Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Fix a compilation error with migration files when CREATE UNIQUE INDEX referenced by FOREIGN KEY (https://github.com/sqldelight/sql-psi/pull/732)
- Fix insert statement exposes columns to a select statement when used as the row source (https://github.com/sqldelight/sql-psi/pull/750)
- Add rules ANY and ALL for dialects to use as SqlTypes (https://github.com/sqldelight/sql-psi/pull/760)
- Support keyword-colliding function names REPLACE, LEFT, RIGHT, LIKE, GLOB, IF, MATCH, REGEXP (https://github.com/sqldelight/sql-psi/pull/773)

## [0.7.3] - 2026-03-13
[0.7.3]: https://github.com/sqldelight/sql-psi/releases/tag/0.7.3
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/kotlin/com/alecstrong/sql/psi/core/sql.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ foreign_table ::= id | string {
}
identifier ::= id
pragma_name ::= id
function_name ::= id
function_name ::= id | REPLACE | LEFT | RIGHT | LIKE | GLOB | IF | MATCH | REGEXP
string_literal ::= string
table_or_index_name ::= id
new_table_name ::= id | string {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
CREATE TABLE foo (
value TEXT
);

SELECT REPLACE(value, 'foo', 'bar')
FROM foo;

SELECT LEFT(value, 2)
FROM foo;

SELECT RIGHT(value, 2)
FROM foo;

SELECT LIKE(value, 'foo')
FROM foo;

SELECT GLOB('*oo', value)
FROM foo;

SELECT IF(value = 'foo', 'yes', 'no')
FROM foo;

SELECT MATCH(value, 'foo')
FROM foo;

SELECT REGEXP('f.o', value)
FROM foo;