<commit_before>﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.Text;

using Hadouken.Data;
using Migrator.Providers.SQLite;
using System.IO;
using Hadouken.Configuration;

namespace Hadouken.Impl.Data
{
    public class DefaultMigratorRunner : IMigrationRunner
    {
        public void Up(Assembly target)
        {
            string dataPath = HdknConfig.GetPath("Paths.Data");
            string connectionString = HdknConfig.ConnectionString.Replace("$Paths.Data$", dataPath);

            var m = new Migrator.Migrator(new SQLiteTransformationProvider(new SQLiteDialect(), connectionString), target, false);
            m.MigrateToLastVersion();
        }

        public void Down(Assembly target)
        {
            string dataPath = HdknConfig.GetPath("Paths.Data");
            string connectionString = HdknConfig.ConnectionString.Replace("$Paths.Data$", dataPath);

            var m = new Migrator.Migrator(new SQLiteTransformationProvider(new SQLiteDialect(), connectionString), target, false);
            m.MigrateTo(-1);
        }
    }
}
<commit_msg>Fix for when inserting rows with {} in them.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.Text;

using Hadouken.Data;
using Migrator.Providers.SQLite;
using System.IO;
using Hadouken.Configuration;
using Migrator.Framework;

namespace Hadouken.Impl.Data
{
    public class DefaultMigratorRunner : IMigrationRunner
    {
        public void Up(Assembly target)
        {
            string dataPath = HdknConfig.GetPath("Paths.Data");
            string connectionString = HdknConfig.ConnectionString.Replace("$Paths.Data$", dataPath);

            var m = new Migrator.Migrator(new SQLiteTransformationProvider(new SQLiteDialect(), connectionString), target, false, new FooLogger());
            m.MigrateToLastVersion();
        }

        public void Down(Assembly target)
        {
            string dataPath = HdknConfig.GetPath("Paths.Data");
            string connectionString = HdknConfig.ConnectionString.Replace("$Paths.Data$", dataPath);

            var m = new Migrator.Migrator(new SQLiteTransformationProvider(new SQLiteDialect(), connectionString), target, false);
            m.MigrateTo(-1);
        }
    }

    public class FooLogger : ILogger
    {
        public void ApplyingDBChange(string sql)
        {
        }

        public void Exception(string message, Exception ex)
        {
        }

        public void Exception(long version, string migrationName, Exception ex)
        {
        }

        public void Finished(List<long> currentVersion, long finalVersion)
        {
        }

        public void Log(string format, params object[] args)
        {
        }

        public void MigrateDown(long version, string migrationName)
        {
        }

        public void MigrateUp(long version, string migrationName)
        {
        }

        public void RollingBack(long originalVersion)
        {
        }

        public void Skipping(long version)
        {
        }

        public void Started(List<long> currentVersion, long finalVersion)
        {
        }

        public void Trace(string format, params object[] args)
        {
        }

        public void Warn(string format, params object[] args)
        {
        }
    }

}

{'fraction_non_alphanumeric': 0.08548206278026906, 'fraction_numerical': 0.0005605381165919282, 'mean_word_length': 2.2534184138559707, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3950298', 'n_tokens_mistral': 973, 'n_tokens_neox': 943, 'n_words': 222}