public void Can_BulkCopy() { var data = CreateTable(); var manifestObject = GetJsonFile <DatabaseJobManifest>(_inputRoot, "database.manifest.mysql.json"); var inputSqlQueries = GetJsonFile <TargetSql>(_inputRoot, "mysql.target.ateam.json"); MySqlWriter target = new MySqlWriter(); target.ExecuteSqlText(connectionString, inputSqlQueries.SetupTempDml); //Temp Table Created at this stage {ex8_temp_ATeam} var outputNOfRecords = target.BulkCopy(connectionString, manifestObject.manifest.tables[0], data); // copy records into temp. table {ex8_temp_ATeam} data.Rows.Count.Should().Be(outputNOfRecords); }
public void UploadTable_SetupSource() { var data = CreateTable("Pre", 500000); var manifestObject = GetJsonFile <DatabaseJobManifest>(_inputRoot, "database.manifest.mysql.json"); var table = manifestObject.manifest.tables[0]; table.temp_name = table.qualified_table_name; //initialized Table-TempName with ATeam Table var target = new MySqlWriter(); target.ExecuteSqlText(connectionString, new List <string> { $"truncate table {table.temp_name}" }); // Cleaning the ATeam Table first before adding these records with data var outputnoOfRecord = target.BulkCopy(connectionString, table, data); // This call should copy records from data to ATeam directly. data.Rows.Count.Should().Be(outputnoOfRecord); }