Documentation ¶
Index ¶
- func Create(ctx context.Context, p Prepared, dialect goqu.DialectWrapper, ...) error
- func Select(ctx context.Context, q Query, dialect goqu.DialectWrapper, ds DatabaseSelect, ...) error
- func Update(ctx context.Context, p Prepared, dialect goqu.DialectWrapper, ...) error
- type DatabaseCreate
- type DatabaseSelect
- type DatabaseUpdate
- type Prepared
- type Query
- type Selectable
- type Storable
- type Updatable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(ctx context.Context, p Prepared, dialect goqu.DialectWrapper, dc DatabaseCreate) error
Create is a general solution for adding values to a Prepared implementation
func Select ¶
func Select(ctx context.Context, q Query, dialect goqu.DialectWrapper, ds DatabaseSelect, where ...exp.Expression) error
Select is a general solution for getting data from a Query implementation
Types ¶
type DatabaseCreate ¶
type DatabaseCreate struct { Fields []interface{} Values []interface{} ReturningColumns []interface{} Receivers []interface{} Table string }
DatabaseCreate is the result of a Storable call
type DatabaseSelect ¶
type DatabaseSelect struct { Fields []interface{} Receivers []interface{} Table string }
DatabaseSelect is the result of a Selectable call
type DatabaseUpdate ¶
type DatabaseUpdate struct { Records map[string]interface{} Where []exp.Expression Table string }
DatabaseUpdate is the result of a Updatable call
type Prepared ¶
Prepared is a definition for anything implement the PrepareContext. This can be a single database statement or a database transaction statement as well.
type Query ¶
type Query interface {
QueryContext(ctx context.Context, query string, elements ...interface{}) (*sql.Rows, error)
}
Query is a definition for anything implement the PrepareContext. This can be a single database statement or a database transaction statement as well.
type Selectable ¶
type Selectable interface {
Select(opts ...interface{}) (DatabaseSelect, error)
}
Selectable defines whether a struct can be retrieved from the database
type Storable ¶
type Storable interface {
Create(transactionID string) (DatabaseCreate, error)
}
Storable defines whether a struct can be persisted to database or not
type Updatable ¶
type Updatable interface {
Update(transactionID string) (DatabaseUpdate, error)
}
Updatable defines whether a struct can be updated if it's already exists in the database