Documentation
¶
Overview ¶
Go programming helpers for common database needs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Execer ¶
type Execer interface { // Exec executes a query without returning any rows. The args are for any placeholder parameters in the query. Exec(query string, args ...interface{}) (sql.Result, error) }
Implemented by both `*sql.DB` and `*sql.Tx`.
type Querier ¶
type Querier interface { // Query executes a query that returns rows. The args are for any placeholder parameters in the query. Query(query string, args ...interface{}) (*sql.Rows, error) }
Implemented by both `*sql.DB` and `*sql.Tx`.
type SqlCursor ¶
type SqlCursor struct {
// contains filtered or unexported fields
}
Helps iterating over `*sql.Rows`. After each `rows.Next` call, you can call the `Scan` method to return the record set as a `map[string]interface{}`.
If the columns are identical for all records (most SQL databases), call `PrepareColumns` just once prior to iteration. If the columns vary across records (some NoSQL databases), call `PrepareColumns` during each iteration prior to `Scan`.
func (*SqlCursor) PrepareColumns ¶
Retrieves meta-data information about the `rows.Columns`.
Click to show internal directories.
Click to hide internal directories.