title: Haskell - persistent error while trying to query just-created table
body: <p>I'm trying to query a sqlite table using persistent, but getting a message saying the table doesn't exist, right after the message saying it was created.</p>
  
  <pre><code>Migrating: CREATE TABLE "Post"("id" INTEGER PRIMARY KEY,"content" VARCHAR NOT NULL)
  user error (SQLite3 returned ErrorError while attempting to perform prepare "SELECT \"content\" FROM \"Post\" WHERE \"id\"=?": no such table: Post)
  </code></pre>
  
  <p>This is the code I am running (it's for a <code>scotty</code> web app so there is some scotty specific stuff in here)</p>
  
  <pre><code>runDb $ runMigration migrateAll --to create the table
  liftIO $ runDb $ insert $ Post $ decodeUtf8 $ toStrict image --to attempt to insert the data, this is what fails
  </code></pre>
  
  <p>Here are my definitions of those functions:</p>
  
  <pre><code>share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistUpperCase|
  Post
      content Text
  |]
  
  runDb :: SqlPersist (ResourceT IO) a -&gt; IO a
  runDb query = runResourceT . withSqliteConn ":memory:" . runSqlConn $ query
  </code></pre>
  
  <p>It seems to be claiming to create the table but not actually doing so.</p>