Skip to content

Commit 4021788

Browse files
author
xinbg
committed
fix parse conditions not trimmed
1 parent 9d08a68 commit 4021788

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"dynamo.cli/executors"
1212
"dynamo.cli/sqlparser"
1313
"dynamo.cli/tables"
14-
// "github.com/bcicen/grmon"
1514
"github.com/briandowns/spinner"
1615
prompt "github.com/c-bata/go-prompt"
1716
"golang.org/x/net/context"

sqlparser/parse.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ func switchCondition(condition, nextLogicalOperator string) Condition {
114114
if strings.Contains(condition, op) {
115115
tokens := strings.Split(condition, op)
116116
return Condition{
117-
Key: tokens[0],
117+
Key: strings.TrimSpace(tokens[0]),
118118
Operator: op,
119-
Value: tokens[1],
119+
Value: strings.TrimSpace(tokens[1]),
120120
NextLogicalOperator: nextLogicalOperator,
121121
}
122122
}

0 commit comments

Comments
 (0)