Documentation ¶
Overview ¶
Package db provides operations on SQLite DB.
Index ¶
- type Database
- func (db *Database) Close() error
- func (db *Database) Exec(sqlStatement string) error
- func (db *Database) Insert(rec []interface{}) error
- func (db *Database) SelectAll() ([]Record, error)
- func (db *Database) SelectByNameAndHost(name, host string) ([]Record, error)
- func (db *Database) SelectByUID(uid string) ([]Record, error)
- func (db *Database) SelectByUIDAndName(uid, name string) ([]Record, error)
- func (db *Database) SelectByUIDNameAndHost(uid, name, host string) ([]Record, error)
- func (db *Database) SelectByUIDNameAndType(uid, name, dataType string) ([]Record, error)
- func (db *Database) SelectByUIDNameTypeAndHost(uid, name, dataType, host string) ([]Record, error)
- type Record
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database type is sql.DB
func (*Database) SelectAll ¶
SelectAll executes SQL SELECT query and returns all records in the migration table.
func (*Database) SelectByNameAndHost ¶
SelectByNameAndHost prepares WHERE clause for SELECT query and returns array of the Record(s) found by the SQL query.
func (*Database) SelectByUID ¶
SelectByUID prepares WHERE clause for SELECT query and returns array of the Record(s) found by the SQL query.
func (*Database) SelectByUIDAndName ¶
SelectByUIDAndName prepares WHERE clause for SELECT query and returns array of the Record(s) found by the SQL query.
func (*Database) SelectByUIDNameAndHost ¶
SelectByUIDNameAndHost prepares WHERE clause for SELECT query and returns array of the Record(s) found by the SQL query.
func (*Database) SelectByUIDNameAndType ¶
SelectByUIDNameAndType prepares WHERE clause for SELECT query and returns array of the Record(s) found by the SQL query.