Conversation
…etermine the driver type. Allow for future expansion/testing with other drivers. Preparring to write sqlcode migration for Postgres.
simukka
commented
Dec 3, 2025
simukka
commented
Dec 9, 2025
| } | ||
|
|
||
| preprocessed, err := sqlcode.Preprocess(d.CodeBase, schemasuffix) | ||
| preprocessed, err := sqlcode.Preprocess(d.CodeBase, schemasuffix, &mssql.Driver{}) |
Contributor
Author
There was a problem hiding this comment.
TODO: The cli module is not yet compatible with postgres.
simukka
commented
Dec 9, 2025
| 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.
This is a required interface for sql.DB and shouldn't be too much of a hassle to support in internal libraries.
simukka
commented
Dec 9, 2025
dbops.go
Outdated
| "context" | ||
| "database/sql" | ||
|
|
||
| mssql "github.com/denisenkom/go-mssqldb" |
Contributor
Author
There was a problem hiding this comment.
Q: Should we use the official mssql driver?
simukka
commented
Dec 9, 2025
| } | ||
|
|
||
| if _, ok := driver.(*mssql.Driver); ok { | ||
| // TODO |
Contributor
Author
There was a problem hiding this comment.
TODO: Add back the mssql sql to lock on upload.
…upport postgresql.
clabar
reviewed
Dec 18, 2025
| ) into schema_exists; | ||
|
|
||
| if not schema_exists then | ||
| raise exception 'schema "%" not found', schemaname; |
There was a problem hiding this comment.
A bit of a philosophical question, but does one need to rise an exception when attempting to delete a non existent thing? IMHO the answer is no
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds PostgreSQL support to sqlcode so that it can work with both mssql and pgsql simultaneously.