Documentation
¶
Index ¶
- func Connect(connString string)
- type Postgres
- func (p *Postgres) CopyFrom(ctx context.Context, tableName string, columnNames []string, ...) (int64, error)
- func (p *Postgres) JsonString(ctx context.Context, w http.ResponseWriter, query *string, args ...any) (string, error)
- func (p *Postgres) MessageJsonString(ctx context.Context, conn *websocket.Conn, query *string, args ...any) error
- func (p *Postgres) PgxPoolClose()
- func (p *Postgres) Query(ctx context.Context, query *string, args ...any) (pgx.Rows, error)
- func (p *Postgres) QueryRow(ctx context.Context, query *string, args ...any) pgx.Row
- func (p *Postgres) WriteJsonString(ctx context.Context, w http.ResponseWriter, query *string, args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
var (
Instance Postgres
)
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) 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
Click to show internal directories.
Click to hide internal directories.