dbutil

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: LGPL-2.1 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

NewDBConnection establishes a new database connection.

Types

type Config added in v0.0.3

type Config struct {
	Username, Password, Host, Params, Database string
	Port                                       int
}

Config stores configurations

type DBConnector added in v0.0.6

type DBConnector interface {
	OpenConnection(cfg Config) (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) (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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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