sql backend: basic partial implementation and some tests