Documentation
¶
Index ¶
- Variables
- func ScanOneRecord(rows *sql.Rows) (record.Record, error)
- func ScanRecords(rows *sql.Rows) ([]record.Record, error)
- type Column
- type DeleteStatement
- func (s *DeleteStatement) Args() []any
- func (s *DeleteStatement) Exec() (sql.Result, error)
- func (s *DeleteStatement) ExecFunc(f func(Query) (sql.Result, error)) *DeleteStatement
- func (s *DeleteStatement) IsValid() bool
- func (s *DeleteStatement) String() string
- func (s *DeleteStatement) Where(def string, args ...any) *DeleteStatement
- type InsertStatement
- func (s *InsertStatement) Args() []any
- func (s *InsertStatement) Columns(columns ...string) *InsertStatement
- func (s *InsertStatement) Exec() (sql.Result, error)
- func (s *InsertStatement) ExecFunc(f func(Query) (sql.Result, error)) *InsertStatement
- func (s *InsertStatement) IsValid() bool
- func (s *InsertStatement) Or(or string) *InsertStatement
- func (s *InsertStatement) Select(q *SelectQuery) *InsertStatement
- func (s *InsertStatement) String() string
- func (s *InsertStatement) Values(values ...Values) *InsertStatement
- type InsertTable
- type OnClause
- type OrderBy
- type Query
- type SelectQuery
- func (q *SelectQuery) Args() []any
- func (q *SelectQuery) Columns(defs ...string) *SelectQuery
- func (q *SelectQuery) Ctx(ctx context.Context) *SelectQuery
- func (q *SelectQuery) DB(db *sql.DB) *SelectQuery
- func (q *SelectQuery) Distinct(distinct bool) *SelectQuery
- func (q *SelectQuery) InnerJoin(def string) *SelectQuery
- func (q *SelectQuery) IsValid() bool
- func (q *SelectQuery) LeftJoin(def string) *SelectQuery
- func (q *SelectQuery) Limit(limit int) *SelectQuery
- func (q *SelectQuery) Offset(offset int) *SelectQuery
- func (q *SelectQuery) OrderBy(defs ...string) *SelectQuery
- func (q *SelectQuery) Query() (*sql.Rows, error)
- func (q *SelectQuery) QueryFunc(f func(Query) (*sql.Rows, error)) *SelectQuery
- func (q *SelectQuery) QueryRecord() (record.Record, error)
- func (q *SelectQuery) QueryRecords() ([]record.Record, error)
- func (q *SelectQuery) QueryRow() *sql.Row
- func (q *SelectQuery) QueryRowFunc(f func(Query) *sql.Row) *SelectQuery
- func (q *SelectQuery) RightJoin(def string) *SelectQuery
- func (q *SelectQuery) String() string
- func (q *SelectQuery) Where(def string, args ...any) *SelectQuery
- type SelectTable
- type UpdateStatement
- func (s *UpdateStatement) Args() []any
- func (s *UpdateStatement) Exec() (sql.Result, error)
- func (s *UpdateStatement) ExecFunc(f func(Query) (sql.Result, error)) *UpdateStatement
- func (s *UpdateStatement) IsValid() bool
- func (s *UpdateStatement) Or(or string) *UpdateStatement
- func (s *UpdateStatement) Set(column string, value any) *UpdateStatement
- func (s *UpdateStatement) SetMap(data map[string]any) *UpdateStatement
- func (s *UpdateStatement) String() string
- func (s *UpdateStatement) Where(def string, args ...any) *UpdateStatement
- type UpdateTable
- type Values
- type Where
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoDatabase = errors.New("no database")
)
Functions ¶
func ScanRecords ¶
ScanRecords transforms SQL row data into record.Record objects, making them easier to handle with type safety.
Types ¶
type DeleteStatement ¶
type DeleteStatement struct {
// contains filtered or unexported fields
}
https://www.sqlite.org/lang_delete.html
func Delete ¶
func Delete(from string) *DeleteStatement
func (*DeleteStatement) Args ¶
func (s *DeleteStatement) Args() []any
func (*DeleteStatement) ExecFunc ¶
func (s *DeleteStatement) ExecFunc(f func(Query) (sql.Result, error)) *DeleteStatement
func (*DeleteStatement) IsValid ¶
func (s *DeleteStatement) IsValid() bool
func (*DeleteStatement) String ¶
func (s *DeleteStatement) String() string
func (*DeleteStatement) Where ¶
func (s *DeleteStatement) Where(def string, args ...any) *DeleteStatement
type InsertStatement ¶
type InsertStatement struct {
// contains filtered or unexported fields
}
https://www.sqlite.org/lang_delete.html
func Insert ¶
func Insert(into string) *InsertStatement
func (*InsertStatement) Args ¶
func (s *InsertStatement) Args() []any
func (*InsertStatement) Columns ¶
func (s *InsertStatement) Columns(columns ...string) *InsertStatement
func (*InsertStatement) ExecFunc ¶
func (s *InsertStatement) ExecFunc(f func(Query) (sql.Result, error)) *InsertStatement
func (*InsertStatement) IsValid ¶
func (s *InsertStatement) IsValid() bool
func (*InsertStatement) Or ¶
func (s *InsertStatement) Or(or string) *InsertStatement
func (*InsertStatement) Select ¶
func (s *InsertStatement) Select(q *SelectQuery) *InsertStatement
func (*InsertStatement) String ¶
func (s *InsertStatement) String() string
func (*InsertStatement) Values ¶
func (s *InsertStatement) Values(values ...Values) *InsertStatement
type InsertTable ¶
type InsertTable string
func Into ¶
func Into(def string) InsertTable
func (InsertTable) IsValid ¶
func (t InsertTable) IsValid() bool
func (InsertTable) Parse ¶
func (t InsertTable) Parse() (table, as string, ok bool)
func (InsertTable) String ¶
func (t InsertTable) String() string
type SelectQuery ¶
type SelectQuery struct {
// contains filtered or unexported fields
}
https://www.sqlite.org/lang_select.html
func Select ¶
func Select(from string) *SelectQuery
func (*SelectQuery) Args ¶
func (q *SelectQuery) Args() []any
func (*SelectQuery) Columns ¶
func (q *SelectQuery) Columns(defs ...string) *SelectQuery
func (*SelectQuery) Ctx ¶
func (q *SelectQuery) Ctx(ctx context.Context) *SelectQuery
func (*SelectQuery) DB ¶
func (q *SelectQuery) DB(db *sql.DB) *SelectQuery
func (*SelectQuery) Distinct ¶
func (q *SelectQuery) Distinct(distinct bool) *SelectQuery
func (*SelectQuery) InnerJoin ¶
func (q *SelectQuery) InnerJoin(def string) *SelectQuery
func (*SelectQuery) IsValid ¶
func (q *SelectQuery) IsValid() bool
func (*SelectQuery) LeftJoin ¶
func (q *SelectQuery) LeftJoin(def string) *SelectQuery
func (*SelectQuery) Limit ¶
func (q *SelectQuery) Limit(limit int) *SelectQuery
func (*SelectQuery) Offset ¶
func (q *SelectQuery) Offset(offset int) *SelectQuery
func (*SelectQuery) OrderBy ¶
func (q *SelectQuery) OrderBy(defs ...string) *SelectQuery
func (*SelectQuery) QueryFunc ¶
func (q *SelectQuery) QueryFunc(f func(Query) (*sql.Rows, error)) *SelectQuery
func (*SelectQuery) QueryRecord ¶
func (q *SelectQuery) QueryRecord() (record.Record, error)
func (*SelectQuery) QueryRecords ¶
func (q *SelectQuery) QueryRecords() ([]record.Record, error)
func (*SelectQuery) QueryRow ¶
func (q *SelectQuery) QueryRow() *sql.Row
func (*SelectQuery) QueryRowFunc ¶
func (q *SelectQuery) QueryRowFunc(f func(Query) *sql.Row) *SelectQuery
func (*SelectQuery) RightJoin ¶
func (q *SelectQuery) RightJoin(def string) *SelectQuery
func (*SelectQuery) String ¶
func (q *SelectQuery) String() string
func (*SelectQuery) Where ¶
func (q *SelectQuery) Where(def string, args ...any) *SelectQuery
type SelectTable ¶
type SelectTable string
func From ¶
func From(def string) SelectTable
func InnerJoin ¶
func InnerJoin(def string) SelectTable
func LeftJoin ¶
func LeftJoin(def string) SelectTable
func RightJoin ¶
func RightJoin(def string) SelectTable
func (SelectTable) IsValid ¶
func (t SelectTable) IsValid() bool
func (SelectTable) Parse ¶
func (t SelectTable) Parse() (selectType, table, as string, on *OnClause, ok bool)
func (SelectTable) String ¶
func (t SelectTable) String() string
type UpdateStatement ¶
type UpdateStatement struct {
// contains filtered or unexported fields
}
https://www.sqlite.org/lang_update.html
func Update ¶
func Update(table string) *UpdateStatement
func (*UpdateStatement) Args ¶
func (s *UpdateStatement) Args() []any
func (*UpdateStatement) ExecFunc ¶
func (s *UpdateStatement) ExecFunc(f func(Query) (sql.Result, error)) *UpdateStatement
func (*UpdateStatement) IsValid ¶
func (s *UpdateStatement) IsValid() bool
func (*UpdateStatement) Or ¶
func (s *UpdateStatement) Or(or string) *UpdateStatement
func (*UpdateStatement) Set ¶
func (s *UpdateStatement) Set(column string, value any) *UpdateStatement
func (*UpdateStatement) SetMap ¶
func (s *UpdateStatement) SetMap(data map[string]any) *UpdateStatement
func (*UpdateStatement) String ¶
func (s *UpdateStatement) String() string
func (*UpdateStatement) Where ¶
func (s *UpdateStatement) Where(def string, args ...any) *UpdateStatement
type UpdateTable ¶
type UpdateTable string
func (UpdateTable) IsValid ¶
func (t UpdateTable) IsValid() bool
func (UpdateTable) Parse ¶
func (t UpdateTable) Parse() (table, as string, ok bool)
func (UpdateTable) String ¶
func (t UpdateTable) String() string
Click to show internal directories.
Click to hide internal directories.