-
Notifications
You must be signed in to change notification settings - Fork 981
feat(analyzer): Analyze queries using a running PostgreSQL database #2805
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
cba2aac
feat(analyzer): Analyze queries using a running PostgreSQL database
kyleconroy 48f638b
test(analyzer): Update endtoend tests for new analyzer
kyleconroy 884d317
back out change
kyleconroy 770837d
Address comments
kyleconroy 854758f
No more splitting
kyleconroy 7e73bc3
fix invalid_func_args
kyleconroy 65ffec2
invalid_params
kyleconroy ea91202
Fix last tests
kyleconroy daecc8b
Merge branch 'main' into kyle/analyzer-pg-prepare
kyleconroy e955bb5
Fix diff_output test
kyleconroy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| CREATE TABLE bar (id serial not null); | ||
|
|
||
| CREATE TABLE bar (id serial not null); |
3 changes: 3 additions & 0 deletions
3
internal/endtoend/testdata/coalesce_as/postgresql/pganalyze/exec.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "contexts": ["managed-db"] | ||
| } |
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...unc_return/postgresql/pgx/v5/go/models.go → ...esce_as/postgresql/pganalyze/go/models.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
internal/endtoend/testdata/coalesce_as/postgresql/pganalyze/go/query.sql.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
internal/endtoend/testdata/coalesce_as/postgresql/pganalyze/query.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| -- name: SumBaz :many | ||
| SELECT bar, coalesce(sum(baz), 0) as quantity | ||
| FROM foo | ||
| GROUP BY 1; |
5 changes: 5 additions & 0 deletions
5
internal/endtoend/testdata/coalesce_as/postgresql/pganalyze/schema.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| CREATE TABLE foo ( | ||
| bar text, | ||
| baz bigint | ||
| ); | ||
|
|
19 changes: 19 additions & 0 deletions
19
internal/endtoend/testdata/coalesce_as/postgresql/pganalyze/sqlc.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "version": "1", | ||
| "cloud": { | ||
| "project": "01HAQMMECEYQYKFJN8MP16QC41" | ||
| }, | ||
| "packages": [ | ||
| { | ||
| "path": "go", | ||
| "engine": "postgresql", | ||
| "sql_package": "pgx/v5", | ||
| "database": { | ||
| "managed": true | ||
| }, | ||
| "name": "querytest", | ||
| "schema": "schema.sql", | ||
| "queries": "query.sql" | ||
| } | ||
| ] | ||
| } |
3 changes: 3 additions & 0 deletions
3
internal/endtoend/testdata/coalesce_as/postgresql/pgx/v4/exec.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "contexts": ["base"] | ||
| } |
3 changes: 3 additions & 0 deletions
3
internal/endtoend/testdata/coalesce_as/postgresql/pgx/v5/exec.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "contexts": ["base"] | ||
| } |
3 changes: 3 additions & 0 deletions
3
internal/endtoend/testdata/coalesce_as/postgresql/stdlib/exec.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "contexts": ["base"] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.