database

package
v0.0.0-...-b92253b Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeSqlUrl

func MakeSqlUrl(address string, port int, user string, passwd string, databse string) string

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) Exec

func (s *DbController) Exec(query string, args ...any) (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

Jump to

Keyboard shortcuts

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