From 8de63f82cf088dce9dfefc6dce772dcfecaf1f87 Mon Sep 17 00:00:00 2001 From: Jim Lambert Date: Wed, 16 Sep 2020 11:31:29 -0400 Subject: [PATCH] document what the int returned by Exec represents --- internal/db/read_writer.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/db/read_writer.go b/internal/db/read_writer.go index ae16c6ef13..748f540536 100644 --- a/internal/db/read_writer.go +++ b/internal/db/read_writer.go @@ -103,8 +103,9 @@ type Writer interface { // DB returns the sql.DB DB() (*sql.DB, error) - // Exec will execute the sql with the values as parameters. No options are - // currently supported + // Exec will execute the sql with the values as parameters. The int returned + // is the number of rows affected by the sql. No options are currently + // supported. Exec(sql string, values []interface{}, opt ...Option) (int, error) // GetTicket returns an oplog ticket for the aggregate root of "i" which can @@ -191,8 +192,9 @@ func (rw *Db) DB() (*sql.DB, error) { return rw.underlying.DB(), nil } -// Exec will execute the sql with the values as parameters. No options are -// currently supported. +// Exec will execute the sql with the values as parameters. The int returned +// is the number of rows affected by the sql. No options are currently +// supported. func (rw *Db) Exec(sql string, values []interface{}, opt ...Option) (int, error) { if sql == "" { return NoRowsAffected, fmt.Errorf("missing sql: %w", ErrInvalidParameter)