Documentation
¶
Index ¶
- func Close()
- func Connect(host string, port int, user, password, dbname string, sslmode bool) (*sql.DB, error)
- func DeleteStruct(table string, conditions builder.Builder) error
- func Exec(statement builder.Builder) error
- func InsertStruct(table string, model interface{}) (string, error)
- func LoadStruct(table string, model interface{}, conditions builder.Builder) error
- func Query(statement builder.Builder) (*sql.Rows, error)
- func QueryStruct(statement builder.Builder, model interface{}) error
- func StructDeleteQuery(table string, conditions builder.Builder) (string, []interface{}, error)
- func StructInsertQuery(table string, obj interface{}) (string, []interface{})
- func StructMultipleInsertQuery(table string, obj interface{}) (string, []interface{})
- func StructScan(rows *sql.Rows, obj interface{}) error
- func StructSelectQuery(table string, obj interface{}, conditions builder.Builder) (string, []interface{}, error)
- func StructUpdateQuery(table string, obj interface{}, updatableFields string, ...) (string, []interface{}, error)
- func UpdateStruct(table string, model interface{}, conditions builder.Builder, fields ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteStruct ¶
DeleteStruct delete struct instance in the database table
func InsertStruct ¶
InsertStruct insert struct values in the database table
func LoadStruct ¶
LoadStruct select struct values from the database table. model must be a pointer to a struct or an array.
func QueryStruct ¶
QueryStruct prepare and execute the statement and then populates the model model must be a pointer to a struct or an array.
func StructDeleteQuery ¶
StructDeleteQuery generates the delete query based on the struct fields
func StructInsertQuery ¶
StructInsertQuery generates the insert query based on the struct fields
func StructMultipleInsertQuery ¶
StructMultipleInsertQuery generates the insert query based on the array of structs
func StructScan ¶
StructScan write rows data to struct array or struct
func StructSelectQuery ¶
func StructSelectQuery(table string, obj interface{}, conditions builder.Builder) (string, []interface{}, error)
StructSelectQuery generates the select query based on the struct fields Object can be a poninter to an array or struct
Types ¶
This section is empty.