title: EFCore Bulk Insert & SQLite In Memory: no such table: INFORMATION_SCHEMA.COLUMNS"
body: <p>I'm using <a href="https://github.com/borisdj/EFCore.BulkExtensions" rel="nofollow noreferrer">EFCore BulkExtensions</a> 2.5.0 with Entity Framework Core 2.2.3 and EFCore.SQLite 2.2.6.</p>
  <p>I have code like this:</p>
  <pre class="lang-cs prettyprint-override"><code>// Repo that throws exception on BulkInsert
  public class UserRepository
  {
     private readonly IDbContextProvider&lt;ReportContext&gt; _dbContextProvider;
    
     public async Sync(IList&lt;User&gt; users)
     { 
          await _dbContextProvider.Context.BulkInserOrUpdateAsync(users);
     }
  }
  
  // Poco Model
  public class User
  {
     public string Id {get;set;}
     public string Name {get; set;}
  }
  
  // Simple DbContext
  public class ReportsContext : DbContext
  {
     public DbSet&lt;User&gt; Users { get; set; }
  }
  </code></pre>
  <p>My application code (which uses <code>EFCore.Sql</code>) runs this just fine. But when my test code runs using SQLite in-memory, I get an exception:</p>
  <blockquote>
  <p>No such table: INFORMATION_SCHEMA.COLUMNS</p>
  <p>Microsoft.Data.Sqlite.SqliteException : SQLite Error 1: 'no such table: INFORMATION_SCHEMA.COLUMNS'.</p>
  <p>at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)<br />
  at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()<br />
  at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)<br />
  at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)<br />
  at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)<br />
  at EFCore.BulkExtensions.TableInfo.CheckHasIdentityAsync(DbContext context, CancellationToken cancellationToken)<br />
  at EFCore.BulkExtensions.SqlBulkOperation.MergeAsync[T](DbContext context, IList<code>1 entities, TableInfo tableInfo, OperationType operationType, Action</code>1 progress, CancellationToken cancellationToken)<br />
  at MyCode.Repositories.UserRepository.&lt;&gt;c__DisplayClass5_0.&lt;b__0&gt;d.MoveNext() in C:\projects\MyCode\Repositories\UserRepository.cs:line 48</p>
  </blockquote>
  <p><code>INFORMATION_SCHEMA.COLUMNS</code> isn't part of my data model and isn't something I'm trying to create or work with. Do I need to configure or tweak EF Core or SQLite to get it to support bulk operations when operation in-memory mode?</p>
  <p>I've tried <a href="https://docs.microsoft.com/en-us/ef/core/miscellaneous/logging?tabs=v3" rel="nofollow noreferrer">turning on EF Core logging</a> and can see my Db Model being processed and tables being created, but no output on the bulk operations, so I'm unsure what generated SQL statements are looking for this <code>Information_Schema.Columns</code> table.</p>