https://github.com/bitcomplete/sqltestutil
Utilities for testing Golang code that runs SQL
https://github.com/bitcomplete/sqltestutil
Last synced: about 1 month ago
JSON representation
Utilities for testing Golang code that runs SQL
- Host: GitHub
- URL: https://github.com/bitcomplete/sqltestutil
- Owner: bitcomplete
- License: mit
- Created: 2022-05-17T18:29:42.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-21T17:42:56.000Z (almost 2 years ago)
- Last Synced: 2024-06-21T08:14:03.041Z (almost 2 years ago)
- Language: Go
- Size: 6.84 KB
- Stars: 11
- Watchers: 3
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sqltestutil
[](http://godoc.org/github.com/bitcomplete/sqltestutil)
Utilities for testing Golang code that runs SQL.
## Usage
### PostgresContainer
PostgresContainer is a Docker container running Postgres that can be used to
cheaply start a throwaway Postgres instance for testing.
### RunMigration
RunMigration reads all of the files matching *.up.sql in a directory and
executes them in lexicographical order against the provided DB.
### LoadScenario
LoadScenario reads a YAML "scenario" file and uses it to populate the given DB.
### Suite
Suite is a [testify
suite](https://pkg.go.dev/github.com/stretchr/testify@v1.7.0/suite#Suite) that
provides a database connection for running tests against a SQL database.