cgi/graph: SQL version

This enables a full SQL CGI.

**not ready yet**