private static Compiler GetCompiler(this IDatabase db)
 {
     if (DefaultCompilers.TryGetCustom(db.Provider, out var compiler))
     {
         return(compiler);
     }
     else
     {
         return(db.Provider.ToCompiler());
     }
 }
        public void Adding_And_Removing_Custom_Works()
        {
            var provider = new MyDatabaseProvider();

            DefaultCompilers.TryGetCustom(provider.GetType(), out var compiler).Should().BeFalse();

            DefaultCompilers.RegisterFor <MyDatabaseProvider>(new PercentCompiler());

            DefaultCompilers.TryGetCustom(provider, out compiler).Should().BeTrue();
            compiler.Should().BeOfType <PercentCompiler>();

            DefaultCompilers.RegisterFor <MyDatabaseProvider>(null);
            DefaultCompilers.TryGetCustom(provider.GetType(), out compiler).Should().BeFalse();
        }