Additional documentation.
This commit is contained in:
parent
d253a35161
commit
b10270b502
48 changed files with 892 additions and 699 deletions
|
|
@ -7,6 +7,7 @@ import (
|
|||
"github.com/go-jet/jet/execution"
|
||||
)
|
||||
|
||||
// UpdateStatement is interface of SQL UPDATE statement
|
||||
type UpdateStatement interface {
|
||||
Statement
|
||||
|
||||
|
|
@ -65,7 +66,7 @@ func (u *updateStatementImpl) Sql() (sql string, args []interface{}, err error)
|
|||
return "", nil, errors.New("jet: table to update is nil")
|
||||
}
|
||||
|
||||
if err = u.table.serialize(update_statement, out); err != nil {
|
||||
if err = u.table.serialize(updateStatement, out); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -100,7 +101,7 @@ func (u *updateStatementImpl) Sql() (sql string, args []interface{}, err error)
|
|||
out.writeString("(")
|
||||
}
|
||||
|
||||
err = serializeClauseList(update_statement, u.row, out)
|
||||
err = serializeClauseList(updateStatement, u.row, out)
|
||||
|
||||
if err != nil {
|
||||
return
|
||||
|
|
@ -114,11 +115,11 @@ func (u *updateStatementImpl) Sql() (sql string, args []interface{}, err error)
|
|||
return "", nil, errors.New("jet: WHERE clause not set")
|
||||
}
|
||||
|
||||
if err = out.writeWhere(update_statement, u.where); err != nil {
|
||||
if err = out.writeWhere(updateStatement, u.where); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = out.writeReturning(update_statement, u.returning); err != nil {
|
||||
if err = out.writeReturning(updateStatement, u.returning); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -135,7 +136,7 @@ func (u *updateStatementImpl) Query(db execution.DB, destination interface{}) er
|
|||
}
|
||||
|
||||
func (u *updateStatementImpl) QueryContext(db execution.DB, context context.Context, destination interface{}) error {
|
||||
return queryContext(u, db, context, destination)
|
||||
return queryContext(context, u, db, destination)
|
||||
}
|
||||
|
||||
func (u *updateStatementImpl) Exec(db execution.DB) (res sql.Result, err error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue