Documentation ¶
Index ¶
- func ReadRows(struc interface{}, rows *sql.Rows) []interface{}
- type Connection
- type QueryBuilder
- func (qb *QueryBuilder) All() (*sql.Rows, error)
- func (qb *QueryBuilder) From(table string) *QueryBuilder
- func (qb *QueryBuilder) GetWithID(id int64, table string) (*sql.Rows, error)
- func (qb *QueryBuilder) Insert(table string, values interface{}) (*sql.Rows, error)
- func (qb *QueryBuilder) ResetQuery()
- func (qb *QueryBuilder) Select() *QueryBuilder
- func (qb *QueryBuilder) Update(table string, values interface{}) (*sql.Rows, error)
- func (qb *QueryBuilder) WhereRaw(raw string) *QueryBuilder
- func (qb *QueryBuilder) WhereValue(column string, value string) *QueryBuilder
- func (qb *QueryBuilder) WhereValues(values interface{}) *QueryBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connection ¶
type Connection struct { Host string Port string Database string Username string Password string // contains filtered or unexported fields }
Connection is the connection to the database
func (*Connection) Close ¶
func (dbc *Connection) Close() error
Close closes a connection to the database
func (*Connection) Default ¶
func (dbc *Connection) Default()
Default sets the default options for the Connection
func (*Connection) Open ¶
func (dbc *Connection) Open() error
Open opens a connection to the database
type QueryBuilder ¶
type QueryBuilder struct { DBC Connection // contains filtered or unexported fields }
QueryBuilder the builder for queries
func (*QueryBuilder) All ¶
func (qb *QueryBuilder) All() (*sql.Rows, error)
All retrieves all data from selected table
func (*QueryBuilder) From ¶
func (qb *QueryBuilder) From(table string) *QueryBuilder
From adds to the from part of the query
func (*QueryBuilder) Insert ¶
func (qb *QueryBuilder) Insert(table string, values interface{}) (*sql.Rows, error)
Insert inserts values into table in database
func (*QueryBuilder) Select ¶
func (qb *QueryBuilder) Select() *QueryBuilder
Select adds to the select part of the query
func (*QueryBuilder) Update ¶
func (qb *QueryBuilder) Update(table string, values interface{}) (*sql.Rows, error)
Update updates values from table in database
func (*QueryBuilder) WhereRaw ¶
func (qb *QueryBuilder) WhereRaw(raw string) *QueryBuilder
WhereRaw adds to the where part of the query
func (*QueryBuilder) WhereValue ¶
func (qb *QueryBuilder) WhereValue(column string, value string) *QueryBuilder
WhereValue adds to the where part of the query by using column and value
func (*QueryBuilder) WhereValues ¶
func (qb *QueryBuilder) WhereValues(values interface{}) *QueryBuilder
WhereValues adds to the where part of the query by using a interface
Click to show internal directories.
Click to hide internal directories.