MCPcopy Create free account
hub / github.com/actiontech/dtle / ShowCreateTable

Function ShowCreateTable

driver/mysql/sql/sqlutils.go:430–441  ·  view source on GitHub ↗
(ctx context.Context, db QueryAble, dbName, tbName string)

Source from the content-addressed store, hash-verified

428}
429
430func ShowCreateTable(ctx context.Context, db QueryAble, dbName, tbName string) (r string, err error) {
431 query := fmt.Sprintf("SHOW CREATE TABLE %s.%s", mysqlconfig.EscapeName(dbName), mysqlconfig.EscapeName(tbName))
432 g.Logger.Debug("ShowCreateTable", "query", query)
433 row := db.QueryRowContext(ctx, query)
434 var dummy interface{}
435 // | Table | Create Table |
436 err = row.Scan(&dummy, &r)
437 if err != nil {
438 return "", errors.Wrap(err, "ShowCreateTable")
439 }
440 return r, nil
441}

Callers

nothing calls this directly

Calls 3

EscapeNameFunction · 0.92
QueryRowContextMethod · 0.80
ScanMethod · 0.80

Tested by

no test coverage detected