Documentation ¶
Index ¶
- type Database
- type Databases
- type MemStore
- func (store *MemStore) AlterDatabase(conn *mysql.Conn, stmt *query.Database) (*mysql.Result, error)
- func (store *MemStore) AlterTable(conn *mysql.Conn, stmt *query.Schema) (*mysql.Result, error)
- func (store *MemStore) Begin(conn *mysql.Conn, stmt *query.Begin) (*mysql.Result, error)
- func (store *MemStore) Commit(conn *mysql.Conn, stmt *query.Commit) (*mysql.Result, error)
- func (store *MemStore) CreateDatabase(conn *mysql.Conn, stmt *query.Database) (*mysql.Result, error)
- func (store *MemStore) CreateTable(conn *mysql.Conn, stmt *query.Schema) (*mysql.Result, error)
- func (store *MemStore) Delete(conn *mysql.Conn, stmt *query.Delete) (*mysql.Result, error)
- func (store *MemStore) DropDatabase(conn *mysql.Conn, stmt *query.Database) (*mysql.Result, error)
- func (store *MemStore) DropTable(conn *mysql.Conn, stmt *query.Schema) (*mysql.Result, error)
- func (store *MemStore) Insert(conn *mysql.Conn, stmt *query.Insert) (*mysql.Result, error)
- func (store *MemStore) RenameTable(conn *mysql.Conn, stmt *query.Schema) (*mysql.Result, error)
- func (store *MemStore) Rollback(conn *mysql.Conn, stmt *query.Rollback) (*mysql.Result, error)
- func (store *MemStore) Select(conn *mysql.Conn, stmt *query.Select) (*mysql.Result, error)
- func (store *MemStore) ShowDatabases(conn *mysql.Conn) (*mysql.Result, error)
- func (store *MemStore) ShowTables(conn *mysql.Conn, database string) (*mysql.Result, error)
- func (store *MemStore) TruncateTable(conn *mysql.Conn, stmt *query.Schema) (*mysql.Result, error)
- func (store *MemStore) Update(conn *mysql.Conn, stmt *query.Update) (*mysql.Result, error)
- type Row
- type Rows
- type Schema
- type Table
- func (tbl *Table) Delete(cond *query.Condition) (int, error)
- func (tbl *Table) DeleteAll() int
- func (tbl *Table) Dump()
- func (tbl *Table) Insert(row *Row) error
- func (tbl *Table) Name() string
- func (tbl *Table) Select(cond *query.Condition) (*Rows, error)
- func (tbl *Table) SetSchema(schema *Schema)
- func (tbl *Table) String() string
- func (tbl *Table) Update(columns *query.Columns, cond *query.Condition) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
Database represents a destination or source database of query.
func NewDatabaseWithName ¶
NewDatabaseWithName returns a new database with the specified string.
type Databases ¶
Databases represents a collection of databases.
func (Databases) AddDatabase ¶
AddDatabase adds a specified database.
func (Databases) DropDatabase ¶
DropDatabase remove the specified database.
func (Databases) GetDatabase ¶
GetDatabase returns a database with the specified name.
type MemStore ¶
type MemStore struct { *mysql.BaseExecutor Databases }
func (*MemStore) AlterDatabase ¶
AlterDatabase should handle a ALTER database statement.
func (*MemStore) AlterTable ¶
AlterTable should handle a ALTER table statement.
func (*MemStore) CreateDatabase ¶
func (store *MemStore) CreateDatabase(conn *mysql.Conn, stmt *query.Database) (*mysql.Result, error)
CreateDatabase should handle a CREATE database statement.
func (*MemStore) CreateTable ¶
CreateTable should handle a CREATE table statement.
func (*MemStore) DropDatabase ¶
DropDatabase should handle a DROP database statement.
func (*MemStore) RenameTable ¶
RenameTable should handle a RENAME table statement.
func (*MemStore) ShowDatabases ¶
ShowDatabases should handle a SHOW DATABASES statement.
func (*MemStore) ShowTables ¶
ShowTables should handle a SHOW TABLES statement.
func (*MemStore) TruncateTable ¶
TruncateTable should handle a TRUNCATE table statement.
type Table ¶
type Table struct { sync.Mutex *query.Schema *query.Rows // contains filtered or unexported fields }
Table represents a destination or source database of query.
func NewTableWith ¶ added in v1.0.4
NewTableWith returns a new database with the specified string.
func (*Table) Select ¶
Select returns only matched and projected rows by the specified conditions and the columns.