Documentation ¶
Overview ¶
Package database keeps the utility functions that converts database type to internal golang type
It also keeps the interface for structs to implement database connection
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Crud ¶
type Crud interface { // Update the parameters by int flag. It calls UPDATE command Update(interface{}, uint8) error // Exist in the database or not. It calls EXIST command Exist(interface{}) bool // Insert into the database. It calls INSERT command Insert(interface{}) error // Select selects the single row from the database. It calls SELECT_ROW command Select(interface{}) error // SelectAll selects the multiple rows from the database. It calls SELECT_ALL without WHERE clause of query. // // Result is then put to the second argument SelectAll(interface{}, interface{}) error // SelectAllByCondition returns structs from database to the second argument. // The database query should match to the condition. // // It calls SELECT_ALL with WHERE clause SelectAllByCondition(interface{}, key_value.KeyValue, interface{}) error // uses SELECT_ROW }
Crud interface adds the database CRUD operations to the data struct.
The interface that it accepts is the *remote.ClientSocket from the "github.com/ahmetson/service-lib/remote" package.
Click to show internal directories.
Click to hide internal directories.