Add support for Update statements.

This commit is contained in:
zer0sub 2019-04-14 17:55:10 +02:00
parent b287521f1a
commit 70d6f84375
12 changed files with 422 additions and 286 deletions

View file

@ -6,7 +6,6 @@ import (
"github.com/dropbox/godropbox/errors"
"github.com/sub0zero/go-sqlbuilder/sqlbuilder/execution"
"github.com/sub0zero/go-sqlbuilder/types"
"reflect"
)
type SelectStatement interface {
@ -88,12 +87,6 @@ func (s *selectStatementImpl) AsTable(alias string) *SelectStatementTable {
}
func (s *selectStatementImpl) Execute(db types.Db, destination interface{}) error {
destinationType := reflect.TypeOf(destination)
if destinationType.Kind() == reflect.Ptr && destinationType.Elem().Kind() == reflect.Struct {
s.Limit(1)
}
query, err := s.String()
if err != nil {