database

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenDB

func OpenDB(dbType string, config *DataSourceName) (*sql.DB, error)

Get a connection to a database and return connection pool

Types

type DataSourceName

type DataSourceName struct {
	Host         string
	Port         string
	User         string
	Password     string
	DatabaseName string
	SslMode      string
}

type Database

type Database struct {
	DataType string
	Pool     *sql.DB
}

func (*Database) NewSession

func (a *Database) NewSession() db.Session

NewSession creates a new sqlbuilder.Session instance based on the configured database type. Returns nil if no database is configured.

Directories

Path Synopsis
Package migrations provides database migration utilities built on top of golang-migrate.
Package migrations provides database migration utilities built on top of golang-migrate.

Jump to

Keyboard shortcuts

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