Documentation
¶
Index ¶
- func ReturnsRows(statement string) bool
- func Target(values driver.FormValues) string
- type Factory
- type Service
- func (s *Service) AddColumn(ctx context.Context, table string, col driver.ColumnDef) error
- func (s *Service) AlterColumn(ctx context.Context, table string, change driver.ColumnChange) error
- func (s *Service) BrowseTable(ctx context.Context, name string, options driver.BrowseOptions) (driver.Result, error)
- func (s *Service) Close() error
- func (s *Service) CreateForeignKey(ctx context.Context, table string, change driver.ForeignKeyChange) error
- func (s *Service) CreateIndex(ctx context.Context, table string, change driver.IndexChange) error
- func (s *Service) DeleteRow(ctx context.Context, table string, key []driver.RowValue) (driver.Result, error)
- func (s *Service) DropColumn(ctx context.Context, table, name string) error
- func (s *Service) DropForeignKey(ctx context.Context, table, previous string) error
- func (s *Service) DropIndex(ctx context.Context, table, name string) error
- func (s *Service) Execute(ctx context.Context, statement string) (result driver.Result, err error)
- func (s *Service) ExecuteReadOnly(ctx context.Context, statement string) (result driver.Result, err error)
- func (s *Service) Info() driver.DatabaseInfo
- func (s *Service) InsertRow(ctx context.Context, table string, values []driver.RowValue) (driver.Result, error)
- func (s *Service) ListForeignKeys(ctx context.Context, table string) ([]driver.ForeignKeyInfo, error)
- func (s *Service) ListForeignKeysAll(ctx context.Context) (map[string][]driver.ForeignKeyInfo, error)
- func (s *Service) ListIndexes(ctx context.Context, table string) ([]driver.IndexInfo, error)
- func (s *Service) ListIndexesAll(ctx context.Context) (map[string][]driver.IndexInfo, error)
- func (s *Service) ListReferencingForeignKeys(ctx context.Context, table string) ([]driver.ReferencingForeignKeyInfo, error)
- func (s *Service) ListSchema(ctx context.Context) ([]driver.SchemaObject, error)
- func (s *Service) ReplaceForeignKey(ctx context.Context, table, previous string, change driver.ForeignKeyChange) error
- func (s *Service) ReplaceIndex(ctx context.Context, table, previous string, change driver.IndexChange) error
- func (s *Service) TableInfo(ctx context.Context, name string) ([]driver.ColumnInfo, error)
- func (s *Service) UpdateRow(ctx context.Context, table string, key []driver.RowValue, ...) (driver.Result, error)
- func (s *Service) Validate(ctx context.Context, statement string) error
- func (s *Service) WriteCapabilities() driver.WriteCapabilities
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReturnsRows ¶
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) BuildTarget(_ context.Context, values driver.FormValues) (driver.BuildTargetResult, error)
func (Factory) Capabilities ¶ added in v0.11.0
func (Factory) Capabilities() driver.Capabilities
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) AlterColumn ¶
func (*Service) BrowseTable ¶
func (*Service) CreateForeignKey ¶
func (*Service) CreateIndex ¶
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 (*Service) DropForeignKey ¶
func (*Service) ExecuteReadOnly ¶
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 (*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 (*Service) ListIndexesAll ¶
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 (*Service) ListSchema ¶
func (*Service) ReplaceForeignKey ¶
func (*Service) ReplaceIndex ¶
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 ¶
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.