exec

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateTableQueryExecutor

type CreateTableQueryExecutor struct {
	*QueryExecutorBase
}

CreateTableQueryExecutor inherits QueryExecutorBase structure

func NewCreateTableQueryExecutor

func NewCreateTableQueryExecutor(base *QueryExecutorBase) *CreateTableQueryExecutor

NewCreateTableQueryExecutor creates instance of CreateTableQueryExecutor

func (*CreateTableQueryExecutor) Exec

Exec executes `CREATE TABLE` DDL for shards.

func (*CreateTableQueryExecutor) Query

func (e *CreateTableQueryExecutor) Query() ([]*sql.Rows, error)

Query doesn't support in CreateTableQueryExecutor, returns always error.

func (*CreateTableQueryExecutor) QueryRow

func (e *CreateTableQueryExecutor) QueryRow() (*sql.Row, error)

QueryRow doesn't support in CreateTableQueryExecutor, returns always error.

type DeleteQueryExecutor

type DeleteQueryExecutor struct {
	*QueryExecutorBase
}

DeleteQueryExecutor inherits QueryExecutorBase structure

func NewDeleteQueryExecutor

func NewDeleteQueryExecutor(base *QueryExecutorBase) *DeleteQueryExecutor

NewDeleteQueryExecutor creates instance of DeleteQueryExecutor

func (*DeleteQueryExecutor) Exec

func (e *DeleteQueryExecutor) Exec() (sql.Result, error)

Exec executes DELETE query for shards.

func (*DeleteQueryExecutor) Query

func (e *DeleteQueryExecutor) Query() ([]*sql.Rows, error)

Query doesn't support in DeleteQueryExecutor, returns always error.

func (*DeleteQueryExecutor) QueryRow

func (e *DeleteQueryExecutor) QueryRow() (*sql.Row, error)

QueryRow doesn't support in DeleteQueryExecutor, returns always error.

type DropQueryExecutor

type DropQueryExecutor struct {
	*QueryExecutorBase
}

DropQueryExecutor inherits QueryExecutorBase structure

func NewDropQueryExecutor

func NewDropQueryExecutor(base *QueryExecutorBase) *DropQueryExecutor

NewDropQueryExecutor creates instance of DropQueryExecutor

func (*DropQueryExecutor) Exec

func (e *DropQueryExecutor) Exec() (sql.Result, error)

Exec executes `DROP TABLE` DDL for shards

func (*DropQueryExecutor) Query

func (e *DropQueryExecutor) Query() ([]*sql.Rows, error)

Query doesn't support in DropQueryExecutor, returns always error.

func (*DropQueryExecutor) QueryRow

func (e *DropQueryExecutor) QueryRow() (*sql.Row, error)

QueryRow doesn't support in DropQueryExecutor, returns always error.

type InsertQueryExecutor

type InsertQueryExecutor struct {
	*QueryExecutorBase
}

InsertQueryExecutor inherits QueryExecutorBase structure

func NewInsertQueryExecutor

func NewInsertQueryExecutor(base *QueryExecutorBase) *InsertQueryExecutor

NewInsertQueryExecutor creates instance of InsertQueryExecutor

func (*InsertQueryExecutor) Exec

func (e *InsertQueryExecutor) Exec() (sql.Result, error)

Exec executes INSERT query for shards.

func (*InsertQueryExecutor) Query

func (e *InsertQueryExecutor) Query() ([]*sql.Rows, error)

Query doesn't support in InsertQueryExecutor, returns always error.

func (*InsertQueryExecutor) QueryRow

func (e *InsertQueryExecutor) QueryRow() (*sql.Row, error)

QueryRow doesn't support in InsertQueryExecutor, returns always error.

type QueryExecutor

type QueryExecutor interface {
	Query() ([]*sql.Rows, error)
	QueryRow() (*sql.Row, error)
	Prepare() (*sql.Stmt, error)
	Stmt() (*sql.Stmt, error)
	Exec() (sql.Result, error)
}

QueryExecutor the interface for executing query to shards

func NewQueryExecutor

NewQueryExecutor creates instance of QueryExecutor interface. If specify unknown query type, returns nil

type QueryExecutorBase

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

QueryExecutorBase a implementation of QueryExecutor interface.

func (*QueryExecutorBase) Prepare

func (e *QueryExecutorBase) Prepare() (*sql.Stmt, error)

Prepare executes prepare for shards. Currently, this is not supported.

func (*QueryExecutorBase) Stmt

func (e *QueryExecutorBase) Stmt() (*sql.Stmt, error)

Stmt executes stmt for shards. Currently, this is not supported.

type SelectQueryExecutor

type SelectQueryExecutor struct {
	*QueryExecutorBase
}

SelectQueryExecutor inherits QueryExecutorBase structure

func NewSelectQueryExecutor

func NewSelectQueryExecutor(base *QueryExecutorBase) *SelectQueryExecutor

NewSelectQueryExecutor creates instance of SelectQueryExecutor

func (*SelectQueryExecutor) Exec

func (e *SelectQueryExecutor) Exec() (sql.Result, error)

Exec doesn't support in SelectQueryExecutor, returns always error.

func (*SelectQueryExecutor) Query

func (e *SelectQueryExecutor) Query() ([]*sql.Rows, error)

Query select multiple rows for shards.

func (*SelectQueryExecutor) QueryRow

func (e *SelectQueryExecutor) QueryRow() (*sql.Row, error)

QueryRow select row from single shard.

type ShowQueryExecutor

type ShowQueryExecutor struct {
	*QueryExecutorBase
}

ShowQueryExecutor inherits QueryExecutorBase structure

func NewShowQueryExecutor

func NewShowQueryExecutor(base *QueryExecutorBase) *ShowQueryExecutor

NewShowQueryExecutor creates instance of ShowQueryExecutor

func (*ShowQueryExecutor) Exec

func (e *ShowQueryExecutor) Exec() (sql.Result, error)

Exec doesn't support in ShowQueryExecutor, returns always error.

func (*ShowQueryExecutor) Query

func (e *ShowQueryExecutor) Query() ([]*sql.Rows, error)

Query show multiple rows from any one of shards.

func (*ShowQueryExecutor) QueryRow

func (e *ShowQueryExecutor) QueryRow() (*sql.Row, error)

QueryRow show row from any one of shards.

type TruncateQueryExecutor

type TruncateQueryExecutor struct {
	*QueryExecutorBase
}

TruncateQueryExecutor inherits QueryExecutorBase structure

func NewTruncateQueryExecutor

func NewTruncateQueryExecutor(base *QueryExecutorBase) *TruncateQueryExecutor

NewTruncateQueryExecutor creates instance of TruncateQueryExecutor

func (*TruncateQueryExecutor) Exec

func (e *TruncateQueryExecutor) Exec() (sql.Result, error)

Exec executes `TRUNCATE TABLE` DDL for shards.

func (*TruncateQueryExecutor) Query

func (e *TruncateQueryExecutor) Query() ([]*sql.Rows, error)

Query doesn't support in TruncateQueryExecutor, returns always error.

func (*TruncateQueryExecutor) QueryRow

func (e *TruncateQueryExecutor) QueryRow() (*sql.Row, error)

QueryRow doesn't support in TruncateQueryExecutor, returns always error.

type UpdateQueryExecutor

type UpdateQueryExecutor struct {
	*QueryExecutorBase
}

UpdateQueryExecutor inherits QueryExecutorBase structure

func NewUpdateQueryExecutor

func NewUpdateQueryExecutor(base *QueryExecutorBase) *UpdateQueryExecutor

NewUpdateQueryExecutor creates instance of UpdateQueryExecutor

func (*UpdateQueryExecutor) Exec

func (e *UpdateQueryExecutor) Exec() (sql.Result, error)

Exec executes UPDATE query for shards.

func (*UpdateQueryExecutor) Query

func (e *UpdateQueryExecutor) Query() ([]*sql.Rows, error)

Query doesn't support in UpdateQueryExecutor, returns always error.

func (*UpdateQueryExecutor) QueryRow

func (e *UpdateQueryExecutor) QueryRow() (*sql.Row, error)

QueryRow doesn't support in UpdateQueryExecutor, returns always error.

Jump to

Keyboard shortcuts

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