Documentation ¶
Index ¶
Constants ¶
View Source
const MaxPageItems = 2 // According to the docs
Variables ¶
View Source
var ErrDuplicated = errors.New("operation duplicated")
View Source
var ErrForeignKey = errors.New("foreign key failed")
View Source
var ErrNoResult = sql.ErrNoRows
Functions ¶
This section is empty.
Types ¶
type AppDatabase ¶
type AppDatabase interface { Ping() error Version() (int, error) QueryStructRow(destPointer any, query string, args ...any) error QueryStructRows(entityStruct any, query string, args ...any) (StructRows, error) Exec(query string, args ...any) error ExecRows(query string, args ...any) (int64, error) BeginTx() (transaction, error) }
AppDatabase is an abstraction over platform *sql.DB
func New ¶
func New(db *sqlx.DB, logger logrus.FieldLogger) (AppDatabase, error)
New returns a new instance of AppDatabase based on the SQLite connection `db`. `db` is required - an error will be returned if `db` is `nil`.
type StructRows ¶
type StructRows struct {
// contains filtered or unexported fields
}
func (*StructRows) Close ¶
func (r *StructRows) Close() error
func (*StructRows) Next ¶
func (r *StructRows) Next() (any, error)
Next will parse and return the next row as a struct, not a pointer.
Click to show internal directories.
Click to hide internal directories.