public void TestIsNull() { DTOQuery inputQuery = new DTOQuery(); inputQuery.QueryText = "Student.name;"; IQueryAnalyzer analizer = new EBNFQueryAnalyzer(); analizer.ParseQuery(inputQuery); }
public void TestQueryElementView() { DTOQuery inputQuery = new DTOQuery(); inputQuery.QueryText = "Student where na==2 and bc==3;"; IQueryAnalyzer analizer = new EBNFQueryAnalyzer(); var queryTree = analizer.ParseQuery(inputQuery); QueryPlanTree queryPlanTree = QueryOptimizer.BuildTreeSummary(queryTree, new QueryParameters()); // queryTree.GetComposite().elements[ElementType.SELECT]; SelectStatement query_elements = (SelectStatement)analizer.ParseQuery(inputQuery); // queryTree.GetComposite().GetElement(ElementType.WHERE).GetComposite().GetElement(ElementType.COMPERISION).GetComposite().GetElement(ElementType.LEFT_OPERAND).GetComposite().GetElement(ElementType.CLASS_PROPERTY); var elements = query_elements.GetElements(); //var test = QueryOptimizer.findElementType(queryTree, ElementType.CLASS_PROPERTY); ClassProperty classProperty = new ClassProperty(); Console.WriteLine(elements[ElementType.CLASS_NAME].ToString()); SelectStatement s = new SelectStatement(); }
public void TestQueryElementView() { DTOQuery inputQuery = new DTOQuery(); inputQuery.QueryText = "Student WHERE name IS NULL;"; IQueryAnalyzer analizer = new EBNFQueryAnalyzer(); var queryTree = analizer.ParseQuery(inputQuery); Console.WriteLine(queryTree.ToString()); //SelectStatement query_elements = queryTree.GetComposite(); SelectStatement s = new SelectStatement(); Console.WriteLine("DUPA"); }