cgi/graph: SQL version

This enables a full SQL CGI.