Skip to content

Commit

Permalink
fix(core): error on empty query
Browse files Browse the repository at this point in the history
  • Loading branch information
kndndrj committed Apr 23, 2024
1 parent 940d726 commit 205cd25
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dbee/core/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"strings"

"github.com/google/uuid"
)
Expand Down Expand Up @@ -102,6 +103,9 @@ func (c *Connection) GetParams() *ConnectionParams {

func (c *Connection) Execute(query string, onEvent func(CallState, *Call)) *Call {
exec := func(ctx context.Context) (ResultStream, error) {
if strings.TrimSpace(query) == "" {
return nil, errors.New("empty query")
}
return c.driver.Query(ctx, query)
}

Expand Down

0 comments on commit 205cd25

Please sign in to comment.