-
Notifications
You must be signed in to change notification settings - Fork 2
Postgres #62
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
Draft
simukka
wants to merge
28
commits into
main
Choose a base branch
from
postgres
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Postgres #62
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
fa05d57
Updated testing environment.
simukka 351a6dc
Working connection.
simukka b1b982d
Updated fixture to use pgx. Simplified how we introspect the DSN to d…
simukka 2d9462f
Wrote initial sqlcode migration for postgres.
simukka 6643158
Add security definer role.
simukka fd8c76f
[wip] working through changes for EnsureUploaded to support postgresql.
simukka b6681a2
Working EnsureUpload!
simukka da5b115
[wip] update parser and scanner
simukka 18309f0
Fixed issue with Preprocess. Passing pgsql tests.
simukka b651814
Updated GO workflow to test both drivers.
simukka 160df17
Fixed typo in GH workflow.
simukka 11659ed
Updated Dockerfile
simukka 37fd588
Use build tags to exclude examples from bulid & test
simukka ca444bc
Exclude example test
simukka c483fb7
Fixed failing test.
simukka 4b803bf
Moved Document structs to a separate file for better organization.
simukka f202e18
Updated go-mssql depedency to use microsoft fork. DropAndUpload now s…
simukka ad129b8
Initial unit tests for T-SQL syntax parsing.
simukka 352ed9f
Refactored to use a Document interface.
simukka 5e807d5
Renamed the existing Document struct to be specific for T-SQL.
simukka 494dca9
Created initial PGSqlDocument for PostgreSQL.
simukka 1f7b6b7
Updated unit test.
simukka af75628
Updated tests.
simukka 6916d34
Simplified Document interface. Created Pragma struct.
simukka 1a91556
[wip] pgsql document parsing
simukka fb56414
Simplify the interfaces for parsing a SQL document.
simukka 5e29dc9
Refactored pgsql document to use node parser.
simukka 6e114a9
[wip]
simukka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| test: test_mssql test_pgsql | ||
|
|
||
|
|
||
| test_mssql: | ||
| docker compose --progress plain -f docker-compose.mssql.yml run test | ||
|
|
||
| test_pgsql: | ||
| docker compose --progress plain -f docker-compose.pgsql.yml run test |
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 |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ package sqlcode | |
| import ( | ||
| "context" | ||
| "database/sql" | ||
| "database/sql/driver" | ||
| ) | ||
|
|
||
| type DB interface { | ||
|
|
@@ -11,6 +12,7 @@ type DB interface { | |
| QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row | ||
| Conn(ctx context.Context) (*sql.Conn, error) | ||
| BeginTx(ctx context.Context, txOptions *sql.TxOptions) (*sql.Tx, error) | ||
| Driver() driver.Driver | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a required interface for sql.DB and shouldn't be too much of a hassle to support in internal libraries. |
||
| } | ||
|
|
||
| var _ DB = &sql.DB{} | ||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: The cli module is not yet compatible with postgres.