LINQPad, LLBLGENPro and Npgsql

If you want to test LLBLGenPro/Npgsql queries with LINQPad, and you really should, you have to follow these steps.

  1. Install the official LLBLGenPro driver for LINQPad (Add connection, View more drivers…, …)
  2. Reference LLBLGenPro generated assemblies (connection configuration), enter proper connection strings and, albeit optional, provide a .config file that contains DBProviderFactiories entry for Npgsql (watch out for version number)
  3. Once connection is created, add Npgsql NuGet package to query. The version should match the one configured in step #2.

And voila, beautiful interactive queries at your disposal. You can even use ORM Profiler.

Sample Npgsql factory entry:

....
<system.data>
    <DbProviderFactories>
      <!-- PostgreSql -->
      <add name="PostgreSql Client Data Provider" invariant="Npgsql" description=".Net Framework Data Provider for PostgreSql" type="Npgsql.NpgsqlFactory, Npgsql, Version=3.1.6.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7" />
    </DbProviderFactories>
  </system.data>

Leave a Reply