summaryrefslogtreecommitdiff
path: root/vendor/github.com/Masterminds/squirrel/row.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/Masterminds/squirrel/row.go')
-rw-r--r--vendor/github.com/Masterminds/squirrel/row.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/github.com/Masterminds/squirrel/row.go b/vendor/github.com/Masterminds/squirrel/row.go
new file mode 100644
index 0000000..74ffda9
--- /dev/null
+++ b/vendor/github.com/Masterminds/squirrel/row.go
@@ -0,0 +1,22 @@
+package squirrel
+
+// RowScanner is the interface that wraps the Scan method.
+//
+// Scan behaves like database/sql.Row.Scan.
+type RowScanner interface {
+ Scan(...interface{}) error
+}
+
+// Row wraps database/sql.Row to let squirrel return new errors on Scan.
+type Row struct {
+ RowScanner
+ err error
+}
+
+// Scan returns Row.err or calls RowScanner.Scan.
+func (r *Row) Scan(dest ...interface{}) error {
+ if r.err != nil {
+ return r.err
+ }
+ return r.RowScanner.Scan(dest...)
+}