mirror of https://github.com/VinGarcia/ksql.git
Fix error that did not ignore fields with no ksql tags on QueryOne
The original attempt of fixing this problem was on commit:
e970a3546a
pull/10/head
parent
d9f9d27266
commit
487e2aa6ac
5
ksql.go
5
ksql.go
|
@ -1130,6 +1130,11 @@ func buildSelectQueryForPlainStructs(
|
|||
) string {
|
||||
var fields []string
|
||||
for i := 0; i < structType.NumField(); i++ {
|
||||
structInfo := info.ByIndex(i)
|
||||
if !structInfo.Valid {
|
||||
continue
|
||||
}
|
||||
|
||||
fields = append(fields, dialect.Escape(info.ByIndex(i).Name))
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@ type User struct {
|
|||
Age int `ksql:"age"`
|
||||
|
||||
Address Address `ksql:"address,json"`
|
||||
|
||||
// This attr has no ksql tag, thus, it should be ignored:
|
||||
AttrThatShouldBeIgnored string
|
||||
}
|
||||
|
||||
var UsersTable = NewTable("users")
|
||||
|
|
Loading…
Reference in New Issue