Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Commit

Permalink
feat: parse query function for execution
Browse files Browse the repository at this point in the history
  • Loading branch information
kehiy committed Nov 16, 2023
1 parent 1ef6dcf commit dfd50f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ import (
func ParseQuery(query string) database.Query {
command := ""
args := []string{}

for _, word := range strings.Split(query, " ") {
if word == "" {
continue
}

if command != "" {
args = append(args, word)
} else {
command = word
}
}

return database.Query{Command: command, Args: args}
}

Expand Down

0 comments on commit dfd50f7

Please sign in to comment.