public IQuery Execute() { var parser = factory.Instantiate(args.Source); var request = new SharedDatasetRequest(args.Source, args.Path, args.Name); var parsingResult = parser.ExtractCommand(request); var query = new Query(parsingResult.Text, args.ConnectionString, args.Timeout, args.Parameters, args.Variables, parsingResult.CommandType); return(query); }
public IDbCommand Execute() { var parser = factory.Instantiate(args.Source); var request = new SharedDatasetRequest(args.Source, args.Path, args.Name); var parsingResult = parser.ExtractCommand(request); var commandBuilder = new CommandBuilder(); var cmd = commandBuilder.Build(args.ConnectionString, parsingResult.Text, parsingResult.CommandType, args.Parameters, args.Variables, args.Timeout); return(cmd); }
public void ExtractQuery_SharedDataSet_CorrectQuery() { var request = new SharedDatasetRequest( ConnectionStringReader.GetReportServerDatabase() , "/AdventureWorks Sample Reports/" , "EmpSalesMonth" ); var parser = new DatabaseReportingParser(); var query = parser.ExtractCommand(request); Assert.That(query.Text, Does.Contain("SELECT")); Assert.That(query.CommandType, Is.EqualTo(CommandType.Text)); }
public override string GetQuery() { var parser = ParserFactory.GetParser(Source); var request = new SharedDatasetRequest ( Source, string.IsNullOrEmpty(Source) ? Settings.BasePath + Path : Path, Name ); command = parser.ExtractQuery(request); return(command.Text); }
public override string GetQuery() { var factory = new ReportingParserFactory(); var parser = factory.Instantiate(Source); var request = new SharedDatasetRequest ( Source, string.IsNullOrEmpty(Source) ? Settings.BasePath + Path : Path, Name ); command = parser.ExtractCommand(request); return(command.Text); }
public void ExtractQuery_ExistingSharedDataSet_CorrectQueryReturned() { var request = new SharedDatasetRequest( string.Empty , ReportFileDirectory , "SalesEmployees" ); var parser = new FileReportingParser(); var query = parser.ExtractCommand(request); Assert.That(query.Text, Does.Contain("SELECT").And .Contain("[Sales].[SalesPerson]").And .Contain("[HumanResources].[Employee]")); Assert.That(query.CommandType, Is.EqualTo(CommandType.Text)); }