Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(engine/sqlite): fix join_operator rule #2434

Merged
merged 5 commits into from
Jul 24, 2023
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
31 changes: 31 additions & 0 deletions internal/endtoend/testdata/full_outer_join/sqlite/go/db.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions internal/endtoend/testdata/full_outer_join/sqlite/go/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions internal/endtoend/testdata/full_outer_join/sqlite/go/query.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions internal/endtoend/testdata/full_outer_join/sqlite/query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- Example queries for sqlc
CREATE TABLE authors (
id INTEGER PRIMARY KEY,
name text NOT NULL
);

CREATE TABLE books (
id INTEGER PRIMARY KEY,
title text NOT NULL
);

-- name: GetAuthor :one
SELECT * FROM authors AS a
FULL OUTER JOIN books AS b
ON a.id = b.id
WHERE a.id = ? LIMIT 1;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version": "1", "packages": [{"path": "go", "engine": "sqlite", "schema": "query.sql", "queries": "query.sql", "name": "querytest"}]}
3 changes: 2 additions & 1 deletion internal/engine/sqlite/parser/SQLiteParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,8 @@ result_column:

join_operator:
COMMA
| NATURAL_? (LEFT_ OUTER_? | INNER_ | CROSS_)? JOIN_
| NATURAL_? (((LEFT_ | RIGHT_ | FULL_) OUTER_?) | INNER_)? JOIN_
| CROSS_ JOIN_
;

join_constraint:
Expand Down
2 changes: 1 addition & 1 deletion internal/engine/sqlite/parser/SQLiteParser.interp

Large diffs are not rendered by default.

2,280 changes: 1,151 additions & 1,129 deletions internal/engine/sqlite/parser/sqlite_parser.go

Large diffs are not rendered by default.

Loading