Documentation
¶
Index ¶
- type DatabaseAdapter
- func (a *DatabaseAdapter) Begin(ctx context.Context, opts *domain.TxOptions) (domain.Tx, error)
- func (a *DatabaseAdapter) Exec(ctx context.Context, statement string, args ...interface{}) (domain.Result, error)
- func (a *DatabaseAdapter) Query(ctx context.Context, query string, args ...interface{}) (domain.Rows, error)
- type DatabaseRepository
- type ResultAdapter
- type RowsAdapter
- type TxAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseAdapter ¶
type DatabaseAdapter struct {
// contains filtered or unexported fields
}
DatabaseAdapter adapts the db.Database to the domain.Database interface
type DatabaseRepository ¶
type DatabaseRepository struct{}
DatabaseRepository implements domain.DatabaseRepository
func NewDatabaseRepository ¶
func NewDatabaseRepository() *DatabaseRepository
NewDatabaseRepository creates a new database repository
func (*DatabaseRepository) GetDatabase ¶
func (r *DatabaseRepository) GetDatabase(id string) (domain.Database, error)
GetDatabase retrieves a database by ID
func (*DatabaseRepository) GetDatabaseType ¶ added in v1.6.0
func (r *DatabaseRepository) GetDatabaseType(id string) (string, error)
GetDatabaseType returns the type of a database by ID
func (*DatabaseRepository) ListDatabases ¶
func (r *DatabaseRepository) ListDatabases() []string
ListDatabases returns a list of available database IDs
type ResultAdapter ¶
type ResultAdapter struct {
// contains filtered or unexported fields
}
ResultAdapter adapts sql.Result to domain.Result
func (*ResultAdapter) LastInsertId ¶
func (a *ResultAdapter) LastInsertId() (int64, error)
LastInsertId returns the last insert ID
func (*ResultAdapter) RowsAffected ¶
func (a *ResultAdapter) RowsAffected() (int64, error)
RowsAffected returns the number of rows affected
type RowsAdapter ¶
type RowsAdapter struct {
// contains filtered or unexported fields
}
RowsAdapter adapts sql.Rows to domain.Rows
func (*RowsAdapter) Columns ¶
func (a *RowsAdapter) Columns() ([]string, error)
Columns returns the column names
func (*RowsAdapter) Err ¶
func (a *RowsAdapter) Err() error
Err returns any error that occurred during iteration
func (*RowsAdapter) Scan ¶
func (a *RowsAdapter) Scan(dest ...interface{}) error
Scan scans the current row
type TxAdapter ¶
type TxAdapter struct {
// contains filtered or unexported fields
}
TxAdapter adapts sql.Tx to domain.Tx
func (*TxAdapter) Exec ¶
func (a *TxAdapter) Exec(ctx context.Context, statement string, args ...interface{}) (domain.Result, error)
Exec executes a statement within the transaction