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

Function TestForSQL

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

Source from the content-addressed store, hash-verified

425}
426
427func TestForSQL(t *testing.T) {
428 stmt := &SelectStatement{
429 Columns: []Expression{&Identifier{Name: "x"}},
430 From: []TableReference{{Name: "t"}},
431 For: &ForClause{
432 LockType: "UPDATE",
433 Tables: []string{"t"},
434 NoWait: true,
435 SkipLocked: true,
436 },
437 }
438 sql := stmt.SQL()
439 for _, want := range []string{"FOR UPDATE", "OF t", "NOWAIT", "SKIP LOCKED"} {
440 if !strings.Contains(sql, want) {
441 t.Errorf("missing %q in: %s", want, sql)
442 }
443 }
444}
445
446func TestTableConstraintSQL(t *testing.T) {
447 // Via CreateTableStatement

Callers

nothing calls this directly

Calls 2

SQLMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected