MCPcopy Create free account
hub / github.com/sql-machine-learning/sqlflow / TestIsQuery

Function TestIsQuery

go/executor/sql_stmt_test.go:65–81  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestIsQuery(t *testing.T) {
66 a := assert.New(t)
67 a.True(isQuery("select * from iris.iris"))
68 a.True(isQuery("-- comment some thing\nselect * from iris.iris"))
69 a.True(isQuery("show create table iris.iris"))
70 a.True(isQuery("show databases"))
71 a.True(isQuery("show tables"))
72 a.True(isQuery("describe iris.iris"))
73 a.True(isQuery("desc iris.iris"))
74 a.True(isQuery("explain select 1"))
75
76 a.False(isQuery("select * from iris.iris limit 10 into iris.tmp"))
77 a.False(isQuery("insert into iris.iris values ..."))
78 a.False(isQuery("delete from iris.iris where ..."))
79 a.False(isQuery("update iris.iris where ..."))
80 a.False(isQuery("drop table"))
81}
82
83func TestParseTableColumn(tg *testing.T) {
84 a := assert.New(tg)

Callers

nothing calls this directly

Calls 1

isQueryFunction · 0.85

Tested by

no test coverage detected