public static string RenameColumnInOrderBy(string inputText , DBMSType dbmsType , Dictionary <string, string> placeHolders = null) { var ast = MiniSqlParserAST.CreateStmts(inputText, dbmsType); // テスト用テーブル列 var tableColumns = new BestCaseDictionary <IEnumerable <string> >(); var tableT = new string[] { "x", "y", "z" }; tableColumns.Add("T", tableT); var tableU = new string[] { "x", "y", "z" }; tableColumns.Add("U", tableU); var tableV = new string[] { "x1", "x2", "x3" }; tableColumns.Add("V", tableV); var replacer = new ReplacePlaceHolders(placeHolders); ast.Accept(replacer); var visitor = new NormalizeOrderByVisitor(tableColumns, true); ast.Accept(visitor); var stringifier = new BeautifulStringifier(144); ast.Accept(stringifier); return(stringifier.ToString()); }
public static string GetCNF(string inputText , DBMSType dbmsType , Dictionary <string, string> placeHolders = null) { var ast = MiniSqlParserAST.CreateStmts(inputText, dbmsType); // テスト用テーブル列 var tableColumns = new BestCaseDictionary <IEnumerable <string> >(); var tableT = new string[] { "x", "y", "z" }; tableColumns.Add("T", tableT); var tableU = new string[] { "x", "y", "z" }; tableColumns.Add("U", tableU); var tableV = new string[] { "x1", "x2", "x3" }; tableColumns.Add("V", tableV); var replacer = new ReplacePlaceHolders(placeHolders); ast.Accept(replacer); var visitor = new GetCNFVisitor(tableColumns, true); ast.Accept(visitor); return(visitor.Print(true)); }
public void initTest() { // テスト用テーブル列 _tableColumns = new BestCaseDictionary <IEnumerable <string> >(); var tableT = new string[] { "x", "y", "z" }; _tableColumns.Add("T", tableT); var tableU = new string[] { "x", "y", "z" }; _tableColumns.Add("U", tableU); var tableV = new string[] { "x1", "x2", "x3" }; _tableColumns.Add("V", tableV); }