refactor: use transaction to go brr. This improve the restore speed on fresh db and non fresh db. Signed-off-by: KaiserBh <kaiserbh@proton.me>