Documentation
¶
Index ¶
- func MakeSqlUrl(address string, port int, user string, passwd string, databse string) string
- type DbController
- func (s *DbController) Delete(patter, value string) (err error)
- func (s *DbController) DeleteFrom(table_name, patter, value string) (err error)
- func (s *DbController) Exec(query string, args ...any) (err error)
- func (s *DbController) Get(dest interface{}, pattern, value string, args ...string) (err error)
- func (s *DbController) GetFrom(dest interface{}, table_name, pattern, value string, args ...string) (err error)
- func (s *DbController) Insert(data map[string]string) (err error)
- func (s *DbController) InsertEasily(data map[string]string) (err error)
- func (s *DbController) InsertInto(table_name string, data map[string]string) (err error)
- func (s *DbController) Update(setcontent map[string]string, patter, value string) (err error)
- func (s *DbController) UpdateEasily(setcontent map[string]string, patter, value string) (err error)
- func (s *DbController) UpdateFrom(table_name string, setcontent map[string]string, patter, value string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DbController ¶
type DbController struct {
// contains filtered or unexported fields
}
func New ¶
func New(table_name, dburl string) (controller *DbController)
func (*DbController) Delete ¶
func (s *DbController) Delete(patter, value string) (err error)
func (*DbController) DeleteFrom ¶
func (s *DbController) DeleteFrom(table_name, patter, value string) (err error)
func (*DbController) Get ¶
func (s *DbController) Get(dest interface{}, pattern, value string, args ...string) (err error)
get data from mysql.example:select id,name,email from user_info where id=78;here is Get(yourstruct,"id","78","id","name","email"),if pattern is null,it'll not where
func (*DbController) GetFrom ¶
func (s *DbController) GetFrom(dest interface{}, table_name, pattern, value string, args ...string) (err error)
get data from mysql.example:select id,name,email from user_info where id=78;here is Get(yourstruct,"id","78","id","name","email"),if pattern is null,it'll not where
func (*DbController) Insert ¶
func (s *DbController) Insert(data map[string]string) (err error)
insert into ...
func (*DbController) InsertEasily ¶
func (s *DbController) InsertEasily(data map[string]string) (err error)
func (*DbController) InsertInto ¶
func (s *DbController) InsertInto(table_name string, data map[string]string) (err error)
insert into ...
func (*DbController) Update ¶
func (s *DbController) Update(setcontent map[string]string, patter, value string) (err error)
update
func (*DbController) UpdateEasily ¶
func (s *DbController) UpdateEasily(setcontent map[string]string, patter, value string) (err error)
update
func (*DbController) UpdateFrom ¶
func (s *DbController) UpdateFrom(table_name string, setcontent map[string]string, patter, value string) (err error)
update
Click to show internal directories.
Click to hide internal directories.