// GetTables returns name of all tables in the specified schema
GetTables returns name of all tables in the specified schema
// GetTables returns name of all tables in the specified schema
func GetTables(ctx context.Context, db *sql.DB, schemaName string) ([]string, error) {
	rs, err := db.QueryContext(ctx, fmt.Sprintf("SHOW TABLES IN `%s`;", schemaName))
	if err != nil {
		return nil, errors.Trace(err)
	}
	defer rs.Close()
	var tbls []string
	for rs.Next() {
		var name string
		err := rs.Scan(&name)
		if err != nil {
			return nil, errors.Trace(err)
		}
		tbls = append(tbls, name)
	}
	return tbls, nil
}
func GetTables ( ctx context . Context , db * sql . DB , schemaName string ) ( [ ] string , error ) { rs , err := db . QueryContext ( ctx , fmt . Sprintf ( " " , schemaName ) ) if err != nil { return nil , errors . Trace ( err ) } defer rs . Close ( ) var tbls [ ] string for rs . Next ( ) { var name string err := rs . Scan ( & name ) if err != nil { return nil , errors . Trace ( err ) } tbls = append ( tbls , name ) } return tbls , nil }
GetTables returns name of all tables in the specified schema
GetTables returns name of all tables in the specified schema