From efc0c8ebe32e9b34bbe3f8c09afb0f081a9c5068 Mon Sep 17 00:00:00 2001 From: Zach Musgrave Date: Tue, 16 Jul 2019 17:27:33 -0700 Subject: [PATCH] Added support for explain statements, fixed a short description --- go/cmd/dolt/commands/sql.go | 7 ++++--- go/cmd/dolt/commands/sqlserver/sqlserver.go | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go/cmd/dolt/commands/sql.go b/go/cmd/dolt/commands/sql.go index 6884ee2e321..03de2faaa40 100644 --- a/go/cmd/dolt/commands/sql.go +++ b/go/cmd/dolt/commands/sql.go @@ -45,13 +45,14 @@ Reasonably well supported functionality: * ALTER TABLE / DROP TABLE statements * UPDATE and DELETE statements * Table and column aliases +* Column functions, e.g. CONCAT * ORDER BY and LIMIT clauses +* GROUP BY +* Aggregate functions, e.g. SUM Known limitations: * Some expressions in SELECT statements -* GROUP BY or aggregate functions * Subqueries -* Column functions, e.g. CONCAT * Non-primary indexes * Foreign keys * Column constraints besides NOT NULL @@ -275,7 +276,7 @@ func processQuery(query string, dEnv *env.DoltEnv, root *doltdb.RootValue) (*dol switch s := sqlStatement.(type) { case *sqlparser.Show: return nil, sqlShow(root, s) - case *sqlparser.Select: + case *sqlparser.Select, *sqlparser.OtherRead: sqlSch, rowIter, err := sqlNewEngine(query, root) if err == nil { err = prettyPrintResults(sqlSch, rowIter) diff --git a/go/cmd/dolt/commands/sqlserver/sqlserver.go b/go/cmd/dolt/commands/sqlserver/sqlserver.go index 368cbeffbe3..4812f4fd3b2 100644 --- a/go/cmd/dolt/commands/sqlserver/sqlserver.go +++ b/go/cmd/dolt/commands/sqlserver/sqlserver.go @@ -18,8 +18,8 @@ const ( logLevelFlag = "loglevel" ) -var sqlServerShortDesc = "Starts a MySQL-compatible server." -var sqlServerLongDesc = `Starts a MySQL-compatible server which can be connected to by MySQL clients. +var sqlServerShortDesc = "Start a MySQL-compatible server." +var sqlServerLongDesc = `Start a MySQL-compatible server which can be connected to by MySQL clients. Currently, only SELECT statements are operational, as support for other statements is still being developed.