store

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package store is a pgSCV database helper

Index

Constants

View Source
const TestPgbouncerConnStr = "host=127.0.0.1 port=6432 user=pgscv dbname=pgbouncer sslmode=disable password=pgscv"

TestPgbouncerConnStr Pgbouncer connection string

View Source
const TestPostgresConnStr = "host=127.0.0.1 port=5432 user=pgscv dbname=pgscv_fixtures sslmode=disable"

TestPostgresConnStr PostgreSQL connection string

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB is the database representation

func New

func New(connString string, connTimeout int) (*DB, error)

New creates new connection to Postgres/Pgbouncer using passed DSN

func NewTest

func NewTest(t *testing.T) *DB

NewTest create PostgreSQL test

func NewTestPgbouncer

func NewTestPgbouncer(t *testing.T) *DB

NewTestPgbouncer create Pgbouncer test

func NewWithConfig

func NewWithConfig(config *pgx.ConnConfig) (*DB, error)

NewWithConfig creates new connection to Postgres/Pgbouncer using passed Config.

func (*DB) Close

func (db *DB) Close()

Close is wrapper on private close() method.

func (*DB) Conn

func (db *DB) Conn() *pgx.Conn

Conn provides access to public methods of *pgx.Conn struct

func (*DB) Query

func (db *DB) Query(query string, args ...interface{}) (*model.PGResult, error)

Query is a wrapper on private query() method.

Jump to

Keyboard shortcuts

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