core_db

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbSource

type DbSource struct {
	DriverName     string `json:"driverName" yaml:"driver-name"`
	DataSourceName string `json:"dataSourceName" yaml:"data-source-name"`
}

func (*DbSource) OpenConnection

func (s *DbSource) OpenConnection() (*sqlx.DB, error)

func (*DbSource) UseConnection

func (s *DbSource) UseConnection(f func(*sqlx.DB) error) error

func (*DbSource) UseTransaction

func (s *DbSource) UseTransaction(db *sqlx.DB, opts *sql.TxOptions, f func(*sqlx.Tx) error) error

type IDbConnection

type IDbConnection interface {
	sqlx.Queryer
	sqlx.Execer

	DriverName() string

	Get(dest any, query string, args ...any) error

	Select(dest any, query string, args ...any) error

	NamedQuery(query string, arg any) (*sqlx.Rows, error)

	NamedExec(query string, arg any) (sql.Result, error)
}

Jump to

Keyboard shortcuts

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