driver

package
v0.0.0-...-8f4226c Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	POSTGRES = "postgres"
	MYSQL    = "mysql"
	MONGO    = "mongo"
)

Variables

This section is empty.

Functions

func ChooseDriver

func ChooseDriver(driver string) (driver, error)

ChooseDriver The ChooseDriver function is used to retrieve a database driver's connection object based on the given driver name. It takes a string parameter driver, which represents the type of the database driver. The purpose of this function is to provide a convenient way to establish a connection to various types of databases without exposing the underlying implementation details. It encapsulates the logic required to select the appropriate connection method for a specific database driver and returns an instance of the corresponding driver's connection object.

Types

type Mysql

type Mysql struct {
	// contains filtered or unexported fields
}

func (*Mysql) Close

func (ms *Mysql) Close() error

Close

func (*Mysql) Connect

func (ms *Mysql) Connect(param entity.Options) error

initiate connection with mysql

func (*Mysql) Pool

func (ms *Mysql) Pool() interface{}

Pool

type Postgres

type Postgres struct {
	// contains filtered or unexported fields
}

func (*Postgres) Close

func (ps *Postgres) Close() error

func (*Postgres) Connect

func (ps *Postgres) Connect(param entity.Options) error

initiate connection with postgres

func (*Postgres) Pool

func (ms *Postgres) Pool() interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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