sql

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package sql provides basic functionality for accessing a PostgreSQL database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(ctx *b.Context, qu string, args ...interface{}) error

Exec executes a SQL update, insert, or delete statement.

func Query

func Query(ctx *b.Context, process func(*Rows) error, qu string,
	args ...interface{}) error

Query executes a SQL query and calls the process closure using the Rows object returned by the query.

func Start

func Start(ctx *b.Context)

Start is a generic actor startup handler that connects to a database and stores the db connection via a Storage object in the context.

Types

type Rows

type Rows = sql.Rows

type Storage

type Storage struct {
	*sql.DB
}

type Storage provides database access. Implements interface b.ContextState

func (*Storage) GetSessionMailbox

func (st *Storage) GetSessionMailbox(sid string) chan b.Message

method GetSessionMailbox for interface b.ContextState.

Jump to

Keyboard shortcuts

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