Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oris/fix ctx #1

Merged
merged 3 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ import (
"database/sql"
"embed"

"github.com/pressly/goose/v3"
"github.com/piiano/goose/v3"
)

//go:embed migrations/*.sql
Expand Down Expand Up @@ -387,7 +387,7 @@ package migrations
import (
"database/sql"

"github.com/pressly/goose/v3"
"github.com/piiano/goose/v3"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions cmd/goose/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"text/tabwriter"
"text/template"

"github.com/pressly/goose/v3"
"github.com/pressly/goose/v3/internal/cfg"
"github.com/pressly/goose/v3/internal/migrationstats"
"github.com/piiano/goose/v3"
"github.com/piiano/goose/v3/internal/cfg"
"github.com/piiano/goose/v3/internal/migrationstats"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion create.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ var goSQLMigrationTemplate = template.Must(template.New("goose.go-migration").Pa
import (
"context"
"database/sql"
"github.com/pressly/goose/v3"
"github.com/piiano/goose/v3"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion database/dialect.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"errors"
"fmt"

"github.com/pressly/goose/v3/internal/dialect/dialectquery"
"github.com/piiano/goose/v3/internal/dialect/dialectquery"
)

// Dialect is the type of database dialect.
Expand Down
7 changes: 4 additions & 3 deletions database/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import (
"testing"

"github.com/jackc/pgx/v5/pgconn"
"github.com/pressly/goose/v3/database"
"github.com/pressly/goose/v3/internal/check"
"github.com/pressly/goose/v3/internal/testdb"
"go.uber.org/multierr"
"modernc.org/sqlite"

"github.com/piiano/goose/v3/database"
"github.com/piiano/goose/v3/internal/check"
"github.com/piiano/goose/v3/internal/testdb"
)

// The goal of this test is to verify the database store package works as expected. This test is not
Expand Down
4 changes: 2 additions & 2 deletions dialect.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package goose
import (
"fmt"

"github.com/pressly/goose/v3/database"
"github.com/pressly/goose/v3/internal/dialect"
"github.com/piiano/goose/v3/database"
"github.com/piiano/goose/v3/internal/dialect"
)

// Dialect is the type of database dialect. It is an alias for [database.Dialect].
Expand Down
2 changes: 1 addition & 1 deletion examples/go-migrations/00002_rename_root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"database/sql"

"github.com/pressly/goose/v3"
"github.com/piiano/goose/v3"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion examples/go-migrations/00003_add_user_no_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"database/sql"
"errors"

"github.com/pressly/goose/v3"
"github.com/piiano/goose/v3"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion examples/go-migrations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ $ ./goose-custom sqlite3 ./foo.db status
```go
import (
// Invoke init() functions within migrations pkg.
_ "github.com/pressly/goose/example/migrations-go"
_ "github.com/piiano/goose/example/migrations-go"
)
```
3 changes: 2 additions & 1 deletion examples/go-migrations/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (
"log"
"os"

"github.com/pressly/goose/v3"
_ "modernc.org/sqlite"

"github.com/piiano/goose/v3"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion globals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"database/sql"
"testing"

"github.com/pressly/goose/v3/internal/check"
"github.com/piiano/goose/v3/internal/check"
)

func TestNewGoMigration(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/pressly/goose/v3
module github.com/piiano/goose/v3

go 1.20
go 1.21

require (
github.com/ClickHouse/clickhouse-go/v2 v2.17.0
Expand Down
108 changes: 108 additions & 0 deletions go.sum

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion goose_cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import (
"testing"
"time"

"github.com/pressly/goose/v3/internal/check"
_ "modernc.org/sqlite"

"github.com/piiano/goose/v3/internal/check"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions goose_embed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"path/filepath"
"testing"

"github.com/pressly/goose/v3"
"github.com/pressly/goose/v3/internal/check"
"github.com/piiano/goose/v3"
"github.com/piiano/goose/v3/internal/check"
_ "modernc.org/sqlite"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/dialect/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"time"

"github.com/pressly/goose/v3/internal/dialect/dialectquery"
"github.com/piiano/goose/v3/internal/dialect/dialectquery"
)

// Store is the interface that wraps the basic methods for a database dialect.
Expand Down
2 changes: 1 addition & 1 deletion internal/migrationstats/migration_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"io"

"github.com/pressly/goose/v3/internal/sqlparser"
"github.com/piiano/goose/v3/internal/sqlparser"
)

type sqlMigration struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/migrationstats/migrationstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"path/filepath"

"github.com/pressly/goose/v3"
"github.com/piiano/goose/v3"
)

// FileWalker walks all files for GatherStats.
Expand Down
20 changes: 10 additions & 10 deletions internal/migrationstats/migrationstats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"testing"

"github.com/pressly/goose/v3/internal/check"
"github.com/piiano/goose/v3/internal/check"
)

func TestParsingGoMigrations(t *testing.T) {
Expand Down Expand Up @@ -98,7 +98,7 @@ var (
import (
"database/sql"

"github.com/pressly/goose/v3"
"github.com/piiano/goose/v3"
)

func init() {
Expand All @@ -114,7 +114,7 @@ func down001(tx *sql.Tx) error { return nil }`
import (
"database/sql"

"github.com/pressly/goose/v3"
"github.com/piiano/goose/v3"
)

func init() {
Expand All @@ -128,7 +128,7 @@ func down002(tx *sql.Tx) error { return nil }`
import (
"database/sql"

"github.com/pressly/goose/v3"
"github.com/piiano/goose/v3"
)

func init() {
Expand All @@ -142,7 +142,7 @@ func up003(tx *sql.Tx) error { return nil }`
import (
"database/sql"

"github.com/pressly/goose/v3"
"github.com/piiano/goose/v3"
)

func init() {
Expand All @@ -155,7 +155,7 @@ var (
import (
"database/sql"

"github.com/pressly/goose/v3"
"github.com/piiano/goose/v3"
)

func init() {
Expand All @@ -171,7 +171,7 @@ func down001(db *sql.DB) error { return nil }`
import (
"database/sql"

"github.com/pressly/goose/v3"
"github.com/piiano/goose/v3"
)

func init() {
Expand All @@ -185,7 +185,7 @@ func down002(db *sql.DB) error { return nil }`
import (
"database/sql"

"github.com/pressly/goose/v3"
"github.com/piiano/goose/v3"
)

func init() {
Expand All @@ -199,7 +199,7 @@ func up003(db *sql.DB) error { return nil }`
import (
"database/sql"

"github.com/pressly/goose/v3"
"github.com/piiano/goose/v3"
)

func init() {
Expand All @@ -217,7 +217,7 @@ func init() {}`
import (
"database/sql"

"github.com/pressly/goose/v3"
"github.com/piiano/goose/v3"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions internal/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"
"testing/fstest"

"github.com/pressly/goose/v3/internal/check"
"github.com/pressly/goose/v3/internal/sqlparser"
"github.com/piiano/goose/v3/internal/check"
"github.com/piiano/goose/v3/internal/sqlparser"
)

func TestParseAllFromFS(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/sqlparser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"testing"

"github.com/pressly/goose/v3/internal/check"
"github.com/piiano/goose/v3/internal/check"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions lock/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"testing"
"time"

"github.com/pressly/goose/v3/internal/check"
"github.com/pressly/goose/v3/internal/testdb"
"github.com/pressly/goose/v3/lock"
"github.com/piiano/goose/v3/internal/check"
"github.com/piiano/goose/v3/internal/testdb"
"github.com/piiano/goose/v3/lock"
)

func TestPostgresSessionLocker(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"
"testing"

"github.com/pressly/goose/v3/internal/check"
"github.com/piiano/goose/v3/internal/check"
)

func TestMigrationSort(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"time"

"github.com/pressly/goose/v3/internal/sqlparser"
"github.com/piiano/goose/v3/internal/sqlparser"
)

// NewGoMigration creates a new Go migration.
Expand Down
5 changes: 3 additions & 2 deletions provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import (
"strings"
"sync"

"github.com/pressly/goose/v3/database"
"github.com/pressly/goose/v3/internal/sqlparser"
"go.uber.org/multierr"

"github.com/piiano/goose/v3/database"
"github.com/piiano/goose/v3/internal/sqlparser"
)

// Provider is a goose migration provider.
Expand Down
4 changes: 2 additions & 2 deletions provider_collect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"
"testing/fstest"

"github.com/pressly/goose/v3/database"
"github.com/pressly/goose/v3/internal/check"
"github.com/piiano/goose/v3/database"
"github.com/piiano/goose/v3/internal/check"
)

func TestCollectFileSources(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions provider_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"errors"
"fmt"

"github.com/pressly/goose/v3/database"
"github.com/pressly/goose/v3/lock"
"github.com/piiano/goose/v3/database"
"github.com/piiano/goose/v3/lock"
)

const (
Expand Down
7 changes: 4 additions & 3 deletions provider_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import (
"testing"
"testing/fstest"

"github.com/pressly/goose/v3"
"github.com/pressly/goose/v3/database"
"github.com/pressly/goose/v3/internal/check"
_ "modernc.org/sqlite"

"github.com/piiano/goose/v3"
"github.com/piiano/goose/v3/database"
"github.com/piiano/goose/v3/internal/check"
)

func TestNewProvider(t *testing.T) {
Expand Down
9 changes: 4 additions & 5 deletions provider_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
"strings"
"time"

"github.com/pressly/goose/v3/database"
"github.com/pressly/goose/v3/internal/sqlparser"
"go.uber.org/multierr"

"github.com/piiano/goose/v3/database"
"github.com/piiano/goose/v3/internal/sqlparser"
)

var (
Expand Down Expand Up @@ -313,9 +314,7 @@
p.mu.Unlock()
// Use a detached context to unlock the session. This is because the context passed to
// SessionLock may have been canceled, and we don't want to cancel the unlock.
//
// TODO(mf): use context.WithoutCancel added in go1.21
detachedCtx := context.Background()
detachedCtx := context.WithoutCancel(ctx)

Check failure on line 317 in provider_run.go

View workflow job for this annotation

GitHub Actions / Run unit tests (1.20, ubuntu-latest)

undefined: context.WithoutCancel

Check failure on line 317 in provider_run.go

View workflow job for this annotation

GitHub Actions / Run unit tests (1.20, ubuntu-latest)

undefined: context.WithoutCancel
return multierr.Append(l.SessionUnlock(detachedCtx, conn), conn.Close())
}
}
Expand Down
Loading
Loading