Documentation
¶
Overview ¶
Package mysql is meta.Metadata on top of MySQL 8 (go-mysql-org/go-mysql: pure Go and the protocol fields in full: flags, charset, length, which database/sql does not expose).
It mirrors Connector/J 8.4 with default settings (client-side prepare):
- result columns are found out by running the query with NULL instead of '?' and a limit of one row; non-SELECT statements (INSERT, UPDATE, ...) have no metadata;
- CALL is executed too (Connector/J does so), here in a transaction that is rolled back;
- parameter types are java.lang.Object, except for CALL: a procedure declares them;
- tables, keys and indexes come from information_schema of the current database.
Index ¶
- func ConnParams(jdbcURL, user, pwd string) (addr, db, u, p string, err error)
- type DB
- func (db *DB) Close() error
- func (db *DB) Exec(sql string) error
- func (db *DB) IdentifierQuote() string
- func (db *DB) ImportedKeys(table string) ([]meta.ImportedKey, error)
- func (db *DB) PKColNames(tableRef string) ([]string, error)
- func (db *DB) RawOfJava(javaType string) string
- func (db *DB) SQLColumns(jdbcSQL string) ([]meta.Column, error)
- func (db *DB) SQLParams(jdbcSQL string, typeCount int) (*meta.Params, error)
- func (db *DB) Table(tableRef string) (*meta.Table, error)
- func (db *DB) Tables(includeViews bool) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnParams ¶
ConnParams returns the address, database, user and password from jdbc:mysql://host[:port]/db or mysql://...
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) IdentifierQuote ¶ added in v1.1.2
IdentifierQuote: as getIdentifierQuoteString of Connector/J.
func (*DB) ImportedKeys ¶
func (db *DB) ImportedKeys(table string) ([]meta.ImportedKey, error)
Click to show internal directories.
Click to hide internal directories.