public override void Visit(WSqlBatch node) { for (int i = 0; i < node.Statements.Count; i++) { var statement = node.Statements[i]; if (statement is WSelectStatement) { var sqlSelect = statement as WSelectStatement; node.Statements[i] = ConvertSqlSelectStatement(sqlSelect); } else if (statement is WInsertSpecification) { var sqlInsert = statement as WInsertSpecification; node.Statements[i] = ConvertSqlInsertStatement(sqlInsert); } else if (statement is WDeleteSpecification) { var sqlDelete = statement as WDeleteSpecification; node.Statements[i] = ConvertSqlDeleteStatement(sqlDelete); } else { statement.Accept(this); } } }
private WSqlFragment ConvertFragment(TSqlFragment fragment) { var tscript = fragment as TSqlScript; var wscript = new WSqlScript { FirstTokenIndex = tscript.FirstTokenIndex, LastTokenIndex = tscript.LastTokenIndex, Batches = tscript.Batches == null ? null : new List<WSqlBatch>(tscript.Batches.Count), }; foreach (var tbatch in tscript.Batches) { var wbatch = new WSqlBatch { FirstTokenIndex = tbatch.FirstTokenIndex, LastTokenIndex = tbatch.LastTokenIndex, Statements = new List<WSqlStatement>(tbatch.Statements.Count), }; foreach (var wstat in tbatch.Statements.Select(ParseStatement)) { wbatch.Statements.Add(wstat); } wscript.Batches.Add(wbatch); } return wscript; }
public virtual void Visit(WSqlBatch node) { node.AcceptChildren(this); }
public override void Visit(WSqlBatch node) { base.Visit(node); node.Statements = Translate(node.Statements); }
public override void Visit(WSqlBatch node) { base.Visit(node); ConvertToGraphModificationStatement(node.Statements); }