Documentation ¶
Index ¶
- Constants
- Variables
- func GetConfig(c gapp.ServiceContainer) (*gorm.Config, error)
- func GetConnectionFactory(c gapp.ServiceContainer) (*grdb.ConnectionFactory, error)
- func GetDialectFactory(c gapp.ServiceContainer) (*grdb.DialectFactory, error)
- func GetDialectStrategies(c gapp.ServiceContainer) ([]grdb.DialectStrategy, error)
- func GetPrimaryConnection(c gapp.ServiceContainer) (*gorm.DB, error)
- type Provider
Constants ¶
View Source
const ( // ContainerID defines the id to be used as the container // registration id of a relational database connection factory instance, // and as a base id of all other relational database package instances // registered in the application container. ContainerID = gapp.ContainerID + ".rdb" // ContainerConfigID defines the id to be used as the container // registration id of the relational database connection configuration // instance. ContainerConfigID = ContainerID + ".config" // ContainerDialectStrategyTag defines the tag to be assigned to all // container relational database dialect strategies. ContainerDialectStrategyTag = ContainerID + ".dialect.strategy" // ContainerDialectStrategyMySQLID defines the id to be used // as the container registration id of the relational database connection // MySQL dialect instance. ContainerDialectStrategyMySQLID = ContainerID + ".dialect.strategy.mysql" // ContainerDialectStrategySqliteID defines the id to be used // as the container registration id of the relational database connection // sqlite dialect instance. ContainerDialectStrategySqliteID = ContainerID + ".dialect.strategy.sqlite" // ContainerDialectFactoryID defines the id to be used as the // container registration id of the relational database connection dialect // factory instance. ContainerDialectFactoryID = ContainerID + ".dialect.factory" // ContainerPrimaryID defines the id to be used as the container // registration id of primary relational database instance. ContainerPrimaryID = ContainerID + ".primary" )
Variables ¶
View Source
var ( // ErrNilPointer defines a nil pointer argument error ErrNilPointer = gapp.ErrNilPointer // ErrConversion defines a type conversion error ErrConversion = gapp.ErrConversion )
View Source
var ( // Primary contains the name given to the primary connection. Primary = genv.String("GAPP_RDB_PRIMARY", "primary") )
Functions ¶
func GetConfig ¶
func GetConfig(c gapp.ServiceContainer) (*gorm.Config, error)
GetConfig will try to retrieve a new default gorm config instance from the application service container.
func GetConnectionFactory ¶
func GetConnectionFactory(c gapp.ServiceContainer) (*grdb.ConnectionFactory, error)
GetConnectionFactory will try to retrieve the registered connection factory instance from the application service container.
func GetDialectFactory ¶
func GetDialectFactory(c gapp.ServiceContainer) (*grdb.DialectFactory, error)
GetDialectFactory will try to retrieve the registered dialect factory instance from the application service container.
func GetDialectStrategies ¶
func GetDialectStrategies(c gapp.ServiceContainer) ([]grdb.DialectStrategy, error)
GetDialectStrategies will try to retrieve the registered the list of dialect strategies instances from the application service container.
func GetPrimaryConnection ¶
func GetPrimaryConnection(c gapp.ServiceContainer) (*gorm.DB, error)
GetPrimaryConnection will try to retrieve the registered connection factory instance from the application service container.
Types ¶
Click to show internal directories.
Click to hide internal directories.