File: result.go

package info (click to toggle)
golang-github-erikstmartin-go-testdb 0.0~git20160219.0.8d10e4a-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 116 kB
  • ctags: 113
  • sloc: makefile: 2
file content (25 lines) | stat: -rw-r--r-- 613 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package testdb

type Result struct {
	lastInsertId      int64
	lastInsertIdError error
	rowsAffected      int64
	rowsAffectedError error
}

func NewResult(lastId int64, lastIdError error, rowsAffected int64, rowsAffectedError error) (res *Result) {
	return &Result{
		lastInsertId:      lastId,
		lastInsertIdError: lastIdError,
		rowsAffected:      rowsAffected,
		rowsAffectedError: rowsAffectedError,
	}
}

func (res *Result) LastInsertId() (int64, error) {
	return res.lastInsertId, res.lastInsertIdError
}

func (res *Result) RowsAffected() (int64, error) {
	return res.rowsAffected, res.rowsAffectedError
}