* Consistently lock in ensureVersionTable and do not call ensureVersionTable from Drop across all database implementations
* Add test for dropping postgres databases
* Fix failing database tests
* Fix CockroachDb test, lock table should be created before versionTable
* Add Initialize() to Driver interface, and add integration tests for Drop() between database implementations and migrate
* Remove Initialize, document breaking behaviour of Drop
* Revert introduction of Initialize method
* Removed Initialize in Stub as well
* Remove call to non-existent Initialize and make sure to close re-initialized database connections
* Revert changes to TestDrop in database/testing
* Split Test and TestMigrate into different test entrypoints
* Remove unused import in migrate_testing
* Remove erroneous code to fix tests
* Add stub source imports to database tests
* Add Stub source to migrate tests
* Use example migrations for tests
* Add file driver to database tests
* Align database directory layout
* Add file source driver to Cassandra
* Review changes
* Minor syntactic change for cleaner diff
- Leaving migrate/testing in case there are unknown consumers
- Add migrate/dktesting package
- Update tests to use migrate/dktesting instead of migrate/testing
cockroach-go made a backwards-incompatible change to their transaction
function signatures, which was causing the cockroach instrumentation
to fail.
Updates the signature to match the cockraoch-go change.
Adds a readme to the cockroachdb database package, following the
postgres readme style.
Also adds the ability to force acquisition of the migration lock
via a connect URL parameter/WithInstance config, to allow for fixing
cases where an implementation error causes the schema lock to not
be released.
Lastly, tweaks the CLI readme to include information on building a
CLI for databases other than postgres.
Adds support for CockroachDB. Cockroach uses the postges wire
protocol and has a large amount of common SQL functionality shared
with Postgres, so much of the postgres code was able to be copied
and modified.
Since the protocol is used in determining the driver, and the
Postgres protocol is also used by Cockroach, new connect string
prefixes were added: cockroach:// cockroachdb:// and
crdb-postgres://. These fake protocol strings are replaced in
the connect function with the correct `postgres://` protocol.
TODO: Tests needed (Cockroach has a docker image, so this shouldn't
be too hard)