Beispiel #1
0
        public void UploadTable_LoadTest()
        {
            int recordCount = 500000;
            var data        = CreateTable("Post", recordCount);

            var manifestObject = GetJsonFile <DatabaseJobManifest>(_inputRoot, "database.manifest.xepdb1.json");
            var sql            = GetJsonFile <TargetSql>(_inputRoot, "xepdb1.target.person.json");

            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start(); // start timer

            var target = new OracleSqlWriter();

            target.UploadTable(connectionString,
                               sql.SetupTempDml,
                               manifestObject.manifest.tables[0],
                               data,
                               new List <string> {
                sql.UpdateFromTempDml, sql.ClearTempDml
            });

            stopwatch.Stop();                        // end timer
            var ElapsedDuration = stopwatch.Elapsed; // this is the elapsed duration now for updating RecordsCount records in table database

            WriteLogCsvFile(new CsvLogger {
                TestDate = DateTime.Now, NoOfRecords = recordCount, TimeElapsed = ElapsedDuration
            });
        }
        public void Can_BulkCopy()
        {
            var data           = CreateTable();
            var manifestObject = GetJsonFile <DatabaseJobManifest>(_inputRoot, "database.manifest.xepdb1.json");

            OracleSqlWriter target           = new OracleSqlWriter();
            var             outputnoOfRecord = target.BulkCopy(connectionString, manifestObject.manifest.tables[0], data);

            data.Rows.Count.Should().Be(outputnoOfRecord);
        }
Beispiel #3
0
        public void UploadTable_SetupSource()
        {
            var data           = CreateTable("Pre", 60000);
            var manifestObject = GetJsonFile <DatabaseJobManifest>(_inputRoot, "database.manifest.xepdb1.json");
            var table          = manifestObject.manifest.tables[0];

            table.temp_name = table.qualified_table_name; //initializing Table-TempName with Person Table

            var target = new OracleSqlWriter();

            target.ExecuteSqlText(connectionString, new List <string> {
                $"truncate table {table.temp_name}"
            });                                                                    // Cleaning the Person Table first before adding these records with data

            var outputnoOfRecord = target.BulkCopy(connectionString, table, data); // This call should copy records from data to Persons directly.

            data.Rows.Count.Should().Be(outputnoOfRecord);
        }
        public void CanUploadTable()
        {
            var manifestObject = GetJsonFile <DatabaseJobManifest>(_inputRoot, "database.manifest.xepdb1.json");
            var sql            = GetJsonFile <TargetSql>(_inputRoot, "xepdb1.target.person.json");
            var data           = CreateTable();

            var target = new OracleSqlWriter();

            target.UploadTable(connectionString,
                               sql.SetupTempDml,
                               manifestObject.manifest.tables[0],
                               data,
                               new List <string> {
                sql.UpdateFromTempDml, sql.ClearTempDml
            });

            var reader = new OracleSqlReader();
            var result = reader.GetData(connectionString, $"select * from TEST_USER.Person");

            result.Tables.Should().NotBeEmpty();
            result.Tables[0].Rows.Should().NotBeEmpty();
        }