Improve sql query error messages

This commit is contained in:
Tobie Morgan Hitchcock 2016-11-01 22:57:27 +00:00
parent 7e9c595ff7
commit 4db1bbe944
3 changed files with 3 additions and 3 deletions

View file

@ -36,7 +36,7 @@ func (e *executor) executeCreateStatement(txn kvs.TX, ast *sql.CreateStatement)
switch what := w.(type) {
default:
return out, fmt.Errorf("Can not execute CREATE query using type '%T'", what)
return out, fmt.Errorf("Can not execute CREATE query using value '%v' with type '%T'", what, what)
case *sql.Thing:
key := &keys.Thing{KV: ast.KV, NS: ast.NS, DB: ast.DB, TB: what.TB, ID: what.ID}

View file

@ -35,7 +35,7 @@ func (e *executor) executeDeleteStatement(txn kvs.TX, ast *sql.DeleteStatement)
switch what := w.(type) {
default:
return out, fmt.Errorf("Can not execute DELETE query using type '%T'", what)
return out, fmt.Errorf("Can not execute DELETE query using value '%v' with type '%T'", what, what)
case *sql.Thing:
key := &keys.Thing{KV: ast.KV, NS: ast.NS, DB: ast.DB, TB: what.TB, ID: what.ID}

View file

@ -35,7 +35,7 @@ func (e *executor) executeUpdateStatement(txn kvs.TX, ast *sql.UpdateStatement)
switch what := w.(type) {
default:
return out, fmt.Errorf("Can not execute UPDATE query using type '%T'", what)
return out, fmt.Errorf("Can not execute UPDATE query using value '%v' with type '%T'", what, what)
case *sql.Thing:
key := &keys.Thing{KV: ast.KV, NS: ast.NS, DB: ast.DB, TB: what.TB, ID: what.ID}