db

package
v0.0.0-...-f18cc39 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2013 License: BSD-3-Clause, MIT Imports: 4 Imported by: 0

Documentation

Overview

Exposes a connection to the underlying PostgreSQL RDBMS.

This library federates access to the database and provides a common point for configuration as well as optimzation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteFn

func ExecuteFn(dba DbAction) error

Executes a function. Note that this is not thread safe. ExecuteFn will only hold the connection open so long as you block.

func Open

func Open(settings *lib.AppSettings) (<-chan DbMessage, error)

Opens a database connection if one has not been established. The channel can be used to forward private requests to the database.

Types

type DbAction

type DbAction func(*sql.DB) error

A lambda which takes an open database connection. The lambda can return a friendly model-level error which will be passed through ExecuteFn

type DbMessage

type DbMessage int
const (
	CLOSE_DB DbMessage = iota
)

Jump to

Keyboard shortcuts

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