Documentation
¶
Index ¶
- func Create(crud CRUD, ctx op_context.Context, methodName string, obj common.Object, ...) error
- func Delete(crud CRUD, ctx op_context.Context, methodName string, fieldName string, ...) error
- func DeleteByFields(crud CRUD, ctx op_context.Context, methodName string, fields db.Fields, ...) error
- func Exists(crud CRUD, ctx op_context.Context, methodName string, filter *db.Filter, ...) (bool, error)
- func Find[T common.Object](crud CRUD, ctx op_context.Context, methodName string, fields db.Fields, ...) (T, error)
- func FindByField[T common.Object](crud CRUD, ctx op_context.Context, methodName string, fieldName string, ...) (T, error)
- func FindOne[T common.Object](crud CRUD, ctx op_context.Context, filter *db.Filter, model T) (T, error)
- func FindUpdate[T common.Object](crud CRUD, ctx op_context.Context, methodName string, fieldName string, ...) (T, error)
- func List[T common.Object](crud CRUD, ctx op_context.Context, methodName string, filter *db.Filter, ...) (int64, error)
- func Update(crud CRUD, ctx op_context.Context, methodName string, obj common.Object, ...) error
- type CRUD
- type DbCRUD
- func (d *DbCRUD) Create(ctx op_context.Context, object common.Object) error
- func (d *DbCRUD) CreateDup(ctx op_context.Context, object common.Object, ignoreConflict ...bool) (bool, error)
- func (d *DbCRUD) Db(ctx op_context.Context) db.DBHandlers
- func (d *DbCRUD) Delete(ctx op_context.Context, object common.Object) error
- func (d *DbCRUD) DeleteByFields(ctx op_context.Context, fields db.Fields, object common.Object) error
- func (d *DbCRUD) Exists(ctx op_context.Context, filter *db.Filter, object interface{}) (bool, error)
- func (d *DbCRUD) Join(ctx op_context.Context, joinConfig *db.JoinQueryConfig, filter *db.Filter, ...) (int64, error)
- func (d *DbCRUD) List(ctx op_context.Context, filter *db.Filter, objects interface{}, ...) (int64, error)
- func (d *DbCRUD) Read(ctx op_context.Context, fields db.Fields, object interface{}, ...) (bool, error)
- func (d *DbCRUD) ReadByField(ctx op_context.Context, fieldName string, fieldValue interface{}, ...) (bool, error)
- func (d *DbCRUD) ReadForShare(ctx op_context.Context, fields db.Fields, object interface{}) (bool, error)
- func (d *DbCRUD) ReadForUpdate(ctx op_context.Context, fields db.Fields, object interface{}) (bool, error)
- func (d *DbCRUD) Update(ctx op_context.Context, obj common.Object, fields db.Fields) error
- func (d *DbCRUD) UpdateMonthObject(ctx op_context.Context, obj common.ObjectWithMonth, fields db.Fields) error
- func (d *DbCRUD) UpdateMulti(ctx op_context.Context, model interface{}, filter db.Fields, fields db.Fields) error
- func (d *DbCRUD) UpdateWithFilter(ctx op_context.Context, model interface{}, filter *db.Filter, fields db.Fields) error
- type WithCRUD
- type WithCRUDBase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteByFields ¶
func FindByField ¶
func FindUpdate ¶
Types ¶
type CRUD ¶
type CRUD interface { Create(ctx op_context.Context, object common.Object) error CreateDup(ctx op_context.Context, object common.Object, ignoreConflict ...bool) (bool, error) Read(ctx op_context.Context, fields db.Fields, object interface{}, dest ...interface{}) (bool, error) ReadByField(ctx op_context.Context, fieldName string, fieldValue interface{}, object interface{}, dest ...interface{}) (bool, error) ReadForUpdate(ctx op_context.Context, fields db.Fields, object interface{}) (bool, error) Update(ctx op_context.Context, object common.Object, fields db.Fields) error UpdateMonthObject(ctx op_context.Context, obj common.ObjectWithMonth, fields db.Fields) error UpdateMulti(ctx op_context.Context, model interface{}, filter db.Fields, fields db.Fields) error UpdateWithFilter(ctx op_context.Context, model interface{}, filter *db.Filter, fields db.Fields) error Delete(ctx op_context.Context, object common.Object) error DeleteByFields(ctx op_context.Context, field db.Fields, object common.Object) error List(ctx op_context.Context, filter *db.Filter, object interface{}, dest ...interface{}) (int64, error) Exists(ctx op_context.Context, filter *db.Filter, object interface{}) (bool, error) Join(ctx op_context.Context, joinConfig *db.JoinQueryConfig, filter *db.Filter, dest interface{}) (int64, error) Db(ctx op_context.Context) db.DBHandlers }
type DbCRUD ¶
func (*DbCRUD) Db ¶
func (d *DbCRUD) Db(ctx op_context.Context) db.DBHandlers
func (*DbCRUD) DeleteByFields ¶
func (*DbCRUD) Join ¶
func (d *DbCRUD) Join(ctx op_context.Context, joinConfig *db.JoinQueryConfig, filter *db.Filter, dest interface{}) (int64, error)
func (*DbCRUD) ReadByField ¶
func (*DbCRUD) ReadForShare ¶
func (*DbCRUD) ReadForUpdate ¶
func (*DbCRUD) UpdateMonthObject ¶
func (d *DbCRUD) UpdateMonthObject(ctx op_context.Context, obj common.ObjectWithMonth, fields db.Fields) error
func (*DbCRUD) UpdateMulti ¶
func (*DbCRUD) UpdateWithFilter ¶
type WithCRUDBase ¶
type WithCRUDBase struct {
// contains filtered or unexported fields
}
func (*WithCRUDBase) CRUD ¶
func (w *WithCRUDBase) CRUD() CRUD
func (*WithCRUDBase) Construct ¶
func (w *WithCRUDBase) Construct(cruds ...CRUD)
func (*WithCRUDBase) IsDryRun ¶
func (w *WithCRUDBase) IsDryRun() bool
func (*WithCRUDBase) IsForceMainDb ¶
func (w *WithCRUDBase) IsForceMainDb() bool
func (*WithCRUDBase) SetDryRun ¶
func (w *WithCRUDBase) SetDryRun(enable bool)
func (*WithCRUDBase) SetForceMainDb ¶
func (w *WithCRUDBase) SetForceMainDb(enable bool)
Click to show internal directories.
Click to hide internal directories.