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

Function TestTruncateStatement_SQL

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

Source from the content-addressed store, hash-verified

73}
74
75func TestTruncateStatement_SQL(t *testing.T) {
76 stmt := &TruncateStatement{Tables: []string{"users"}, RestartIdentity: true, CascadeType: "CASCADE"}
77 sql := stmt.SQL()
78 if !strings.Contains(sql, "TRUNCATE TABLE users") || !strings.Contains(sql, "RESTART IDENTITY") {
79 t.Errorf("got: %s", sql)
80 }
81
82 stmt2 := &TruncateStatement{Tables: []string{"t"}, ContinueIdentity: true}
83 sql2 := stmt2.SQL()
84 if !strings.Contains(sql2, "CONTINUE IDENTITY") {
85 t.Errorf("got: %s", sql2)
86 }
87}
88
89func TestWithClause_SQL(t *testing.T) {
90 w := &WithClause{

Callers

nothing calls this directly

Calls 2

SQLMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected