Documentation
¶
Overview ¶
Package sqlitexx provides another set of extensions for the sqlitex package.
Index ¶
- Variables
- type Query
- func (q *Query) BindBytes(name string, value []byte) *Query
- func (q *Query) BindInt(name string, value int) *Query
- func (q *Query) BindInt64(name string, value int64) *Query
- func (q *Query) BindString(name, value string) *Query
- func (q *Query) BindStringIfSet(name, value string) *Query
- func (q *Query) BindUint64(name string, value uint64) *Query
- func (q *Query) Exec() (err error)
- func (q *Query) QueryAll(resultFn ResultFunc) (err error)
- func (q *Query) QueryIter() iter.Seq2[*sqlite.Stmt, error]
- func (q *Query) QueryRow(resultFn ResultFunc) (err error)
- type ResultFunc
Constants ¶
This section is empty.
Variables ¶
var ErrNoRows = errors.New("sqlitexx: no rows in result set")
ErrNoRows is returned when a query returns no rows.
Functions ¶
This section is empty.
Types ¶
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query represents a prepared SQL query.
func NewQuery ¶
NewQuery creates a query that can be executed.
NewQuery supports only named parameters. The query should be executed to free up prepared resources.
func (*Query) BindString ¶
BindString binds a string parameter.
func (*Query) BindStringIfSet ¶
BindStringIfSet binds a string parameter if the value is not empty.
func (*Query) BindUint64 ¶
BindUint64 binds a uint64 parameter.
func (*Query) QueryAll ¶
func (q *Query) QueryAll(resultFn ResultFunc) (err error)
QueryAll executes the query and processes all returned rows.
func (*Query) QueryIter ¶
QueryIter returns an iterator for the query results.
The statement is reset when the iteration completes or breaks early.
func (*Query) QueryRow ¶
func (q *Query) QueryRow(resultFn ResultFunc) (err error)
QueryRow executes the query and asserts a single row.
If no rows are returned, ErrNoRows is returned.
type ResultFunc ¶
ResultFunc is a function that processes a row from a query result.