Documentation
¶
Index ¶
- func GetContextGormLogger(ctx context.Context) *threadsafe.SimpleSafeSlice[string]
- func NewDBConnection(connector DBConnector, cfg Config) (gorm.Dialector, error)
- func WithContextGormLogger(ctx context.Context, w *threadsafe.SimpleSafeSlice[string]) context.Context
- type Config
- type DBConnector
- type LogType
- type MySQLDialector
- type PostgreSQLDialector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContextGormLogger ¶ added in v0.0.8
func GetContextGormLogger(ctx context.Context) *threadsafe.SimpleSafeSlice[string]
GetContextGormLogger takes a context as input and returns a pointer to a SimpleSafeSlice of strings
func NewDBConnection ¶ added in v0.0.6
func NewDBConnection(connector DBConnector, cfg Config) (gorm.Dialector, error)
NewDBConnection establishes a new database connection.
func WithContextGormLogger ¶ added in v0.0.8
func WithContextGormLogger(ctx context.Context, w *threadsafe.SimpleSafeSlice[string]) context.Context
WithContextGormLogger takes a context and threadsafe slice (string) as inputs and returns a new context with a value
Types ¶
type DBConnector ¶ added in v0.0.6
DBConnector represents an interface for establishing database connections.
type MySQLDialector ¶ added in v0.0.6
type MySQLDialector struct{}
MySQLDialector is the MySQL database connection
func (*MySQLDialector) OpenConnection ¶ added in v0.0.6
func (d *MySQLDialector) OpenConnection(cfg Config) (gorm.Dialector, error)
OpenConnection opens a new MySQL connection
type PostgreSQLDialector ¶ added in v0.0.6
type PostgreSQLDialector struct{}
PostgreSQLDialector is the PostgreSQL database connection
func (*PostgreSQLDialector) OpenConnection ¶ added in v0.0.6
func (d *PostgreSQLDialector) OpenConnection(cfg Config) (gorm.Dialector, error)
OpenConnection opens a new PostgreSQL connection
Click to show internal directories.
Click to hide internal directories.