Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectionString ¶
ConnectionString returns on the connection string format supported by postgres. https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB defines the parameters needed to use a persistence db instance connect to.
func NewDB ¶
NewDB returns an opened db instance whose connection has been tested with ping request. It generates the required tables if they don't exist.
func (*DB) CleanUpLocalData ¶
CleanUpLocalData removes any dirty writes that may have been written on a certain last synced block.
func (*DB) QueryLocalData ¶
func (d *DB) QueryLocalData(method utils.Method, r Reader, sender string, params ...interface{}, ) ([]interface{}, error)
QueryLocalData executes the sql statement associated with the provided local method and uses the reader interface provided to read the row data result set. It then returns an array of data for each row read successfully otherwise an error is returned.