db

package
v0.0.0-...-141b790 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 10 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(connString string)

Types

type Postgres

type Postgres struct {
	// contains filtered or unexported fields
}
var (
	Instance Postgres
)

func (*Postgres) CopyFrom

func (p *Postgres) CopyFrom(ctx context.Context, tableName string, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)

func (*Postgres) JsonString

func (p *Postgres) JsonString(ctx context.Context, w http.ResponseWriter, query *string, args ...any) (string, error)

Returns JSON string serialized by postgres

func (*Postgres) MessageJsonString

func (p *Postgres) MessageJsonString(ctx context.Context, conn *websocket.Conn, query *string, args ...any) error

Message JSON string serialized by PostgreSQL via provided websocket connection

func (*Postgres) PgxPoolClose

func (p *Postgres) PgxPoolClose()

func (*Postgres) Query

func (p *Postgres) Query(ctx context.Context, query *string, args ...any) (pgx.Rows, error)

func (*Postgres) QueryRow

func (p *Postgres) QueryRow(ctx context.Context, query *string, args ...any) pgx.Row

func (*Postgres) WriteJsonString

func (p *Postgres) WriteJsonString(ctx context.Context, w http.ResponseWriter, query *string, args ...any)

Writes JSON string serialized by postgres to provided http.ResponseWriter

Jump to

Keyboard shortcuts

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