Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoRows = sql.ErrNoRows
An error satisfying ErrNoRows is reported by Scan when QueryRow doesn't return a row. It must be tested against with errors.Is.
Functions ¶
func Commit ¶
Commit commits the given transaction.
See (*database/sql.Tx).Commit() for additional documentation.
func Exec ¶
Exec executes a query without returning any rows. The args are for any placeholder parameters in the query.
See (*database/sql.DB).ExecContext() for additional documentation.
Types ¶
type Row ¶
type Row struct{}
Row is the result of calling QueryRow to select a single row.
See *database/sql.Row for additional documentation.
func QueryRow ¶
QueryRow executes a query that is expected to return at most one row.
See (*database/sql.DB).QueryRowContext() for additional documentation.
func QueryRowTx ¶
QueryRowTx is like QueryRow but executes the query in the given transaction.
See (*database/sql.Tx).QueryRowContext() for additional documentation.
type Rows ¶
type Rows struct{}
Rows is the result of a query. Its cursor starts before the first row of the result set. Use Next to advance from row to row.
See *database/sql.Rows for additional documentation.
func Query ¶
Query executes a query that returns rows, typically a SELECT. The args are for any placeholder parameters in the query.
See (*database/sql.DB).QueryContext() for additional documentation.
func QueryTx ¶
QueryTx is like Query but executes the query in the given transaction.
See (*database/sql.Tx).QueryContext() for additional documentation.
func (*Rows) Close ¶
Close closes the Rows, preventing further enumeration.
See (*database/sql.Rows).Close() for additional documentation.
func (*Rows) Err ¶
Err returns the error, if any, that was encountered during iteration. Err may be called after an explicit or implicit Close.
See (*database/sql.Rows).Err() for additional documentation.
func (*Rows) Next ¶
Next prepares the next result row for reading with the Scan method. It returns true on success, or false if there is no next result row or an error happened while preparing it. Err should be consulted to distinguish between the two cases.
Every call to Scan, even the first one, must be preceded by a call to Next.
See (*database/sql.Rows).Next() for additional documentation.