func (s *ShowCreateDatabase) Resolved() bool {
	_, ok := s.db.(sql.UnresolvedDatabase)
	return !ok
}
Resolved implements the sql.Node interface.
package plan
import (
	"bytes"
	"fmt"
	"github.com/src-d/go-mysql-server/sql"
)
type ShowCreateDatabase struct {
	db          sql.Database
	IfNotExists bool
}
const defaultCharacterSet = "utf8mb4"
var showCreateDatabaseSchema = sql.Schema{
	{Name: "Database", Type: sql.Text},
	{Name: "Create Database", Type: sql.Text},
}
func NewShowCreateDatabase(db sql.Database, ifNotExists bool) *ShowCreateDatabase {
	return &ShowCreateDatabase{db, ifNotExists}
}
var _ sql.Databaser = (*ShowCreateDatabase)(nil)
func (s *ShowCreateDatabase) Database() sql.Database {
	return s.db
}
func (s *ShowCreateDatabase) WithDatabase(db sql.Database) (sql.Node, error) {
	nc := *s
	nc.db = db
	return &nc, nil
}
func (s *ShowCreateDatabase) RowIter(ctx *sql.Context) (sql.RowIter, error) {
	var name = s.db.Name()
	var buf bytes.Buffer
	buf.WriteString("CREATE DATABASE ")
	if s.IfNotExists {
		buf.WriteString("/*!32312 IF NOT EXISTS*/ ")
	}
	buf.WriteRune('`')
	buf.WriteString(name)
	buf.WriteRune('`')
	buf.WriteString(fmt.Sprintf(
		" /*!40100 DEFAULT CHARACTER SET %s COLLATE %s */",
		defaultCharacterSet,
		defaultCollation,
	))
	return sql.RowsToRowIter(
		sql.NewRow(name, buf.String()),
	), nil
}
func (s *ShowCreateDatabase) Schema() sql.Schema {
	return showCreateDatabaseSchema
}
func (s *ShowCreateDatabase) String() string {
	return fmt.Sprintf("SHOW CREATE DATABASE %s", s.db.Name())
}
func (s *ShowCreateDatabase) Children() []sql.Node { return nil }