MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestCreateViewStatement_SQL

Function TestCreateViewStatement_SQL

pkg/sql/ast/sql_coverage_test.go:134–150  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

132}
133
134func TestCreateViewStatement_SQL(t *testing.T) {
135 stmt := &CreateViewStatement{
136 Name: "v1",
137 OrReplace: true,
138 Temporary: true,
139 IfNotExists: true,
140 Columns: []string{"a", "b"},
141 Query: &SelectStatement{Columns: []Expression{&Identifier{Name: "x"}}},
142 WithOption: "CHECK OPTION",
143 }
144 sql := stmt.SQL()
145 for _, want := range []string{"CREATE OR REPLACE TEMPORARY VIEW", "IF NOT EXISTS", "v1 (a, b) AS", "CHECK OPTION"} {
146 if !strings.Contains(sql, want) {
147 t.Errorf("missing %q in: %s", want, sql)
148 }
149 }
150}
151
152func TestCreateMaterializedViewStatement_SQL(t *testing.T) {
153 stmt := &CreateMaterializedViewStatement{

Callers

nothing calls this directly

Calls 2

SQLMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected