Documentation ¶
Index ¶
- Variables
- func Clean(db *sql.DB, tableName string) error
- func CreateTable(db *sql.DB, tableName string) error
- type DBOption
- type DBStore
- func (d *DBStore) Count() (int, error)
- func (d *DBStore) GetAll() ([]gowakuPersistence.StoredMessage, error)
- func (d *DBStore) GetStoredMessage(row *sql.Rows) (gowakuPersistence.StoredMessage, error)
- func (d *DBStore) MostRecentTimestamp() (int64, error)
- func (d *DBStore) Put(env *protocol.Envelope) error
- func (d *DBStore) Query(query *pb.HistoryQuery) (*pb.Index, []gowakuPersistence.StoredMessage, error)
- func (d *DBStore) Stop()
- type Queries
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidCursor = errors.New("invalid cursor")
Functions ¶
Types ¶
type DBOption ¶ added in v0.106.1
DBOption is an optional setting that can be used to configure the DBStore
type DBStore ¶ added in v0.106.1
type DBStore struct {
// contains filtered or unexported fields
}
DBStore is a MessageProvider that has a *sql.DB connection
func NewDBStore ¶ added in v0.106.1
Creates a new DB store using the db specified via options. It will create a messages table if it does not exist and clean up records according to the retention policy used
func (*DBStore) GetAll ¶ added in v0.106.1
func (d *DBStore) GetAll() ([]gowakuPersistence.StoredMessage, error)
GetAll returns all the stored WakuMessages
func (*DBStore) GetStoredMessage ¶ added in v0.106.1
func (d *DBStore) GetStoredMessage(row *sql.Rows) (gowakuPersistence.StoredMessage, error)
GetStoredMessage is a helper function used to convert a `*sql.Rows` into a `StoredMessage`
func (*DBStore) MostRecentTimestamp ¶ added in v0.106.1
MostRecentTimestamp returns an unix timestamp with the most recent senderTimestamp in the message table
func (*DBStore) Query ¶ added in v0.106.1
func (d *DBStore) Query(query *pb.HistoryQuery) (*pb.Index, []gowakuPersistence.StoredMessage, error)
Query retrieves messages from the DB
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
Queries are the sqlite queries for a given table.
func NewQueries ¶
NewQueries creates a new set of queries for the passed table