Skip to content

Commit

Permalink
Refactor SQL Generation Logic
Browse files Browse the repository at this point in the history
* Created new `sqlgen` module to encapsulate sql generation
    * Broke SQLDialect inti new SQL generators for each statement type.
* Test refactor
    * Moved to a test case pattern to allow for quickly adding new test cases.
  • Loading branch information
doug-martin committed Aug 22, 2019
1 parent d982df1 commit defcda9
Show file tree
Hide file tree
Showing 37 changed files with 6,466 additions and 7,638 deletions.
9 changes: 8 additions & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
## 8.4.0

* Created new `sqlgen` module to encapsulate sql generation
* Broke SQLDialect inti new SQL generators for each statement type.
* Test refactor
* Moved to a test case pattern to allow for quickly adding new test cases.

## v8.3.2

* [FIXED] Data race during query factory initialisation [#133](https://github.com/doug-martin/goqu/issues/133) and [#136](https://github.com/doug-martin/goqu/issues/136) - [@o1egl](https://github.com/o1egl)
* [FIXED] Data race during query factory initialization [#133](https://github.com/doug-martin/goqu/issues/133) and [#136](https://github.com/doug-martin/goqu/issues/136) - [@o1egl](https://github.com/o1egl)

## 8.3.1

Expand Down
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ignore:
- "**/mocks/**" # glob accepted
- "mocks/**" # glob accepted
5 changes: 4 additions & 1 deletion delete_dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ package goqu
import (
"github.com/doug-martin/goqu/v8/exec"
"github.com/doug-martin/goqu/v8/exp"
"github.com/doug-martin/goqu/v8/internal/errors"
"github.com/doug-martin/goqu/v8/internal/sb"
)

var errBadFromArgument = errors.New("unsupported DeleteDataset#From argument, a string or identifier expression is required")

type DeleteDataset struct {
dialect SQLDialect
clauses exp.DeleteClauses
Expand Down Expand Up @@ -108,7 +111,7 @@ func (dd *DeleteDataset) From(table interface{}) *DeleteDataset {
case string:
return dd.copy(dd.clauses.SetFrom(exp.ParseIdentifier(t)))
default:
panic("unsupported table type, a string or identifier expression is required")
panic(errBadFromArgument)
}
}

Expand Down
Loading

0 comments on commit defcda9

Please sign in to comment.