Documentation ¶
Index ¶
- type DbProvider
- type DbProviderMock
- func (provider DbProviderMock) Close() error
- func (provider DbProviderMock) Config() config.DatabaseConnection
- func (provider DbProviderMock) ConnString() (string, error)
- func (provider DbProviderMock) Open() error
- func (provider DbProviderMock) Ping() error
- func (provider DbProviderMock) PrepareQuery(template string, params ...QueryParam) (query string, args []interface{})
- func (provider DbProviderMock) QueryContext(ctx context.Context, template string, params ...QueryParam) (*sql.Rows, error)
- type MySqlDbProvider
- func (provider *MySqlDbProvider) Close() error
- func (provider *MySqlDbProvider) Config() config.DatabaseConnection
- func (provider *MySqlDbProvider) ConnString() (string, error)
- func (provider *MySqlDbProvider) Open() error
- func (provider *MySqlDbProvider) Ping() error
- func (provider *MySqlDbProvider) PrepareQuery(template string, params ...QueryParam) (query string, args []interface{})
- func (provider *MySqlDbProvider) QueryContext(ctx context.Context, template string, params ...QueryParam) (*sql.Rows, error)
- type PostgresDbProvider
- func (provider *PostgresDbProvider) Close() error
- func (provider *PostgresDbProvider) Config() config.DatabaseConnection
- func (provider *PostgresDbProvider) ConnString() (string, error)
- func (provider *PostgresDbProvider) Open() error
- func (provider *PostgresDbProvider) Ping() error
- func (provider *PostgresDbProvider) PrepareQuery(template string, params ...QueryParam) (query string, args []interface{})
- func (provider *PostgresDbProvider) QueryContext(ctx context.Context, template string, params ...QueryParam) (*sql.Rows, error)
- type QueryParam
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{} }
Click to show internal directories.
Click to hide internal directories.