Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ContainerID defines the id to be used as the container registration id // of a db factory instance, and as a base id of all other db // package instances registered in the application container. ContainerID = rest.ContainerID + ".db" // ContainerConfigID container registration id of the config instance. ContainerConfigID = config.ContainerID // ContainerConnConfigID defines the id to be used as the container // registration id of the database connection configuration instance. ContainerConnConfigID = ContainerID + ".config" // ContainerDialectFactoryID defines the id to be used as the container // registration id of the database connection dialect factory instance. ContainerDialectFactoryID = ContainerID + ".dialect.factory" // ContainerPrimaryID defines the id to be used as the container // registration id of primary database instance. ContainerPrimaryID = ContainerID + ".primary" )
View Source
const ( // Env defines the gapp-rest/db package environment entry id // base string. Env = rest.Env + "_DB" // EnvConfigPath defines the name of the environment variable // to be checked for an overriding value for the configuration path // that contains the database connection configurations. EnvConfigPath = Env + "_CONFIG_PATH" // EnvPrimary defines the name of the environment variable // to be checked for an overriding value for the primary database. EnvPrimary = Env + "_PRIMARY" )
Variables ¶
View Source
var ( // ConfigPath contains the configuration path that holds the // database connection configurations. ConfigPath = "db" // Primary contains the name given to the primary connection. Primary = "primary" )
Functions ¶
func ErrNoConfig ¶
ErrNoConfig generates a configuration not found error.
func ErrUnknownDialect ¶
ErrUnknownDialect generates an unrecognized dialect in configuration error.
func NewProvider ¶
NewProvider will create a new migration provider instance
Types ¶
type ConnectionFactory ¶
ConnectionFactory defines the interface of a database connection factory.
func NewConnectionFactory ¶
func NewConnectionFactory(dialectFactory DialectFactory) (ConnectionFactory, error)
NewConnectionFactory instantiates a new connection factory instance.
type DialectFactory ¶
DialectFactory defines the interface of a connection dialect factory instance.
func NewDialectFactory ¶
func NewDialectFactory(cfg config.Partial) (DialectFactory, error)
NewDialectFactory instantiates a new connection dialect factory instance.
Click to show internal directories.
Click to hide internal directories.