Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLResult ¶ added in v3.1.9
type SQLResult struct { Count int // Count is the number of rows returned. Columns []string // Columns is the slice of column names. Rows []interface{} // Rows is a slice of row data, where each row is a map of column name to value. }
SQLResult holds the result of a SQL query.
It contains the count of rows, the columns present, and the actual row data.
func UnmarshalSQLRows ¶
UnmarshalSQLRows converts sql.Rows into a more structured SQLResult.
This function takes *sql.Rows as input and attempts to unmarshal the data into a SQLResult struct. It handles different SQL data types by using the appropriate sql.Null* types during scanning. It returns a pointer to a SQLResult or an error.
The function closes the sql.Rows when finished.
Click to show internal directories.
Click to hide internal directories.