Documentation ¶
Index ¶
- func DeleteSQL(txtTable string, txtWhere string) string
- func InsertSQL(txtTable string, jsoData *jsons.JSONObject) string
- func Quote(str string) string
- func SelectSQL(txtTable string, txtColumn string, txtWhere string, txtSort string, ...) string
- func UpdateSQL(txtTable string, jsoData *jsons.JSONObject, txtWhere string) string
- type EsconCX
- type EsconDB
- func (me *EsconDB) Begin() (*EsconTX, error)
- func (me *EsconDB) Close() error
- func (me *EsconDB) CountRow(txtTable string, txtWhere string) (int, error)
- func (me *EsconDB) DeleteRow(txtTable string, txtWhere string) (*jsons.JSONObject, error)
- func (me *EsconDB) Exec(txtSQL string) (*jsons.JSONObject, error)
- func (me *EsconDB) Exist(txtSQL string) (bool, error)
- func (me *EsconDB) ExistRow(txtTable string, txtWhere string) (bool, error)
- func (me *EsconDB) Fetch(txtSQL string) (*jsons.JSONObject, error)
- func (me *EsconDB) FetchRow(txtTable string, txtColumn string, txtWhere string) (*jsons.JSONObject, error)
- func (me *EsconDB) InsertRow(txtTable string, jsoData *jsons.JSONObject) (*jsons.JSONObject, error)
- func (me *EsconDB) ORM(txtPrimaryKeyName string, txtForeignKeyPrefix string) *EsconORM
- func (me *EsconDB) Ping() error
- func (me *EsconDB) Query(txtSQL string) (*jsons.JSONArray, error)
- func (me *EsconDB) RawDataToJSONObject(arrColumns []string, arrColumTypes []*sql.ColumnType, rawDatas []interface{}) *jsons.JSONObject
- func (me *EsconDB) SelectRow(txtTable string, txtColumn string, txtWhere string, txtSort string, ...) (*jsons.JSONArray, error)
- func (me *EsconDB) UpdateRow(txtTable string, jsoData *jsons.JSONObject, txtWhere string) (*jsons.JSONObject, error)
- type EsconORM
- type EsconORMRow
- func (me *EsconORMRow) Belong(txtLocalKey string, txtRefTable string, txtColumn string) (*EsconORMTable, error)
- func (me *EsconORMRow) CheckKey(txtKey string) bool
- func (me *EsconORMRow) Child(txtRefKey string, txtRefTable string, txtColumn string, txtSort string, ...) (*EsconORMTable, error)
- func (me *EsconORMRow) Delete(txtKey string) *EsconORMRow
- func (me *EsconORMRow) FromString(txtJSON string) error
- func (me *EsconORMRow) GetArray(txtKey string) *jsons.JSONArray
- func (me *EsconORMRow) GetBool(txtKey string) bool
- func (me *EsconORMRow) GetFloat(txtKey string) float64
- func (me *EsconORMRow) GetInt(txtKey string) int
- func (me *EsconORMRow) GetKeys(txtKey string) []string
- func (me *EsconORMRow) GetNull(txtKey string) interface{}
- func (me *EsconORMRow) GetObject(txtKey string) *jsons.JSONObject
- func (me *EsconORMRow) GetObjectData() *collection.MapKey
- func (me *EsconORMRow) GetString(txtKey string) string
- func (me *EsconORMRow) GetType(txtKey string) string
- func (me *EsconORMRow) HasKey(txtKey string) bool
- func (me *EsconORMRow) PutArray(txtKey string, jsaValue *jsons.JSONArray) *EsconORMRow
- func (me *EsconORMRow) PutBool(txtKey string, blnValue bool) *EsconORMRow
- func (me *EsconORMRow) PutFloat(txtKey string, dblValue float64) *EsconORMRow
- func (me *EsconORMRow) PutInt(txtKey string, intValue int) *EsconORMRow
- func (me *EsconORMRow) PutNull(txtKey string) *EsconORMRow
- func (me *EsconORMRow) PutObject(txtKey string, jsoValue *jsons.JSONObject) *EsconORMRow
- func (me *EsconORMRow) PutString(txtKey string, txtValue string) *EsconORMRow
- func (me *EsconORMRow) Remove(txtKey string) *EsconORMRow
- func (me *EsconORMRow) ToJSONObject() *jsons.JSONObject
- func (me *EsconORMRow) ToString() string
- type EsconORMTable
- func (me *EsconORMTable) Begin()
- func (me *EsconORMTable) Check(txtWhere string) (bool, error)
- func (me *EsconORMTable) CheckByID(varID interface{}) (bool, error)
- func (me *EsconORMTable) Count(txtWhere string) (int, error)
- func (me *EsconORMTable) Delete(ormRow *EsconORMRow) (*jsons.JSONObject, error)
- func (me *EsconORMTable) DeleteByID(varID interface{}) (*jsons.JSONObject, error)
- func (me *EsconORMTable) DeleteByJSON(jsoData *jsons.JSONObject) (*jsons.JSONObject, error)
- func (me *EsconORMTable) Exist(txtWhere string) (bool, error)
- func (me *EsconORMTable) ExistByID(varID interface{}) (bool, error)
- func (me *EsconORMTable) Fetch(txtColumn string, txtWhere string) (*EsconORMRow, error)
- func (me *EsconORMTable) FetchByID(txtColumn string, varID interface{}) (*EsconORMRow, error)
- func (me *EsconORMTable) FetchRow() (int, *EsconORMRow)
- func (me *EsconORMTable) Find(txtColumn, txtWhere string, txtSort string, intOffset int, intLimit int) error
- func (me *EsconORMTable) FindByID(txtColumn string, varID interface{}) (*EsconORMRow, error)
- func (me *EsconORMTable) GetRow(intIndex int) *EsconORMRow
- func (me *EsconORMTable) Insert(ormRow *EsconORMRow) (*jsons.JSONObject, error)
- func (me *EsconORMTable) InsertByID(varID interface{}, ormRow *EsconORMRow) (*jsons.JSONObject, error)
- func (me *EsconORMTable) InsertByIDJSON(varID interface{}, jsoData *jsons.JSONObject) (*jsons.JSONObject, error)
- func (me *EsconORMTable) InsertByJSON(jsoData *jsons.JSONObject) (*jsons.JSONObject, error)
- func (me *EsconORMTable) Length() int
- func (me *EsconORMTable) NewRow(varID interface{}, jsoData *jsons.JSONObject) *EsconORMRow
- func (me *EsconORMTable) Next() bool
- func (me *EsconORMTable) ToJSONArray() *jsons.JSONArray
- func (me *EsconORMTable) ToJSONObject() *jsons.JSONObject
- func (me *EsconORMTable) Update(ormRow *EsconORMRow) (*jsons.JSONObject, error)
- func (me *EsconORMTable) UpdateByID(varID interface{}, ormRow *EsconORMRow) (*jsons.JSONObject, error)
- func (me *EsconORMTable) UpdateByIDJSON(varID interface{}, jsoData *jsons.JSONObject) (*jsons.JSONObject, error)
- func (me *EsconORMTable) UpdateByJSON(jsoData *jsons.JSONObject) (*jsons.JSONObject, error)
- type EsconTX
- func (me *EsconTX) Commit() error
- func (me *EsconTX) CountRow(txtTable string, txtWhere string) (int, error)
- func (me *EsconTX) DeleteRow(txtTable string, txtWhere string) (*jsons.JSONObject, error)
- func (me *EsconTX) Exec(txtSQL string) (*jsons.JSONObject, error)
- func (me *EsconTX) Exist(txtSQL string) (bool, error)
- func (me *EsconTX) ExistRow(txtTable string, txtWhere string) (bool, error)
- func (me *EsconTX) Fetch(txtSQL string) (*jsons.JSONObject, error)
- func (me *EsconTX) FetchRow(txtTable string, txtColumn string, txtWhere string) (*jsons.JSONObject, error)
- func (me *EsconTX) InsertRow(txtTable string, jsoData *jsons.JSONObject) (*jsons.JSONObject, error)
- func (me *EsconTX) ORM(txtPrimaryKeyName string, txtForeignKeyPrefix string) *EsconORM
- func (me *EsconTX) Query(txtSQL string) (*jsons.JSONArray, error)
- func (me *EsconTX) Rollback() error
- func (me *EsconTX) SelectRow(txtTable string, txtColumn string, txtWhere string, txtSort string, ...) (*jsons.JSONArray, error)
- func (me *EsconTX) UpdateRow(txtTable string, jsoData *jsons.JSONObject, txtWhere string) (*jsons.JSONObject, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InsertSQL ¶
func InsertSQL(txtTable string, jsoData *jsons.JSONObject) string
InsertSQL is automatic build insert sql
Types ¶
type EsconCX ¶ added in v0.1.2
type EsconCX interface { ORM(txtPrimaryKeyName string, txtForeignKeyPrefix string) *EsconORM Query(txtSQL string) (*jsons.JSONArray, error) Exec(txtSQL string) (*jsons.JSONObject, error) Fetch(txtSQL string) (*jsons.JSONObject, error) Exist(txtSQL string) (bool, error) SelectRow(txtTable string, txtColumn string, txtWhere string, txtSort string, intOffset int, intLimit int) (*jsons.JSONArray, error) InsertRow(txtTable string, jsoData *jsons.JSONObject) (*jsons.JSONObject, error) UpdateRow(txtTable string, jsoData *jsons.JSONObject, txtWhere string) (*jsons.JSONObject, error) DeleteRow(txtTable string, txtWhere string) (*jsons.JSONObject, error) FetchRow(txtTable string, txtColumn string, txtWhere string) (*jsons.JSONObject, error) ExistRow(txtTable string, txtWhere string) (bool, error) CountRow(txtTable string, txtWhere string) (int, error) }
EsconCX is interface of DB and TX
type EsconDB ¶ added in v0.1.2
type EsconDB struct { DB *sql.DB Type string Host string Port int Username string Password string Database string }
EsconDB is connection object
func Connect ¶
func Connect(txtType string, txtHost string, intPort int, txtUsername string, txtPassword string, txtDBName string) (*EsconDB, error)
Connect is create ESConDB object
func (*EsconDB) Exec ¶ added in v0.1.2
func (me *EsconDB) Exec(txtSQL string) (*jsons.JSONObject, error)
Exec is run single sql and return effect number data
func (*EsconDB) Fetch ¶ added in v0.1.2
func (me *EsconDB) Fetch(txtSQL string) (*jsons.JSONObject, error)
Fetch is run single sql and return first data row
func (*EsconDB) FetchRow ¶ added in v0.1.2
func (me *EsconDB) FetchRow(txtTable string, txtColumn string, txtWhere string) (*jsons.JSONObject, error)
FetchRow is get first select data row from database
func (*EsconDB) InsertRow ¶ added in v0.1.2
func (me *EsconDB) InsertRow(txtTable string, jsoData *jsons.JSONObject) (*jsons.JSONObject, error)
InsertRow is insert data data to database
func (*EsconDB) RawDataToJSONObject ¶ added in v0.1.2
func (me *EsconDB) RawDataToJSONObject(arrColumns []string, arrColumTypes []*sql.ColumnType, rawDatas []interface{}) *jsons.JSONObject
RawDataToJSONObject is fill data to json object
func (*EsconDB) SelectRow ¶ added in v0.1.2
func (me *EsconDB) SelectRow(txtTable string, txtColumn string, txtWhere string, txtSort string, intOffset int, intLimit int) (*jsons.JSONArray, error)
SelectRow is select data row from database
func (*EsconDB) UpdateRow ¶ added in v0.1.2
func (me *EsconDB) UpdateRow(txtTable string, jsoData *jsons.JSONObject, txtWhere string) (*jsons.JSONObject, error)
UpdateRow is updata data in database
type EsconORM ¶ added in v0.1.2
EsconORM is Object relation mapping
func (*EsconORM) Table ¶ added in v0.1.2
func (me *EsconORM) Table(txtName string) *EsconORMTable
type EsconORMRow ¶ added in v0.1.2
type EsconORMRow struct { TABLE *EsconORMTable JSOData *jsons.JSONObject }
func (*EsconORMRow) Belong ¶ added in v0.1.2
func (me *EsconORMRow) Belong(txtLocalKey string, txtRefTable string, txtColumn string) (*EsconORMTable, error)
func (*EsconORMRow) CheckKey ¶ added in v0.1.2
func (me *EsconORMRow) CheckKey(txtKey string) bool
func (*EsconORMRow) Child ¶ added in v0.1.2
func (me *EsconORMRow) Child(txtRefKey string, txtRefTable string, txtColumn string, txtSort string, intOffset int, intLimit int) (*EsconORMTable, error)
func (*EsconORMRow) Delete ¶ added in v0.1.2
func (me *EsconORMRow) Delete(txtKey string) *EsconORMRow
func (*EsconORMRow) FromString ¶ added in v0.1.2
func (me *EsconORMRow) FromString(txtJSON string) error
func (*EsconORMRow) GetArray ¶ added in v0.1.2
func (me *EsconORMRow) GetArray(txtKey string) *jsons.JSONArray
func (*EsconORMRow) GetBool ¶ added in v0.1.2
func (me *EsconORMRow) GetBool(txtKey string) bool
func (*EsconORMRow) GetFloat ¶ added in v0.1.2
func (me *EsconORMRow) GetFloat(txtKey string) float64
func (*EsconORMRow) GetInt ¶ added in v0.1.2
func (me *EsconORMRow) GetInt(txtKey string) int
func (*EsconORMRow) GetKeys ¶ added in v0.1.2
func (me *EsconORMRow) GetKeys(txtKey string) []string
func (*EsconORMRow) GetNull ¶ added in v0.1.2
func (me *EsconORMRow) GetNull(txtKey string) interface{}
func (*EsconORMRow) GetObject ¶ added in v0.1.2
func (me *EsconORMRow) GetObject(txtKey string) *jsons.JSONObject
func (*EsconORMRow) GetObjectData ¶ added in v0.1.2
func (me *EsconORMRow) GetObjectData() *collection.MapKey
func (*EsconORMRow) GetString ¶ added in v0.1.2
func (me *EsconORMRow) GetString(txtKey string) string
func (*EsconORMRow) GetType ¶ added in v0.1.2
func (me *EsconORMRow) GetType(txtKey string) string
func (*EsconORMRow) HasKey ¶ added in v0.1.2
func (me *EsconORMRow) HasKey(txtKey string) bool
func (*EsconORMRow) PutArray ¶ added in v0.1.2
func (me *EsconORMRow) PutArray(txtKey string, jsaValue *jsons.JSONArray) *EsconORMRow
func (*EsconORMRow) PutBool ¶ added in v0.1.2
func (me *EsconORMRow) PutBool(txtKey string, blnValue bool) *EsconORMRow
func (*EsconORMRow) PutFloat ¶ added in v0.1.2
func (me *EsconORMRow) PutFloat(txtKey string, dblValue float64) *EsconORMRow
func (*EsconORMRow) PutInt ¶ added in v0.1.2
func (me *EsconORMRow) PutInt(txtKey string, intValue int) *EsconORMRow
func (*EsconORMRow) PutNull ¶ added in v0.1.2
func (me *EsconORMRow) PutNull(txtKey string) *EsconORMRow
func (*EsconORMRow) PutObject ¶ added in v0.1.2
func (me *EsconORMRow) PutObject(txtKey string, jsoValue *jsons.JSONObject) *EsconORMRow
func (*EsconORMRow) PutString ¶ added in v0.1.2
func (me *EsconORMRow) PutString(txtKey string, txtValue string) *EsconORMRow
func (*EsconORMRow) Remove ¶ added in v0.1.3
func (me *EsconORMRow) Remove(txtKey string) *EsconORMRow
func (*EsconORMRow) ToJSONObject ¶ added in v0.1.4
func (me *EsconORMRow) ToJSONObject() *jsons.JSONObject
func (*EsconORMRow) ToString ¶ added in v0.1.2
func (me *EsconORMRow) ToString() string
type EsconORMTable ¶ added in v0.1.2
func (*EsconORMTable) Check ¶ added in v0.1.2
func (me *EsconORMTable) Check(txtWhere string) (bool, error)
func (*EsconORMTable) CheckByID ¶ added in v0.1.5
func (me *EsconORMTable) CheckByID(varID interface{}) (bool, error)
func (*EsconORMTable) Count ¶ added in v0.1.2
func (me *EsconORMTable) Count(txtWhere string) (int, error)
func (*EsconORMTable) Delete ¶ added in v0.1.2
func (me *EsconORMTable) Delete(ormRow *EsconORMRow) (*jsons.JSONObject, error)
func (*EsconORMTable) DeleteByID ¶ added in v0.1.2
func (me *EsconORMTable) DeleteByID(varID interface{}) (*jsons.JSONObject, error)
func (*EsconORMTable) DeleteByJSON ¶ added in v0.1.2
func (me *EsconORMTable) DeleteByJSON(jsoData *jsons.JSONObject) (*jsons.JSONObject, error)
func (*EsconORMTable) Exist ¶ added in v0.1.2
func (me *EsconORMTable) Exist(txtWhere string) (bool, error)
func (*EsconORMTable) ExistByID ¶ added in v0.1.5
func (me *EsconORMTable) ExistByID(varID interface{}) (bool, error)
func (*EsconORMTable) Fetch ¶ added in v0.1.2
func (me *EsconORMTable) Fetch(txtColumn string, txtWhere string) (*EsconORMRow, error)
func (*EsconORMTable) FetchByID ¶ added in v0.1.2
func (me *EsconORMTable) FetchByID(txtColumn string, varID interface{}) (*EsconORMRow, error)
func (*EsconORMTable) FetchRow ¶ added in v0.1.9
func (me *EsconORMTable) FetchRow() (int, *EsconORMRow)
func (*EsconORMTable) FindByID ¶ added in v0.2.2
func (me *EsconORMTable) FindByID(txtColumn string, varID interface{}) (*EsconORMRow, error)
func (*EsconORMTable) GetRow ¶ added in v0.1.2
func (me *EsconORMTable) GetRow(intIndex int) *EsconORMRow
func (*EsconORMTable) Insert ¶ added in v0.1.2
func (me *EsconORMTable) Insert(ormRow *EsconORMRow) (*jsons.JSONObject, error)
func (*EsconORMTable) InsertByID ¶ added in v0.1.2
func (me *EsconORMTable) InsertByID(varID interface{}, ormRow *EsconORMRow) (*jsons.JSONObject, error)
func (*EsconORMTable) InsertByIDJSON ¶ added in v0.1.2
func (me *EsconORMTable) InsertByIDJSON(varID interface{}, jsoData *jsons.JSONObject) (*jsons.JSONObject, error)
func (*EsconORMTable) InsertByJSON ¶ added in v0.1.2
func (me *EsconORMTable) InsertByJSON(jsoData *jsons.JSONObject) (*jsons.JSONObject, error)
func (*EsconORMTable) Length ¶ added in v0.1.2
func (me *EsconORMTable) Length() int
func (*EsconORMTable) NewRow ¶ added in v0.1.2
func (me *EsconORMTable) NewRow(varID interface{}, jsoData *jsons.JSONObject) *EsconORMRow
func (*EsconORMTable) Next ¶ added in v0.1.9
func (me *EsconORMTable) Next() bool
func (*EsconORMTable) ToJSONArray ¶ added in v0.1.4
func (me *EsconORMTable) ToJSONArray() *jsons.JSONArray
func (*EsconORMTable) ToJSONObject ¶ added in v0.1.4
func (me *EsconORMTable) ToJSONObject() *jsons.JSONObject
func (*EsconORMTable) Update ¶ added in v0.1.2
func (me *EsconORMTable) Update(ormRow *EsconORMRow) (*jsons.JSONObject, error)
func (*EsconORMTable) UpdateByID ¶ added in v0.1.2
func (me *EsconORMTable) UpdateByID(varID interface{}, ormRow *EsconORMRow) (*jsons.JSONObject, error)
func (*EsconORMTable) UpdateByIDJSON ¶ added in v0.1.2
func (me *EsconORMTable) UpdateByIDJSON(varID interface{}, jsoData *jsons.JSONObject) (*jsons.JSONObject, error)
func (*EsconORMTable) UpdateByJSON ¶ added in v0.1.2
func (me *EsconORMTable) UpdateByJSON(jsoData *jsons.JSONObject) (*jsons.JSONObject, error)
type EsconTX ¶ added in v0.1.2
EsconTX is transaction object
func (*EsconTX) Exec ¶ added in v0.1.2
func (me *EsconTX) Exec(txtSQL string) (*jsons.JSONObject, error)
Exec is run single sql and return effect number data
func (*EsconTX) Fetch ¶ added in v0.1.2
func (me *EsconTX) Fetch(txtSQL string) (*jsons.JSONObject, error)
Fetch is run single sql and return first data row
func (*EsconTX) FetchRow ¶ added in v0.1.2
func (me *EsconTX) FetchRow(txtTable string, txtColumn string, txtWhere string) (*jsons.JSONObject, error)
FetchRow is get first select data row from database
func (*EsconTX) InsertRow ¶ added in v0.1.2
func (me *EsconTX) InsertRow(txtTable string, jsoData *jsons.JSONObject) (*jsons.JSONObject, error)
InsertRow is insert data data to database
func (*EsconTX) SelectRow ¶ added in v0.1.2
func (me *EsconTX) SelectRow(txtTable string, txtColumn string, txtWhere string, txtSort string, intOffset int, intLimit int) (*jsons.JSONArray, error)
SelectRow is select data row from database
func (*EsconTX) UpdateRow ¶ added in v0.1.2
func (me *EsconTX) UpdateRow(txtTable string, jsoData *jsons.JSONObject, txtWhere string) (*jsons.JSONObject, error)
UpdateRow is updata data in database