MCPcopy
hub / github.com/gogf/gf / dropTable

Function dropTable

contrib/drivers/dm/dm_z_unit_init_test.go:117–132  ·  view source on GitHub ↗
(table string)

Source from the content-addressed store, hash-verified

115}
116
117func dropTable(table string) {
118 count, err := db.GetCount(
119 ctx,
120 "SELECT COUNT(*) FROM all_tables WHERE owner = ? And table_name= ?", TestDBName, strings.ToUpper(table),
121 )
122 if err != nil {
123 gtest.Fatal(err)
124 }
125
126 if count == 0 {
127 return
128 }
129 if _, err := db.Exec(ctx, fmt.Sprintf("DROP TABLE %s", table)); err != nil {
130 gtest.Fatal(err)
131 }
132}
133
134func createTable(table ...string) (name string) {
135 if len(table) > 0 {

Calls 3

FatalFunction · 0.92
GetCountMethod · 0.65
ExecMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…