go fix applied the modernizers. One rewrite it got wrong is corrected here: a
reverse loop over runes became a range over slices.Backward that bound the index
and the value to the SAME name, which does not compile and would have compared a
rune to an index if it had. The value gets its own name.
Co-authored-by: Hanzo Dev <[email protected]>
* feat: remove dependency on "hashicorp/go-multierror"
It seems the project has been unmainted for quite some time already,
see for example https://github.com/hashicorp/go-multierror/issues/97
and https://github.com/hashicorp/go-multierror/issues/98.
This also removes an uneccessary dependency which slims down the go.mod.
Go as of version 1.20 supports appending errors by specifying
multiple "%w" formatters in the "fmt.Errorf"[^0] function.
[^0]: https://pkg.go.dev/fmt#Errorf
* feat: use errors.Join to combine multiple errors
As an update to the previous commit 59f084ea3be2e7ec9d912c1a311402b1e4c40df6,
use "errors.Join"[^0] instead of multiple "%w" formatters for "fmt.Errorf".
[^0]: https://pkg.go.dev/errors#Join
* chore: bring back unused util.go file as removing it is a breaking change
As of Go 1.16, the same functionality is now provided by package io or
package os, and those implementations should be preferred in new code.
So replacing all usage of ioutil pkg with io & os.
- Update spanner library to cloud.google.com/go/[email protected]
This prevents erroring on DDL statements like:
ALTER TABLE users ALTER COLUMN created
SET OPTIONS (allow_commit_timestamp = true);
https://github.com/googleapis/google-cloud-go/pull/2656
- Add test case which fails with older version of the library, and
succeeds with this one.
Fixes: #426
- include param in DSN example
- link to README docs on param (option) format
- switch to 'parameter' instead of 'option', in the main README, since
this is preferred
At the moment GCP Spanner backend does not seem to support comments
(issue being tracked at
https://issuetracker.google.com/issues/159730604).
By adding support for parsing the migration DDL with spansql we are
able to support comments and remove them before applying on the
database
- Only compile a regex once for re-use
- Don't use regex unnecessarily (removing trailing semicolon)
- Add test for parsing multiple statements in a migration
* 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
Also includes some refactor around package naming, treats own repo as first-class and uses alternative package names for third party imports, Google spanner libraries in this case.
Support for Google Cloud Spanner, closes#172. Includes example migrations ported over from the PostgreSQL driver.
In all examples provided by Google I’ve come across, camel-case is used for table names, columns, etc. Hence the examples use this naming convention.