Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNullInt64 ¶
NewNullInt64 returns a null if i == 0, otherwise it returns the int64 which was input
func NewNullString ¶
func NewNullString(s string) sql.NullString
NewNullString returns a null if s is empty, otherwise it returns the string which was input
Types ¶
type Datastore ¶
type Datastore struct {
// contains filtered or unexported fields
}
Datastore is a concrete implementation for a database
func NewDatastore ¶
NewDatastore is an initializer for the Datastore struct
func (*Datastore) BeginTx ¶
BeginTx is a wrapper for sql.DB.BeginTx in order to expose from the Datastore interface
func (*Datastore) CommitTx ¶
CommitTx is a wrapper for sql.Tx.Commit in order to expose from the Datastore interface. Proper error handling is also considered.
type Datastorer ¶
type Datastorer interface {
DB() *sql.DB
BeginTx(context.Context) (*sql.Tx, error)
RollbackTx(*sql.Tx, error) error
CommitTx(*sql.Tx) error
}
Datastorer is an interface for working with the Database
type Name ¶
type Name int
Name defines the name for the Datastore
const ( // LocalDatastore represents the local PostgreSQL db LocalDatastore Name = iota // GCPCPDatastore represents a local connection to a GCP Cloud // SQL db through the Google Cloud Proxy GCPCPDatastore // GCPDatastore represents a true GCP connection to a GCP // Cloud SQL db GCPDatastore // MockedDatastore represents a Mocked Database MockedDatastore )
Click to show internal directories.
Click to hide internal directories.