Skip to content

Commit 51d8367

Browse files
author
Aaron Son
committed
Merge remote-tracking branch 'origin/ld-master' into aaron/views
2 parents d1ad601 + a207ac7 commit 51d8367

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3120
-1103
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ Makefile.main
3131
_example/main
3232
_example/*.exe
3333
test-server
34+
35+
.idea/*

engine.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,18 @@ func (e *Engine) Query(
153153
return analyzed.Schema(), iter, nil
154154
}
155155

156+
// Async returns true if the query is async. If there are any errors with the
157+
// query it returns false
158+
func (e *Engine) Async(ctx *sql.Context, query string) bool {
159+
parsed, err := parse.Parse(ctx, query)
160+
if err != nil {
161+
return false
162+
}
163+
164+
asyncNode, ok := parsed.(sql.AsyncNode)
165+
return ok && asyncNode.IsAsync()
166+
}
167+
156168
// AddDatabase adds the given database to the catalog.
157169
func (e *Engine) AddDatabase(db sql.Database) {
158170
e.Catalog.AddDatabase(db)

0 commit comments

Comments
 (0)