db_provider

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbProvider

type DbProvider interface {
	Config() config.DatabaseConnection
	ConnString() (string, error)
	Open() error
	Close() error
	Ping() error
	PrepareQuery(template string, params ...QueryParam) (query string, args []interface{})
	QueryContext(ctx context.Context, template string, params ...QueryParam) (*sql.Rows, error)
}

func NewDbProvider

func NewDbProvider(dataType config.DataType, cfg config.DatabaseConnection) DbProvider

type DbProviderMock

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

func NewDbProviderMock

func NewDbProviderMock() (*DbProviderMock, sqlmock.Sqlmock, error)

func (DbProviderMock) Close

func (provider DbProviderMock) Close() error

func (DbProviderMock) Config

func (provider DbProviderMock) Config() config.DatabaseConnection

func (DbProviderMock) ConnString

func (provider DbProviderMock) ConnString() (string, error)

func (DbProviderMock) Open

func (provider DbProviderMock) Open() error

func (DbProviderMock) Ping

func (provider DbProviderMock) Ping() error

func (DbProviderMock) PrepareQuery

func (provider DbProviderMock) PrepareQuery(template string, params ...QueryParam) (query string, args []interface{})

func (DbProviderMock) QueryContext

func (provider DbProviderMock) QueryContext(ctx context.Context, template string, params ...QueryParam) (*sql.Rows, error)

type MySqlDbProvider

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

func (*MySqlDbProvider) Close

func (provider *MySqlDbProvider) Close() error

func (*MySqlDbProvider) Config

func (provider *MySqlDbProvider) Config() config.DatabaseConnection

func (*MySqlDbProvider) ConnString

func (provider *MySqlDbProvider) ConnString() (string, error)

func (*MySqlDbProvider) Open

func (provider *MySqlDbProvider) Open() error

func (*MySqlDbProvider) Ping

func (provider *MySqlDbProvider) Ping() error

func (*MySqlDbProvider) PrepareQuery

func (provider *MySqlDbProvider) PrepareQuery(template string, params ...QueryParam) (query string, args []interface{})

func (*MySqlDbProvider) QueryContext

func (provider *MySqlDbProvider) QueryContext(ctx context.Context, template string, params ...QueryParam) (*sql.Rows, error)

type PostgresDbProvider

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

func (*PostgresDbProvider) Close

func (provider *PostgresDbProvider) Close() error

func (*PostgresDbProvider) Config

func (provider *PostgresDbProvider) Config() config.DatabaseConnection

func (*PostgresDbProvider) ConnString

func (provider *PostgresDbProvider) ConnString() (string, error)

func (*PostgresDbProvider) Open

func (provider *PostgresDbProvider) Open() error

func (*PostgresDbProvider) Ping

func (provider *PostgresDbProvider) Ping() error

func (*PostgresDbProvider) PrepareQuery

func (provider *PostgresDbProvider) PrepareQuery(template string, params ...QueryParam) (query string, args []interface{})

func (*PostgresDbProvider) QueryContext

func (provider *PostgresDbProvider) QueryContext(ctx context.Context, template string, params ...QueryParam) (*sql.Rows, error)

type QueryParam

type QueryParam struct {
	Name  string
	Value interface{}
}

Jump to

Keyboard shortcuts

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