Skip to content

Commit

Permalink
chore(popx): code simplification and refactoring (#816)
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik authored Nov 4, 2024
1 parent 934758e commit 52dce5e
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 484 deletions.
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ require (
github.com/lestrrat-go/jwx v1.2.29
github.com/lib/pq v1.10.9
github.com/luna-duclos/instrumentedsql v1.1.3
github.com/markbates/pkger v0.17.1
github.com/mattn/go-sqlite3 v1.14.16
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
github.com/ory/analytics-go/v5 v5.0.1
Expand Down Expand Up @@ -141,7 +140,6 @@ require (
github.com/gobuffalo/flect v1.0.0 // indirect
github.com/gobuffalo/github_flavored_markdown v1.1.3 // indirect
github.com/gobuffalo/helpers v0.6.7 // indirect
github.com/gobuffalo/here v0.6.7 // indirect
github.com/gobuffalo/nulls v0.4.2 // indirect
github.com/gobuffalo/plush/v4 v4.1.18 // indirect
github.com/gobuffalo/tags/v3 v3.1.4 // indirect
Expand Down
6 changes: 0 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,6 @@ github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSC
github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE=
github.com/gobuffalo/helpers v0.6.7 h1:C9CedoRSfgWg2ZoIkVXgjI5kgmSpL34Z3qdnzpfNVd8=
github.com/gobuffalo/helpers v0.6.7/go.mod h1:j0u1iC1VqlCaJEEVkZN8Ia3TEzfj/zoXANqyJExTMTA=
github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM=
github.com/gobuffalo/here v0.6.7 h1:hpfhh+kt2y9JLDfhYUxxCRxQol540jsVfKUZzjlbp8o=
github.com/gobuffalo/here v0.6.7/go.mod h1:vuCfanjqckTuRlqAitJz6QC4ABNnS27wLb816UhsPcc=
github.com/gobuffalo/httptest v1.5.2 h1:GpGy520SfY1QEmyPvaqmznTpG4gEQqQ82HtHqyNEreM=
github.com/gobuffalo/httptest v1.5.2/go.mod h1:FA23yjsWLGj92mVV74Qtc8eqluc11VqcWr8/C1vxt4g=
github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8=
Expand Down Expand Up @@ -568,8 +565,6 @@ github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE=
github.com/markbates/pkger v0.17.1 h1:/MKEtWqtc0mZvu9OinB9UzVN9iYCwLWuyUv4Bw+PCno=
github.com/markbates/pkger v0.17.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI=
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE=
github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU=
Expand Down Expand Up @@ -1326,7 +1321,6 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
Expand Down
30 changes: 0 additions & 30 deletions pkgerx/file.go

This file was deleted.

187 changes: 0 additions & 187 deletions pkgerx/migration_box.go

This file was deleted.

43 changes: 0 additions & 43 deletions pkgerx/migration_box_test.go

This file was deleted.

22 changes: 0 additions & 22 deletions pkgerx/sql_template_funcs.go

This file was deleted.

Empty file.
Empty file.
12 changes: 6 additions & 6 deletions popx/migration_box_gomigration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
"testing"
"time"

"github.com/pkg/errors"

"github.com/gobuffalo/pop/v6"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/ory/x/dbal"
"github.com/ory/x/logrusx"
"github.com/ory/x/popx"
)
Expand Down Expand Up @@ -78,7 +78,7 @@ func TestGoMigrations(t *testing.T) {
called = make([]time.Time, len(goMigrations))

c, err := pop.NewConnection(&pop.ConnectionDetails{
URL: "sqlite://file::memory:?_fk=true",
URL: dbal.NewSQLiteTestDatabase(t),
})
require.NoError(t, err)
require.NoError(t, c.Open())
Expand All @@ -101,7 +101,7 @@ func TestGoMigrations(t *testing.T) {

t.Run("tc=errs_on_missing_down_migration", func(t *testing.T) {
c, err := pop.NewConnection(&pop.ConnectionDetails{
URL: "sqlite://file::memory:?_fk=true",
URL: dbal.NewSQLiteTestDatabase(t),
})
require.NoError(t, err)
require.NoError(t, c.Open())
Expand All @@ -112,7 +112,7 @@ func TestGoMigrations(t *testing.T) {

t.Run("tc=runs everything in one transaction", func(t *testing.T) {
c, err := pop.NewConnection(&pop.ConnectionDetails{
URL: "sqlite://file::memory:?_fk=true",
URL: dbal.NewSQLiteTestDatabase(t),
})
require.NoError(t, err)
require.NoError(t, c.Open())
Expand Down Expand Up @@ -223,7 +223,7 @@ func TestIncompatibleRunners(t *testing.T) {

func TestNoTransaction(t *testing.T) {
c, err := pop.NewConnection(&pop.ConnectionDetails{
URL: "sqlite://file::memory:",
URL: dbal.NewSQLiteTestDatabase(t),
})
require.NoError(t, err)
require.NoError(t, c.Open())
Expand Down
Loading

0 comments on commit 52dce5e

Please sign in to comment.