Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
*sql.DB
*query.QueryBuilder
}
Database wraps a sql.DB object and provides the ability to easily insert and update rows in a MySQL database using only a pointer to a struct.
func NewDatabase ¶
NewDatabase returns a pointer to a new instance of the Database struct.
func (*Database) Delete ¶
Delete constructs and executes a delete query on the database using only the passed pointer to a struct. The structs primary key field must be populated as this populates the 'WHERE' clause of the query.
func (*Database) Insert ¶
Insert constructs and executes an insert query on the database using only the passed pointer to a struct.
Click to show internal directories.
Click to hide internal directories.