MCPcopy Create free account
hub / github.com/kataras/iris / CreateDatabase

Method CreateDatabase

_examples/database/mysql/sql/mysql.go:46–50  ·  view source on GitHub ↗

CreateDatabase executes the CREATE DATABASE query.

(database string)

Source from the content-addressed store, hash-verified

44
45// CreateDatabase executes the CREATE DATABASE query.
46func (db *MySQL) CreateDatabase(database string) error {
47 q := fmt.Sprintf("CREATE DATABASE %s DEFAULT CHARSET = %s COLLATE = %s;", database, DefaultCharset, DefaultCollation)
48 _, err := db.Conn.Exec(q)
49 return err
50}
51
52// Drop executes the DROP DATABASE query.
53func (db *MySQL) Drop(database string) error {

Callers

nothing calls this directly

Calls 1

ExecMethod · 0.65

Tested by

no test coverage detected