Documentation
¶
Index ¶
- type IDatabase
- type IRecord
- type Q
- func (q *Q) DeleteAll(dest IRecord) (affected int, err error)
- func (q *Q) DeleteOneByID(dest IRecord, ID string) (affected int, err error)
- func (q *Q) ExistsByField(db IRecord, field string, value string) (found bool, ID string, err error)
- func (q *Q) ExistsByID(db IRecord, value string) (found bool, err error)
- func (q *Q) FindAll(dest IRecord) (total int, err error)
- func (q *Q) FindOneByID(dest IRecord, ID string) (exists bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IDatabase ¶
type IDatabase interface {
Get(dest interface{}, query string, args ...interface{}) error
Exec(query string, args ...interface{}) (sql.Result, error)
Select(dest interface{}, query string, args ...interface{}) error
QueryRowScan(dest interface{}, query string, args ...interface{}) error
}
IDatabase provides data query capabilities.
type Q ¶
type Q struct {
// contains filtered or unexported fields
}
Q is a database wrapper that provides helpful utilities.
func (*Q) DeleteOneByID ¶
DeleteOneByID removes one record by ID.
func (*Q) ExistsByField ¶
func (q *Q) ExistsByField(db IRecord, field string, value string) (found bool, ID string, err error)
ExistsByField determines if a records exists by a specified field and returns the ID.
func (*Q) ExistsByID ¶
ExistsByID determines if a records exists by ID.
Click to show internal directories.
Click to hide internal directories.