refactor
refactor
simple sqlwrite