示例#1
0
// SQLUpdate updates all record in the database @todo.
// Generated via tableToStruct.
func (s *TableStoreSlice) SQLUpdate(dbrSess dbr.SessionRunner, cbs ...dbr.UpdateCb) (int, error) {
	return 0, nil
}

// SQLDelete deletes all record from the database @todo.
// Generated via tableToStruct.
func (s *TableStoreSlice) SQLDelete(dbrSess dbr.SessionRunner, cbs ...dbr.DeleteCb) (int, error) {
	return 0, nil
}

// ErrIDNotFoundTableStoreSlice gets returned when an ID cannot be found in a TableStoreSlice slice.
// Generated via tableToStruct.
var ErrIDNotFoundTableStoreSlice = csdb.NewError("ID not found in TableStoreSlice")

// FindByStoreID searches the primary keys and returns a
// *TableStore if found or an error.
// Generated via tableToStruct.
func (s TableStoreSlice) FindByStoreID(
	store_id int64,
) (*TableStore, error) {
	for _, u := range s {
		if u != nil && u.StoreID == store_id {
			return u, nil
		}
	}
	return nil, ErrIDNotFoundTableStoreSlice
}
示例#2
0
func TestError(t *testing.T) {
	assert.Equal(t, "err123", csdb.NewError("err123").Error())
	assert.Equal(t, "err 123", csdb.NewErrorf("err %v", 123).Error())
}