Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RawOrderBySQL ¶
RawOrderBySQL generates an SQL ORDER BY clause based on the provided list of orders.
Parameters: - o: a list of orders of type ListOrders. - separator: a string used to split the orders into sort fields and sort directions.
Return: - a string representing the generated SQL ORDER BY clause.
Types ¶
type GORMManager ¶
type GORMManager struct {
// contains filtered or unexported fields
}
func NewGORMManager ¶
NewGORMManager creates a new GORMManager instance.
Parameters: - d: the gorm.Dialector to be used for the GORMManager. - opts: a variadic parameter of gorm.Option to be applied to the GORMManager.
Returns: - *GORMManager: the newly created GORMManager instance. - error: an error if the GORMManager creation fails.
func (*GORMManager) AddReplicaDialector ¶
func (m *GORMManager) AddReplicaDialector(d gorm.Dialector, pc PoolConfig) (*GORMManager, error)
AddReplicaDialector adds a replica dialector to the GORMManager.
Parameters: - d: the gorm.Dialector to be added as a replica. - pc: the PoolConfig containing connection settings.
Returns: - *GORMManager: the updated GORMManager instance. - error: an error if the dialector registration fails.
func (*GORMManager) AddSourceDialector ¶
func (m *GORMManager) AddSourceDialector(d gorm.Dialector, pc PoolConfig) (*GORMManager, error)
AddSourceDialector adds a source dialector to the GORMManager.
Parameters: - d: the gorm.Dialector to be added as a source. - pc: the PoolConfig containing connection settings.
Returns: - *GORMManager: the updated GORMManager instance. - error: an error if the dialector registration fails.
func (*GORMManager) DB ¶ added in v0.2.1
func (m *GORMManager) DB() *gorm.DB
DB returns the underlying *gorm.DB instance of the GORMManager.
Parameters: - None
Returns: - *gorm.DB: the underlying *gorm.DB instance.
func (*GORMManager) WithLogger ¶
func (m *GORMManager) WithLogger(lgr logger.Interface) *GORMManager
WithLogger sets the logger for the GORMManager instance.
Parameters: - lgr: the logger.Interface to be set for the GORMManager.
Returns: - *GORMManager: the updated GORMManager instance with the new logger.