-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
big QueryBox refactor, switch to sql.Tx (#12)
- the main goal is to make it easy to have RDBMS-specific code branches - command runner functions handle database connection (if required) - defer to other functions depending on database-specific functionality - this pattern keeps related command code together - the other way to slice the pie is to keep RDBMS-specific code together (`postgres.go`, `mysql.go`) - but, the functionality is so similar, this should help promote code reuse - also, don't want a command with one database to change much from another database - keeping `QueryBox` since it keeps a lot of the code simple - the duplicative `if dbox.Type ==` calls isn't the best, and what to do for the `else`? - adding `if dbox.IsPostgres` helps, auto completion of methods - in the `else` just doing a `panic` since it's essentially unreachable
- Loading branch information
Showing
20 changed files
with
336 additions
and
214 deletions.
There are no files selected for viewing
This file contains 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 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 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 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.