dbutil

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: LGPL-2.1 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDBConnection added in v0.0.6

func NewDBConnection(connector DBConnector, cfg config.DB) (gorm.Dialector, error)

NewDBConnection establishes a new database connection.

Types

type DBConnector added in v0.0.6

type DBConnector interface {
	OpenConnection(cfg config.DB) (gorm.Dialector, error)
}

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.DB) (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.DB) (gorm.Dialector, error)

OpenConnection opens a new PostgreSQL connection

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL