Documentation ¶
Overview ¶
Package sql represents SQL database implementation of the user data persistence layer
Index ¶
- Constants
- type UserDataSql
- func (uds *UserDataSql) EnableTx(txFunc func() error) error
- func (uds *UserDataSql) FindAll() error
- func (uds *UserDataSql) Insert(name string, department string, created time.Time) (id int64, e error)
- func (uds *UserDataSql) Remove(username string) (int64, error)
- func (uds *UserDataSql) Update(name string, department string, created time.Time, id int64) (rowsAffected int64, e error)
Constants ¶
View Source
const ( // use it to test transaction rollback //DELETE_USER string = "delete from userinf where username=?" DELETE_USER string = "delete from userinfo where username=?" QUERY_USER = "SELECT * FROM userinfo " UPDATE_USER = "update userinfo set username=?, department=?, created=? where uid=?" INSERT_USER = "INSERT userinfo SET username=?,department=?,created=?" FORMAT_ISO8601_DATE = "2006-01-02" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserDataSql ¶
UserDataSql is the SQL implementation of UserDataInterface
func (*UserDataSql) EnableTx ¶
func (uds *UserDataSql) EnableTx(txFunc func() error) error
func (*UserDataSql) FindAll ¶
func (uds *UserDataSql) FindAll() error
Click to show internal directories.
Click to hide internal directories.