Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package sql provides basic functionality for accessing a PostgreSQL database.
Index ¶
- Variables
 - func BuildWhere(cols []string) string
 - func Exec(ctx *b.Context, qu string, args ...interface{}) error
 - func ExecDB(ctx *b.Context, db *Storage, qu string, args ...interface{}) error
 - func ExecDBN(ctx *b.Context, db *Storage, qu string, args ...interface{}) (int64, error)
 - func ExecN(ctx *b.Context, qu string, args ...interface{}) (int64, error)
 - func Query(ctx *b.Context, process func(*Rows) error, qu string, args ...interface{}) error
 - func QueryDB(ctx *b.Context, db *Storage, process func(*Rows) error, qu string, ...) error
 - func QueryNumber(ctx *b.Context, qu string, args ...interface{}) (uint64, error)
 - func QueryNumberDB(ctx *b.Context, db *Storage, qu string, args ...interface{}) (uint64, error)
 - func QueryRow(ctx *b.Context, process func(*Row) error, qu string, args ...interface{}) error
 - func QueryRowDB(ctx *b.Context, db *Storage, process func(*Row) error, qu string, ...) error
 - func QueryRows(ctx *b.Context, qu string, args ...interface{}) (*sql.Rows, error)
 - func QueryRowsDB(ctx *b.Context, db *Storage, qu string, args ...interface{}) (*sql.Rows, error)
 - func QueryString(ctx *b.Context, qu string, args ...interface{}) (string, error)
 - func QueryStringDB(ctx *b.Context, db *Storage, qu string, args ...interface{}) (string, error)
 - func Start(ctx *b.Context)
 - func StartDB(ctx *b.Context) *sql.DB
 - type NullBool
 - type NullInt64
 - type NullString
 - type Row
 - type Rows
 - type Storage
 
Constants ¶
This section is empty.
Variables ¶
var NoData = sql.ErrNoRows
    Functions ¶
func BuildWhere ¶ added in v0.1.11
func ExecN ¶ added in v0.1.15
ExecN executes a SQL update, insert, or delete statement, returning the number of affected rows together with the error returned by the execution.
func Query ¶
Function Query executes a SQL query and calls the process closure using the Rows object returned by the query.
func QueryNumber ¶ added in v0.1.11
Function QueryNumber executes the SQL query given and returns a scalar numeric value.
func QueryNumberDB ¶ added in v0.1.12
func QueryRow ¶ added in v0.1.11
Function QueryRow excecutes a SQL query that returns exactly one Row and calls the process closure using the Row object returned by the query.
func QueryRowDB ¶ added in v0.1.12
func QueryRows ¶ added in v0.1.11
Funtion QueryRows executes a SQL query and returns the sql.Rows object. It is the responsibility of the caller to iterate over the Rows object returned and scan the individual rows.
func QueryRowsDB ¶ added in v0.1.12
func QueryString ¶ added in v0.1.11
Function QueryString executes the SQL query given and returns a scalar string value.
func QueryStringDB ¶ added in v0.1.12
Types ¶
type NullString ¶ added in v0.1.11
type NullString = sql.NullString