Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pressly/goose
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.22.1
Choose a base ref
...
head repository: pressly/goose
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.23.0
Choose a head ref
  • 17 commits
  • 45 files changed
  • 5 contributors

Commits on Sep 17, 2024

  1. Copy the full SHA
    b831b82 View commit details

Commits on Sep 18, 2024

  1. Copy the full SHA
    cf53a22 View commit details

Commits on Oct 19, 2024

  1. Copy the full SHA
    053b1fd View commit details
  2. chore: bumps go deps

    mfridman committed Oct 19, 2024
    Copy the full SHA
    872685a View commit details
  3. Copy the full SHA
    e78caf2 View commit details
  4. Copy the full SHA
    a02d852 View commit details
  5. Copy the full SHA
    1e26652 View commit details
  6. update comment

    mfridman committed Oct 19, 2024
    Copy the full SHA
    8f6abb6 View commit details

Commits on Nov 2, 2024

  1. Copy the full SHA
    4a80e05 View commit details
  2. Copy the full SHA
    1f7c16d View commit details

Commits on Nov 15, 2024

  1. Copy the full SHA
    512a496 View commit details

Commits on Nov 20, 2024

  1. Copy the full SHA
    f3d1dc4 View commit details
  2. docs: update CHANGELOG.md

    mfridman committed Nov 20, 2024
    Copy the full SHA
    0a9c531 View commit details
  3. Copy the full SHA
    bd901a5 View commit details
  4. ci: update testing output

    mfridman committed Nov 20, 2024
    Copy the full SHA
    ccfd6d7 View commit details
  5. build(deps): bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 (#849

    )
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Nov 20, 2024
    Copy the full SHA
    7248a72 View commit details

Commits on Nov 21, 2024

  1. Release v3.23.0

    mfridman committed Nov 21, 2024
    Copy the full SHA
    8d88226 View commit details
Showing with 1,315 additions and 1,078 deletions.
  1. +2 −0 .github/workflows/ci.yaml
  2. +2 −0 .github/workflows/integration.yaml
  3. +14 −0 .golangci.yaml
  4. +1 −1 .goreleaser.yaml
  5. +8 −1 CHANGELOG.md
  6. +22 −13 Makefile
  7. +2 −0 README.md
  8. +2 −2 cmd/goose/main.go
  9. +2 −0 database/dialect.go
  10. +63 −62 database/store_test.go
  11. +3 −1 db.go
  12. +3 −0 dialect.go
  13. +117 −117 globals_test.go
  14. +12 −11 go.mod
  15. +38 −24 go.sum
  16. +30 −29 goose_cli_test.go
  17. +15 −15 goose_embed_test.go
  18. +0 −86 internal/check/check.go
  19. +45 −0 internal/dialect/dialectquery/starrocks.go
  20. +1 −0 internal/dialect/dialects.go
  21. +8 −1 internal/dialect/store.go
  22. +25 −24 internal/gooseutil/resolve_test.go
  23. +19 −19 internal/migrationstats/migrationstats_test.go
  24. +14 −15 internal/sqlparser/parse_test.go
  25. +31 −28 internal/sqlparser/parser_test.go
  26. +29 −26 internal/testing/go.mod
  27. +58 −54 internal/testing/go.sum
  28. +11 −0 internal/testing/integration/database_test.go
  29. +34 −35 internal/testing/integration/postgres_locking_test.go
  30. +9 −0 internal/testing/integration/testdata/migrations/starrocks/00001_a.sql
  31. +31 −0 internal/testing/integration/testdata/migrations/starrocks/00002_b.sql
  32. +15 −0 internal/testing/integration/testdata/migrations/starrocks/00003_c.sql
  33. +103 −0 internal/testing/testdb/starrocks.go
  34. +5 −0 internal/testing/testdb/testdb.go
  35. +57 −55 migrate_test.go
  36. +4 −4 provider_collect.go
  37. +79 −79 provider_collect_test.go
  38. +8 −3 provider_options.go
  39. +13 −13 provider_options_test.go
  40. +12 −8 provider_run.go
  41. +252 −241 provider_run_test.go
  42. +10 −13 provider_test.go
  43. +25 −25 tests/gomigrations/error/gomigrations_error_test.go
  44. +41 −41 tests/gomigrations/register/register_test.go
  45. +40 −32 tests/gomigrations/success/gomigrations_success_test.go
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -36,6 +36,8 @@ jobs:
echo "Please format Go code by running: go fmt ./..."
exit 1
fi
- name: Install tparse
run: go install github.com/mfridman/tparse@main
- name: Run tests
run: |
mkdir -p bin
2 changes: 2 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
@@ -23,6 +23,8 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: "stable"
- name: Install tparse
run: go install github.com/mfridman/tparse@main
- name: Run full integration tests
run: |
make test-integration
14 changes: 14 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
linters:
disable-all: true
enable:
# Default
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
- gofmt
# Added
- testifylint
- misspell
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -31,6 +31,6 @@ archives:
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
version_template: "{{ incpatch .Version }}-next"
changelog:
use: github-native
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -7,6 +7,12 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [v3.23.0]

- Add `WithLogger` to `NewProvider` to allow custom loggers (#833)
- Update Provider `WithVerbose` behavior to log all SQL statements (#851)
- Upgrade dependencies and rebuild binaries with latest Go version (`go1.23.3`)

## [v3.22.1]

- Upgrade dependencies and rebuild binaries with latest Go version (`go1.23.1`)
@@ -232,7 +238,8 @@ Here's a quick summary:
- Add new `context.Context`-aware functions and methods, for both sql and go migrations.
- Return error when no migration files found or dir is not a directory.

[Unreleased]: https://github.com/pressly/goose/compare/v3.22.1...HEAD
[Unreleased]: https://github.com/pressly/goose/compare/v3.23.0...HEAD
[v3.23.0]: https://github.com/pressly/goose/compare/v3.22.1...v3.23.0
[v3.22.1]: https://github.com/pressly/goose/compare/v3.22.0...v3.22.1
[v3.22.0]: https://github.com/pressly/goose/compare/v3.21.1...v3.22.0
[v3.21.1]: https://github.com/pressly/goose/compare/v3.20.0...v3.21.1
35 changes: 22 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GO_TEST_FLAGS ?= -race -count=1 -v -timeout=5m
GO_TEST_FLAGS ?= -race -count=1 -v -timeout=5m -json

# These are the default values for the test database. They can be overridden
DB_USER ?= dbuser
@@ -9,6 +9,7 @@ DB_MYSQL_PORT ?= 3307
DB_CLICKHOUSE_PORT ?= 9001
DB_YDB_PORT ?= 2136
DB_TURSO_PORT ?= 8080
DB_STARROCKS_PORT ?= 9030

list-build-tags:
@echo "Available build tags:"
@@ -37,19 +38,22 @@ lint: tools
.PHONY: tools
tools:
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
@go install github.com/mfridman/tparse@main

test-packages:
go test $(GO_TEST_FLAGS) $$(go list ./... | grep -v -e /tests -e /bin -e /cmd -e /examples)
go test $(GO_TEST_FLAGS) $$(go list ./... | grep -v -e /bin -e /cmd -e /examples) |\
tparse --follow -sort=elapsed -trimpath=auto -all

test-packages-short:
go test -test.short $(GO_TEST_FLAGS) $$(go list ./... | grep -v -e /tests -e /bin -e /cmd -e /examples)
go test -test.short $(GO_TEST_FLAGS) $$(go list ./... | grep -v -e /bin -e /cmd -e /examples) |\
tparse --follow -sort=elapsed

coverage-short:
go test ./ -test.short $(GO_TEST_FLAGS) -cover -coverprofile=coverage.out
go test ./ -test.short $(GO_TEST_FLAGS) -cover -coverprofile=coverage.out | tparse --follow -sort=elapsed
go tool cover -html=coverage.out

coverage:
go test ./ $(GO_TEST_FLAGS) -cover -coverprofile=coverage.out
go test ./ $(GO_TEST_FLAGS) -cover -coverprofile=coverage.out | tparse --follow -sort=elapsed
go tool cover -html=coverage.out

#
@@ -66,28 +70,33 @@ upgrade-integration-deps:
cd ./internal/testing && go get -u ./... && go mod tidy

test-postgres-long: add-gowork test-postgres
go test $(GO_TEST_FLAGS) ./internal/testing/integration -run='(TestPostgresProviderLocking|TestPostgresSessionLocker)'
go test $(GO_TEST_FLAGS) ./internal/testing/integration -run='(TestPostgresProviderLocking|TestPostgresSessionLocker)' |\
tparse --follow -sort=elapsed

test-postgres: add-gowork
go test $(GO_TEST_FLAGS) ./internal/testing/integration -run="^TestPostgres$$"
go test $(GO_TEST_FLAGS) ./internal/testing/integration -run="^TestPostgres$$" | tparse --follow -sort=elapsed

test-clickhouse: add-gowork
go test $(GO_TEST_FLAGS) ./internal/testing/integration -run='(TestClickhouse|TestClickhouseRemote)'
go test $(GO_TEST_FLAGS) ./internal/testing/integration -run='(TestClickhouse|TestClickhouseRemote)' |\
tparse --follow -sort=elapsed

test-mysql: add-gowork
go test $(GO_TEST_FLAGS) ./internal/testing/integration -run='TestMySQL'
go test $(GO_TEST_FLAGS) ./internal/testing/integration -run='TestMySQL' | tparse --follow -sort=elapsed

test-turso: add-gowork
go test $(GO_TEST_FLAGS) ./internal/testing/integration -run='TestTurso'
go test $(GO_TEST_FLAGS) ./internal/testing/integration -run='TestTurso' | tparse --follow -sort=elapsed

test-vertica: add-gowork
go test $(GO_TEST_FLAGS) ./internal/testing/integration -run='TestVertica'
go test $(GO_TEST_FLAGS) ./internal/testing/integration -run='TestVertica' | tparse --follow -sort=elapsed

test-ydb: add-gowork
go test $(GO_TEST_FLAGS) ./internal/testing/integration -run='TestYDB'
go test $(GO_TEST_FLAGS) ./internal/testing/integration -run='TestYDB' | tparse --follow -sort=elapsed

test-starrocks: add-gowork
go test $(GO_TEST_FLAGS) ./internal/testing/integration -run='TestStarrocks' | tparse --follow -sort=elapsed

test-integration: add-gowork
go test $(GO_TEST_FLAGS) ./internal/testing/integration/...
go test $(GO_TEST_FLAGS) ./internal/testing/integration/... | tparse --follow -sort=elapsed -trimpath=auto -all

#
# Docker-related targets
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -79,6 +79,7 @@ Drivers:
clickhouse
vertica
ydb
starrocks
Examples:
goose sqlite3 ./foo.db status
@@ -95,6 +96,7 @@ Examples:
goose clickhouse "tcp://127.0.0.1:9000" status
goose vertica "vertica://user:password@localhost:5433/dbname?connection_load_balance=1" status
goose ydb "grpcs://localhost:2135/local?go_query_mode=scripting&go_fake_tx=scripting&go_query_bind=declare,numeric" status
goose starrocks "user:password@/dbname?parseTime=true&interpolateParams=true" status
GOOSE_DRIVER=sqlite3 GOOSE_DBSTRING=./foo.db goose status
GOOSE_DRIVER=sqlite3 GOOSE_DBSTRING=./foo.db goose create init sql
4 changes: 2 additions & 2 deletions cmd/goose/main.go
Original file line number Diff line number Diff line change
@@ -271,15 +271,15 @@ Examples:
goose clickhouse "tcp://127.0.0.1:9000" status
goose vertica "vertica://user:password@localhost:5433/dbname?connection_load_balance=1" status
goose ydb "grpcs://localhost:2135/local?go_query_mode=scripting&go_fake_tx=scripting&go_query_bind=declare,numeric" status
goose turso "libsql://dbname.turso.io?authToken=token" status
goose turso "libsql://dbname.turso.io?authToken=token" status
GOOSE_DRIVER=sqlite3 GOOSE_DBSTRING=./foo.db goose status
GOOSE_DRIVER=sqlite3 GOOSE_DBSTRING=./foo.db goose create init sql
GOOSE_DRIVER=postgres GOOSE_DBSTRING="user=postgres dbname=postgres sslmode=disable" goose status
GOOSE_DRIVER=mysql GOOSE_DBSTRING="user:password@/dbname" goose status
GOOSE_DRIVER=redshift GOOSE_DBSTRING="postgres://user:password@qwerty.us-east-1.redshift.amazonaws.com:5439/db" goose status
GOOSE_DRIVER=turso GOOSE_DBSTRING="libsql://dbname.turso.io?authToken=token" goose status
GOOSE_DRIVER=clickhouse GOOSE_DBSTRING="clickhouse://user:password@qwerty.clickhouse.cloud:9440/dbname?secure=true&skip_verify=false" goose status
GOOSE_DRIVER=clickhouse GOOSE_DBSTRING="clickhouse://user:password@qwerty.clickhouse.cloud:9440/dbname?secure=true&skip_verify=false" goose status
Options:
`
2 changes: 2 additions & 0 deletions database/dialect.go
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ const (
DialectTurso Dialect = "turso"
DialectVertica Dialect = "vertica"
DialectYdB Dialect = "ydb"
DialectStarrocks Dialect = "starrocks"
)

// NewStore returns a new [Store] implementation for the given dialect.
@@ -44,6 +45,7 @@ func NewStore(dialect Dialect, tablename string) (Store, error) {
DialectVertica: &dialectquery.Vertica{},
DialectYdB: &dialectquery.Ydb{},
DialectTurso: &dialectquery.Turso{},
DialectStarrocks: &dialectquery.Starrocks{},
}
querier, ok := lookup[dialect]
if !ok {
Loading