mysql

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReturnsRows

func ReturnsRows(statement string) bool

func Target

func Target(values driver.FormValues) string

Target builds the MySQL DSN for the connection form's server fields. tls is the TLS mode ("true", "skip-verify", "false"); blank falls back to the disabled mode. The workbench never formats DSNs itself: the grammar lives with the driver that parses it.

Types

type Factory added in v0.11.0

type Factory struct{}

func (Factory) BuildTarget added in v0.11.0

func (Factory) Capabilities added in v0.11.0

func (Factory) Capabilities() driver.Capabilities

func (Factory) Open added in v0.11.0

func (Factory) Open(ctx context.Context, target string) (driver.OpenResult, error)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func Open

func Open(ctx context.Context, dsn string) (*Service, error)

func (*Service) AddColumn

func (s *Service) AddColumn(ctx context.Context, table string, col driver.ColumnDef) error

func (*Service) AlterColumn

func (s *Service) AlterColumn(ctx context.Context, table string, change driver.ColumnChange) error

func (*Service) BrowseTable

func (s *Service) BrowseTable(ctx context.Context, name string, options driver.BrowseOptions) (driver.Result, error)

func (*Service) Close

func (s *Service) Close() error

func (*Service) CreateForeignKey

func (s *Service) CreateForeignKey(ctx context.Context, table string, change driver.ForeignKeyChange) error

func (*Service) CreateIndex

func (s *Service) CreateIndex(ctx context.Context, table string, change driver.IndexChange) error

func (*Service) DeleteRow

func (s *Service) DeleteRow(ctx context.Context, table string, key []driver.RowValue) (driver.Result, error)

DeleteRow removes the row identified by key. NULL key values become IS NULL predicates so NULL primary-key parts still match.

func (*Service) DropColumn

func (s *Service) DropColumn(ctx context.Context, table, name string) error

func (*Service) DropForeignKey

func (s *Service) DropForeignKey(ctx context.Context, table, previous string) error

func (*Service) DropIndex

func (s *Service) DropIndex(ctx context.Context, table, name string) error

func (*Service) Execute

func (s *Service) Execute(ctx context.Context, statement string) (result driver.Result, err error)

func (*Service) ExecuteReadOnly

func (s *Service) ExecuteReadOnly(ctx context.Context, statement string) (result driver.Result, err error)

func (*Service) Info

func (s *Service) Info() driver.DatabaseInfo

func (*Service) InsertRow

func (s *Service) InsertRow(ctx context.Context, table string, values []driver.RowValue) (driver.Result, error)

InsertRow inserts one row, binding values as parameters instead of quoting them by hand. ValueDefault columns are omitted so engine defaults and auto-increment apply; a row of pure defaults uses MySQL's empty-column-list syntax.

func (*Service) ListForeignKeys

func (s *Service) ListForeignKeys(ctx context.Context, table string) ([]driver.ForeignKeyInfo, error)

func (*Service) ListForeignKeysAll

func (s *Service) ListForeignKeysAll(ctx context.Context) (map[string][]driver.ForeignKeyInfo, error)

ListForeignKeysAll returns every foreign key in the connected server, keyed by the declaring table's qualified name (database.table), with the referenced table qualified the same way — mirroring PostgreSQL's bulk map. Unlike the per-table queries it does not depend on the DSN's default database (which may be empty or differ from the tables the user browses), so it scans every non-system schema instead.

func (*Service) ListIndexes

func (s *Service) ListIndexes(ctx context.Context, table string) ([]driver.IndexInfo, error)

func (*Service) ListIndexesAll

func (s *Service) ListIndexesAll(ctx context.Context) (map[string][]driver.IndexInfo, error)

ListIndexesAll returns every index in the connected server, keyed by the indexed table's qualified name (database.table). It scans every non-system schema instead of relying on the DSN's default database, so diagrams keep their cardinality data no matter which database the user browses — matching how PostgreSQL keys its bulk maps.

func (*Service) ListReferencingForeignKeys

func (s *Service) ListReferencingForeignKeys(ctx context.Context, table string) ([]driver.ReferencingForeignKeyInfo, error)

func (*Service) ListSchema

func (s *Service) ListSchema(ctx context.Context) ([]driver.SchemaObject, error)

func (*Service) ReplaceForeignKey

func (s *Service) ReplaceForeignKey(ctx context.Context, table, previous string, change driver.ForeignKeyChange) error

func (*Service) ReplaceIndex

func (s *Service) ReplaceIndex(ctx context.Context, table, previous string, change driver.IndexChange) error

func (*Service) TableInfo

func (s *Service) TableInfo(ctx context.Context, name string) ([]driver.ColumnInfo, error)

func (*Service) UpdateRow

func (s *Service) UpdateRow(ctx context.Context, table string, key []driver.RowValue, values []driver.RowValue) (driver.Result, error)

UpdateRow sets the given columns on the row identified by key. A ValueDefault update value is rejected: DEFAULT is an insert-only state.

func (*Service) Validate

func (s *Service) Validate(ctx context.Context, statement string) error

Validate prepares the statement against the open database without executing it, so syntax and schema errors surface without any side effects.

func (*Service) WriteCapabilities

func (s *Service) WriteCapabilities() driver.WriteCapabilities

WriteCapabilities reports the SQL row-write capability; the mysql driver has no document store.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL