Skip to content

Commit

Permalink
InsertBuilder should set string defaut for sqlx Select() (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
sim-wangyan committed Jul 15, 2024
1 parent 6bb2ea5 commit b691cbb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions builder_insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ func (b *InsertBuilder) Set(k string, v interface{}) *InsertBuilder {

switch v.(type) {
case string:
if v.(string) == "" {
return b
}
case uint64, uint, int64, int, int32, int16, int8, bool, byte, float64, float32:
if v == 0 {
return b
Expand Down
2 changes: 1 addition & 1 deletion builder_x.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package sqlxb

import "fmt"

// To build sql, like: SELECT DISTINCT f.id FROM foo f INNER_JOIN JOIN (SELECT foo_id FROM bar) b ON b.foo_id = f.id
// ToId build sql, like: SELECT DISTINCT f.id FROM foo f INNER_JOIN JOIN (SELECT foo_id FROM bar) b ON b.foo_id = f.id
// Sql for MySQL, Clickhouse....
//
// @author Sim
Expand Down
4 changes: 2 additions & 2 deletions to_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func (built *Built) countBuilder() *strings.Builder {

func (built *Built) SqlOfPage() (string, string, []interface{}, map[string]string) {
vs := []interface{}{}
km := make(map[string]string) //nil for sub From builder,
km := make(map[string]string) //nil for sub FromId builder,
dataSql, kmp := built.sqlData(&vs, km)
countSql := built.sqlCount()

Expand All @@ -275,7 +275,7 @@ func (built *Built) SqlOfPage() (string, string, []interface{}, map[string]strin

func (built *Built) SqlOfSelect() (string, []interface{}, map[string]string) {
vs := []interface{}{}
km := make(map[string]string) //nil for sub From builder,
km := make(map[string]string) //nil for sub FromId builder,
dataSql, kmp := built.sqlData(&vs, km)
return dataSql, vs, kmp
}
Expand Down

0 comments on commit b691cbb

Please sign in to comment.