mysql

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

nolint:gocognit

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExist        = errors.New("exist")
	ErrNotExist     = errors.New("not exist")
	ErrNotSupported = errors.New("not supported")
	ErrInvalid      = errors.New("invalid")
	ErrNotEqual     = errors.New("not equal")
)

Functions

func NewAlterCollectionWith added in v1.0.0

func NewAlterCollectionWith(schema *query.Schema) (document.Schema, error)

NewAlterCollectionWith creates an alter schema from the specified schema object.

func NewCollectionWith added in v0.9.0

func NewCollectionWith(schema *query.Schema) (document.Schema, error)

NewCollectionWith creates a new schema from the specified schema object.

func NewElementWith

func NewElementWith(col *query.ColumnDefinition) (document.Element, error)

NewIndexWith creates an index from the specified index object.

func NewIndexWith

func NewIndexWith(s document.Schema, def *query.IndexDefinition) (document.Index, error)

NewIndexWith creates an index from the specified coulumn definition.

func NewKeyFromCond

func NewKeyFromCond(dbName string, schema document.Schema, cond *query.Condition) (store.Key, document.IndexType, error)

NewKeyFromCond returns a key for the specified condition.

func NewLimitWith added in v1.0.0

func NewLimitWith(limit *query.Limit) []store.Option

NewLimitWith returns a new store option with the specified limit option.

func NewObjectFromInsert

func NewObjectFromInsert(dbName string, schema document.Schema, stmt *query.Insert) (document.Key, document.MapObject, error)

NewObjectFromInsert returns a new object from the specified schema and columns.

func NewOrderWith added in v1.0.0

func NewOrderWith(orderBy query.OrderBy) []store.Option

NewOrderWith returns a new store option with the specified orderby option.

func NewPrimaryIndexWith

func NewPrimaryIndexWith(elem document.Element) (document.Index, error)

NewPrimaryIndexWith creates an index from the specified element.

func NewResultFrom

func NewResultFrom(dbName string, schema document.Schema, objs []document.Object) (*mysql.Result, error)

NewResultFrom returns a successful result with the specified parameters.

func NewService

func NewService() query.Service

NewService returns a new MySQL service.

func NewValueFrom

func NewValueFrom(elem document.Element, val any) (mysql.Value, error)

Types

type Service

type Service struct {
	*mysql.BaseExecutor
	*mysql.Server
	*sql.Service
}

Service represents a new MySQL service instance.

func (*Service) AlterDatabase

func (service *Service) AlterDatabase(conn *mysql.Conn, stmt *query.Database) (*mysql.Result, error)

AlterDatabase should handle a ALTER database statement.

func (*Service) AlterTable

func (service *Service) AlterTable(conn *mysql.Conn, stmt *query.Schema) (*mysql.Result, error)

AlterTable should handle a ALTER table statement.

func (*Service) Begin added in v1.1.0

func (service *Service) Begin(conn *mysql.Conn, stmt *query.Begin) (*mysql.Result, error)

Begin should handle a BEGIN statement.

func (*Service) Commit added in v1.1.0

func (service *Service) Commit(conn *mysql.Conn, stmt *query.Commit) (*mysql.Result, error)

Commit should handle a COMMIT statement.

func (*Service) CreateDatabase

func (service *Service) CreateDatabase(conn *mysql.Conn, stmt *query.Database) (*mysql.Result, error)

CreateDatabase should handle a CREATE database statement.

func (*Service) CreateTable

func (service *Service) CreateTable(conn *mysql.Conn, stmt *query.Schema) (*mysql.Result, error)

CreateTable should handle a CREATE table statement.

func (*Service) Delete

func (service *Service) Delete(conn *mysql.Conn, stmt *query.Delete) (*mysql.Result, error)

Delete should handle a DELETE statement.

func (*Service) DropDatabase

func (service *Service) DropDatabase(conn *mysql.Conn, stmt *query.Database) (*mysql.Result, error)

DropDatabase should handle a DROP database statement.

func (*Service) DropTable

func (service *Service) DropTable(conn *mysql.Conn, stmt *query.Schema) (*mysql.Result, error)

DropTable should handle a DROP table statement.

func (*Service) Insert

func (service *Service) Insert(conn *mysql.Conn, stmt *query.Insert) (*mysql.Result, error)

Insert should handle a INSERT statement.

func (*Service) RenameTable

func (service *Service) RenameTable(conn *mysql.Conn, stmt *query.Schema) (*mysql.Result, error)

RenameTable should handle a RENAME table statement.

func (*Service) Rollback added in v1.1.0

func (service *Service) Rollback(conn *mysql.Conn, stmt *query.Rollback) (*mysql.Result, error)

Rollback should handle a ROLLBACK statement.

func (*Service) Select

func (service *Service) Select(conn *mysql.Conn, stmt *query.Select) (*mysql.Result, error)

Select should handle a SELECT statement.

func (*Service) ServiceName

func (service *Service) ServiceName() string

ServiceName returns the plug-in service name.

func (*Service) ShowDatabases

func (service *Service) ShowDatabases(conn *mysql.Conn) (*mysql.Result, error)

ShowDatabases should handle a SHOW DATABASES statement.

func (*Service) ShowTables

func (service *Service) ShowTables(conn *mysql.Conn, database string) (*mysql.Result, error)

ShowTables should handle a SHOW TABLES statement.

func (*Service) Start

func (service *Service) Start() error

Start starts the service.

func (*Service) Stop

func (service *Service) Stop() error

Stop stops the service.

func (*Service) TruncateTable

func (service *Service) TruncateTable(conn *mysql.Conn, stmt *query.Schema) (*mysql.Result, error)

TruncateTable should handle a TRUNCATE table statement.

func (*Service) Update

func (service *Service) Update(conn *mysql.Conn, stmt *query.Update) (*mysql.Result, error)

Update should handle a UPDATE statement.

Jump to

Keyboard shortcuts

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