Skip to content

Commit

Permalink
trim sql prefix space
Browse files Browse the repository at this point in the history
  • Loading branch information
mazrean committed Nov 30, 2024
1 parent 89cc3ea commit 1b9ffc5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dbdoc/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"path/filepath"
"regexp"
"strings"
"unicode"

"github.com/mazrean/isucrud/internal/pkg/list"
)
Expand Down Expand Up @@ -102,6 +103,8 @@ func extractSubQueries(_ *Context, sql string) []string {
}

func analyzeSQLWithoutSubQuery(ctx *Context, sqlValue string, pos token.Pos) []Query {
sqlValue = strings.TrimLeftFunc(sqlValue, unicode.IsSpace)

var queries []Query
switch {
case strings.HasPrefix(sqlValue, "select"):
Expand Down

0 comments on commit 1b9ffc5

Please sign in to comment.