I started thinking of other variants of melee attacks like the booming blade. The thing I came with is as follows:
Make an attack with a melee weapon. When you hit, you deal extra damage plus 1d4 necrotic damage and the target makes a Constitution save roll against your DC spell, in case of failure, you heal the amount of damage you take.
Spell damage increases by 1d4 when you reach the 5th level (2d4), the 11th level (3d4) and the 17th level (4d4).
The problem with this cantrip is that the DMG (p.284) clearly states that a cantrip should not offer healing.
The question then is whether a small surplus of damage, a saving throw of the Constitution and the possible additive to solve the attack damage by weapon first, to prevent the player from abusing the wildlife and easy-to-reach goals to make it workable?
Or should it look more like a heavier version of vampiric touch (PHB 285).
Make it a level 2 spell, a concentration of 1 min, an additional 1d6 point of damage, a care equal to half of a shot, and for each second spell slot used above the 2nd, add 1d6 damage?