pgxdb

package
v0.0.0-...-4b7df27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package pgxdb provides a sqlstore.Database implementation for a PostgreSQL database accessed through the github.com/jackc/pgx package.

Index

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 implements the sqlstore.Database interface for a PostgreSQL database.

func New

func New(pool *pgxpool.Pool) *Database

New creates a new pgxdb.Database instance with the given pgx connection conn.

func (*Database) Delete

func (d *Database) Delete(ctx context.Context, id string) error

Delete deletes the session identified by id from the database.

func (*Database) Insert

func (d *Database) Insert(ctx context.Context, id string, data []byte) error

Insert saves a new session to the database.

func (*Database) Load

func (d *Database) Load(ctx context.Context, id string) (updatedAt time.Time, data []byte, err error)

Load loads the session identified by id from the database.

func (*Database) Update

func (d *Database) Update(ctx context.Context, id string, data []byte) error

Update updates an existing session in the database.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL