a simple sql engine in erlang