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

Function TestCreateTableStatement_AllFeatures

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

Source from the content-addressed store, hash-verified

748}
749
750func TestCreateTableStatement_AllFeatures(t *testing.T) {
751 stmt := &CreateTableStatement{
752 Name: "t",
753 Temporary: true,
754 IfNotExists: true,
755 Columns: []ColumnDef{{Name: "id", Type: "INT"}},
756 Inherits: []string{"parent"},
757 PartitionBy: &PartitionBy{Type: "RANGE", Columns: []string{"created_at"}},
758 Options: []TableOption{{Name: "engine", Value: "InnoDB"}},
759 }
760 sql := stmt.SQL()
761 for _, want := range []string{"CREATE TEMPORARY TABLE IF NOT EXISTS", "INHERITS (parent)", "PARTITION BY RANGE", "engine=InnoDB"} {
762 if !strings.Contains(sql, want) {
763 t.Errorf("missing %q in: %s", want, sql)
764 }
765 }
766}
767
768func TestLateralTableRef(t *testing.T) {
769 stmt := &SelectStatement{

Callers

nothing calls this directly

Calls 2

SQLMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected