Updated on 2024-05-07 GMT+08:00

type Rows

The following table describes type Rows.

Method

Description

Return Value

(rs *Rows)Close()

Closes Rows to stop the iteration of the data set.

error

(rs *Rows)ColumnTypes()

Returns column information.

[]*ColumnType and error

(rs *Rows)Columns()

Returns the name of each column.

[]string and error

(rs *Rows)Err()

Returns any errors that occur during iteration.

error

(rs *Rows)Next()

Prepares the next data row to be read with the Scan method. If there is an additional result set, true is returned. Otherwise, false is returned.

boolean

(rs *Rows)Scan(dest ...interface{})

Copies the columns of the current iterated row of data to the value specified by dest.

error

(rs *Rows)NextResultSet()

Specifies whether there is an additional result set.

boolean

Parameters

Parameter

Description

dest

The column to be queried needs to be copied to the value specified by this parameter.