#include "__sql.h"
#include "Exception.h"
#include "MString.h"
#include "__mysql.h"
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>

namespace jet {
   
   __sql::__sql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, local) {
      output = false;
      if(!hasContainer)
	throw coreutils::Exception("sql tag must have a container.");	
      if(!global.sessionExists(keywords["sessionid"]))
	throw coreutils::Exception("sessionid does not exist.");
      processContainer(container);
      global.getSession(keywords[resolveKeyword("sessionid")])->query(out);
   }
   
}
