Documentation
¶
Index ¶
- Variables
- type Datastore
- func (d *Datastore) Batch() (ds.Batch, error)
- func (d *Datastore) Close() error
- func (d *Datastore) Delete(key ds.Key) error
- func (d *Datastore) DeleteContext(ctx context.Context, key ds.Key) error
- func (d *Datastore) Get(key ds.Key) (value []byte, err error)
- func (d *Datastore) GetContext(ctx context.Context, key ds.Key) (value []byte, err error)
- func (d *Datastore) GetSize(key ds.Key) (int, error)
- func (d *Datastore) GetSizeContext(ctx context.Context, key ds.Key) (int, error)
- func (d *Datastore) Has(key ds.Key) (bool, error)
- func (d *Datastore) HasContext(ctx context.Context, key ds.Key) (bool, error)
- func (d *Datastore) PgxPool() *pgxpool.Pool
- func (d *Datastore) Put(key ds.Key, value []byte) error
- func (d *Datastore) PutContext(ctx context.Context, key ds.Key, value []byte) error
- func (d *Datastore) Query(q dsq.Query) (dsq.Results, error)
- func (d *Datastore) QueryContext(ctx context.Context, q dsq.Query) (dsq.Results, error)
- func (d *Datastore) Sync(key ds.Key) error
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
var OptionDefaults = func(o *Options) error { o.Table = "blocks" return nil }
OptionDefaults are the default datastore options. This option will be automatically prepended to any options you pass to the Hydra Head constructor.
Functions ¶
This section is empty.
Types ¶
type Datastore ¶
type Datastore struct {
// contains filtered or unexported fields
}
Datastore is a PostgreSQL backed datastore.
func NewDatastore ¶
NewDatastore creates a new PostgreSQL datastore
func (*Datastore) DeleteContext ¶
DeleteContext removes a row from the PostgreSQL database by the given key.
func (*Datastore) GetContext ¶
GetContext retrieves a value from the PostgreSQL database by the given key.
func (*Datastore) GetSizeContext ¶
GetSizeContext determines the size in bytes of the value for a given key. Returns -1 if not found or other error occurs.
func (*Datastore) Has ¶
Has determines if a value for the given key exists in the PostgreSQL database.
func (*Datastore) HasContext ¶
HasContext determines if a value for the given key exists in the PostgreSQL database.
func (*Datastore) PgxPool ¶ added in v0.1.1
PgxPool exposes the underlying pool of connections to Postgres.
func (*Datastore) PutContext ¶
PutContext "upserts" a row into the PostgreSQL database.
func (*Datastore) Query ¶
Query returns multiple rows from the SQL database based on the passed query parameters.
func (*Datastore) QueryContext ¶
QueryContext returns multiple rows from the SQL database based on the passed query parameters.