-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write unit tests for Postgres package (#69)
Changes: * I add postgres_databaseutils_test.go for containing all utilities for mocking the database. * I put appName as a required parameter passed to the New() since it is needed to form the namespace column name. * I add GetMaxInterval() since it might be needed by the consumer and the test. * I move the SQL string package variables directly into the function that need it so we could avoid maintenance nightmare in the future.
- Loading branch information
1 parent
d3b7634
commit cb35697
Showing
5 changed files
with
359 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package postgres | ||
|
||
import "database/sql" | ||
|
||
func (c *Checkpoint) SetConn(conn *sql.DB) { | ||
c.conn = conn | ||
} |
Oops, something went wrong.