hashicorp / go-dbw

A simple package that encapsulates database operations.
Mozilla Public License 2.0
13 stars 2 forks source link

fix (testing): better handling of sqlite connections for TestSetup(...) #13

Closed jimlambrt closed 2 years ago

jimlambrt commented 2 years ago

Add new option WithTestMigrationUsingDB(..) to support special case handling of sqlite because we may want to run the migration on an in-memory database that isn't shared "file::memory:" or ":memory:" so we have to be sure that we don't open a new connection, which would create a new in-memory db vs using the existing one already opened in TestSetup(...) see: https://www.sqlite.org/inmemorydb.html