-
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
base: main
Are you sure you want to change the base?
Conversation
…etermine the driver type. Allow for future expansion/testing with other drivers. Preparring to write sqlcode migration for Postgres.
| } | ||
|
|
||
| preprocessed, err := sqlcode.Preprocess(d.CodeBase, schemasuffix) | ||
| preprocessed, err := sqlcode.Preprocess(d.CodeBase, schemasuffix, &mssql.Driver{}) |
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.
| 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 |
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.
This is a required interface for sql.DB and shouldn't be too much of a hassle to support in internal libraries.
dbops.go
Outdated
| "context" | ||
| "database/sql" | ||
|
|
||
| mssql "github.com/denisenkom/go-mssqldb" |
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.
Q: Should we use the official mssql driver?
| } | ||
|
|
||
| if _, ok := driver.(*mssql.Driver); ok { | ||
| // TODO |
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: Add back the mssql sql to lock on upload.
…upport postgresql.
| ) into schema_exists; | ||
|
|
||
| if not schema_exists then | ||
| raise exception 'schema "%" not found', schemaname; |
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.
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
Adds PostgreSQL support to sqlcode so that it can work with both mssql and pgsql simultaneously.