Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB = &modl.DbMap{Dialect: modl.PostgresDialect{}}
DB is the global database.
View Source
var DBH modl.SqlExecutor = DB
DBH is a modl.SqlExecutor interface to DB, the global database. It is better to use DBH instead of DB because it prevents you from calling methods that could not later be wrapped in a transaction.
Functions ¶
func Connect ¶
func Connect()
Connect connects to the PostgreSQL database specified by the PG* environment variables. It calls log.Fatal if it encounters an error.
Types ¶
type Datastore ¶
type Datastore struct { Posts thesrc.PostsService // contains filtered or unexported fields }
A Datastore accesses the datastore (in PostgreSQL).
func NewDatastore ¶
func NewDatastore(dbh modl.SqlExecutor) *Datastore
NewDatastore creates a new client for accessing the datastore (in PostgreSQL). If dbh is nil, it uses the global DB handle.
func NewMockDatastore ¶
func NewMockDatastore() *Datastore
Click to show internal directories.
Click to hide internal directories.