Documentation ¶
Index ¶
- type Cell
- type InsertStmt
- type MySQLConfig
- type MySQLConnection
- func (db *MySQLConnection) Close()
- func (db *MySQLConnection) Commit() *SQLError
- func (db *MySQLConnection) CreateMySQLHandler(table string) *MySQLHandler
- func (db *MySQLConnection) DumpByQuery(query string, tables ...string) ([]string, *SQLError)
- func (db *MySQLConnection) DumpTable(tableName, whereCond string, limit int) ([]string, *SQLError)
- func (db *MySQLConnection) ExecuteCall(procedureName string, params ...interface{}) (ResultSet, *SQLError)
- func (db *MySQLConnection) ExecuteInsert(query string, params ...interface{}) (int64, *SQLError)
- func (db *MySQLConnection) ExecuteUpdate(query string, params ...interface{}) (int64, *SQLError)
- func (db *MySQLConnection) Hash() uint32
- func (db *MySQLConnection) Insert(table string) *InsertStmt
- func (db *MySQLConnection) Replace(table string) *InsertStmt
- func (db *MySQLConnection) Rollback() *SQLError
- func (db *MySQLConnection) Select(query string, params ...interface{}) (ResultSet, *SQLError)
- func (db *MySQLConnection) SelectNative(query string, params ...interface{}) (*sql.Rows, *SQLError)
- func (db *MySQLConnection) String() string
- func (db *MySQLConnection) Transaction() *SQLError
- func (db *MySQLConnection) Update(table string) *UpdateStmt
- type MySQLConnectionPool
- type MySQLHandler
- type ResultSet
- func (rs *ResultSet) GetBytes(column interface{}) []byte
- func (rs *ResultSet) GetInt(column interface{}) int
- func (rs *ResultSet) GetLong(column interface{}) int64
- func (rs *ResultSet) GetMetaData() *ResultSetMetaData
- func (rs *ResultSet) GetString(column interface{}) string
- func (rs *ResultSet) MergeWith(rs2 ResultSet)
- func (rs *ResultSet) Next() bool
- func (rs *ResultSet) Print()
- func (rs *ResultSet) Size() int
- type ResultSetMetaData
- type Row
- type SQLError
- type SQLiteConnection
- func (con *SQLiteConnection) Close()
- func (con *SQLiteConnection) ExecuteInsert(query string, params ...interface{}) (int64, error)
- func (con *SQLiteConnection) ExecuteQuery(query string, params ...interface{}) (ResultSet, error)
- func (con *SQLiteConnection) ExecuteUpdate(query string, params ...interface{}) (int64, error)
- type UpdateStmt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InsertStmt ¶
type InsertStmt struct {
// contains filtered or unexported fields
}
//////////////////////////////////////////////////////////// /////////////////// INSERT & REPLACE /////////////////////// ////////////////////////////////////////////////////////////
func (*InsertStmt) Fields ¶
func (in *InsertStmt) Fields(fields ...string) *InsertStmt
func (*InsertStmt) ReturnGeneratedKey ¶
func (in *InsertStmt) ReturnGeneratedKey() int64
func (*InsertStmt) Run ¶
func (in *InsertStmt) Run() (int64, *SQLError)
func (*InsertStmt) String ¶
func (in *InsertStmt) String() string
func (*InsertStmt) Value ¶
func (in *InsertStmt) Value(values ...interface{}) *InsertStmt
type MySQLConfig ¶
////////////////// MySQLConfig ////////////////////////
func NewMySQLConfig ¶
func (*MySQLConfig) String ¶
func (conf *MySQLConfig) String() string
type MySQLConnection ¶
type MySQLConnection struct { Config *MySQLConfig // contains filtered or unexported fields }
///////////////// MySQLConnection //////////////////////
func CreateMySQLConnection ¶
func CreateMySQLConnection(config *MySQLConfig) (MySQLConnection, error)
func NewMySQLConnection ¶
func (*MySQLConnection) Close ¶
func (db *MySQLConnection) Close()
func (*MySQLConnection) Commit ¶
func (db *MySQLConnection) Commit() *SQLError
func (*MySQLConnection) CreateMySQLHandler ¶
func (db *MySQLConnection) CreateMySQLHandler(table string) *MySQLHandler
func (*MySQLConnection) DumpByQuery ¶
func (db *MySQLConnection) DumpByQuery(query string, tables ...string) ([]string, *SQLError)
//////////////////////////////////////////////////////////// ///////////////////// DUMPING DATA ///////////////////////// ////////////////////////////////////////////////////////////
func (*MySQLConnection) DumpTable ¶
func (db *MySQLConnection) DumpTable(tableName, whereCond string, limit int) ([]string, *SQLError)
func (*MySQLConnection) ExecuteCall ¶
func (db *MySQLConnection) ExecuteCall(procedureName string, params ...interface{}) (ResultSet, *SQLError)
func (*MySQLConnection) ExecuteInsert ¶
func (db *MySQLConnection) ExecuteInsert(query string, params ...interface{}) (int64, *SQLError)
func (*MySQLConnection) ExecuteUpdate ¶
func (db *MySQLConnection) ExecuteUpdate(query string, params ...interface{}) (int64, *SQLError)
func (*MySQLConnection) Hash ¶
func (db *MySQLConnection) Hash() uint32
func (*MySQLConnection) Insert ¶
func (db *MySQLConnection) Insert(table string) *InsertStmt
func (*MySQLConnection) Replace ¶
func (db *MySQLConnection) Replace(table string) *InsertStmt
func (*MySQLConnection) Rollback ¶
func (db *MySQLConnection) Rollback() *SQLError
func (*MySQLConnection) Select ¶
func (db *MySQLConnection) Select(query string, params ...interface{}) (ResultSet, *SQLError)
returns ResutSet struct like an java object
func (*MySQLConnection) SelectNative ¶
func (db *MySQLConnection) SelectNative(query string, params ...interface{}) (*sql.Rows, *SQLError)
returns native *sql.Rows
func (*MySQLConnection) String ¶
func (db *MySQLConnection) String() string
func (*MySQLConnection) Transaction ¶
func (db *MySQLConnection) Transaction() *SQLError
func (*MySQLConnection) Update ¶
func (db *MySQLConnection) Update(table string) *UpdateStmt
type MySQLConnectionPool ¶
/////////////// MySQLConnectionPool ////////////////////
func NewMySQLConnectionPool ¶
func NewMySQLConnectionPool(size int, config *MySQLConfig) (*MySQLConnectionPool, error)
func (*MySQLConnectionPool) CloseAll ¶
func (pool *MySQLConnectionPool) CloseAll()
func (*MySQLConnectionPool) Get ¶
func (pool *MySQLConnectionPool) Get() *MySQLConnection
func (*MySQLConnectionPool) Release ¶
func (pool *MySQLConnectionPool) Release(connection *MySQLConnection)
func (*MySQLConnectionPool) Size ¶
func (pool *MySQLConnectionPool) Size() int
func (*MySQLConnectionPool) String ¶
func (pool *MySQLConnectionPool) String() string
type MySQLHandler ¶
type MySQLHandler struct {
// contains filtered or unexported fields
}
//////////////////////////////////////////////////////////// /////////////////////// HANDLER //////////////////////////// ////////////////////////////////////////////////////////////
func (*MySQLHandler) Close ¶
func (handler *MySQLHandler) Close()
func (*MySQLHandler) HasNext ¶
func (handler *MySQLHandler) HasNext() bool
type ResultSet ¶
type ResultSet struct { Rows []Row // contains filtered or unexported fields }
func (*ResultSet) GetMetaData ¶
func (rs *ResultSet) GetMetaData() *ResultSetMetaData
type ResultSetMetaData ¶
type ResultSetMetaData struct {
// contains filtered or unexported fields
}
func (*ResultSetMetaData) GetColumnCount ¶
func (rsmd *ResultSetMetaData) GetColumnCount() int
func (*ResultSetMetaData) GetColumnName ¶
func (rsmd *ResultSetMetaData) GetColumnName(i int) string
func (*ResultSetMetaData) GetColumnType ¶
func (rsmd *ResultSetMetaData) GetColumnType(i int) string
func (*ResultSetMetaData) Hash ¶
func (rsmd *ResultSetMetaData) Hash() uint32
type SQLiteConnection ¶
type SQLiteConnection struct {
// contains filtered or unexported fields
}
func NewSQLiteConnection ¶
func NewSQLiteConnection(path string) (*SQLiteConnection, error)
func (*SQLiteConnection) Close ¶
func (con *SQLiteConnection) Close()
func (*SQLiteConnection) ExecuteInsert ¶
func (con *SQLiteConnection) ExecuteInsert(query string, params ...interface{}) (int64, error)
returns last insert id or error
func (*SQLiteConnection) ExecuteQuery ¶
func (con *SQLiteConnection) ExecuteQuery(query string, params ...interface{}) (ResultSet, error)
returns ResutSet struct like an java object
func (*SQLiteConnection) ExecuteUpdate ¶
func (con *SQLiteConnection) ExecuteUpdate(query string, params ...interface{}) (int64, error)
returns affected rows count or error
type UpdateStmt ¶
type UpdateStmt struct {
// contains filtered or unexported fields
}
//////////////////////////////////////////////////////////// //////////////////////// UPDATE //////////////////////////// ////////////////////////////////////////////////////////////
func (*UpdateStmt) Limit ¶
func (up *UpdateStmt) Limit(limit int) *UpdateStmt
func (*UpdateStmt) Run ¶
func (up *UpdateStmt) Run() (int64, *SQLError)
func (*UpdateStmt) SetField ¶
func (up *UpdateStmt) SetField(fName string, fValue interface{}) *UpdateStmt
func (*UpdateStmt) String ¶
func (up *UpdateStmt) String() string
func (*UpdateStmt) WhereField ¶
func (up *UpdateStmt) WhereField(fName string, fValue interface{}) *UpdateStmt