diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,9 @@
 # Changelog for pantry
 
+## v0.5.2.3
+
+* Support for GHC 9 [#39](https://github.com/commercialhaskell/pantry/pull/39)
+
 ## v0.5.2.2
 
 * Support for Cabal 3.4 [#38](https://github.com/commercialhaskell/pantry/pull/38)
diff --git a/pantry.cabal b/pantry.cabal
--- a/pantry.cabal
+++ b/pantry.cabal
@@ -7,7 +7,7 @@
 -- hash: 290314cf42f0f169e5cb395c4b35e867438c4e2652df972ec59c548dc39f1b6d
 
 name:           pantry
-version:        0.5.2.2
+version:        0.5.2.3
 synopsis:       Content addressable Haskell package management
 description:    Please see the README on Github at <https://github.com/commercialhaskell/pantry#readme>
 category:       Development
diff --git a/src/Pantry/Storage.hs b/src/Pantry/Storage.hs
--- a/src/Pantry/Storage.hs
+++ b/src/Pantry/Storage.hs
@@ -271,8 +271,9 @@
   :: (HasPantryConfig env, HasLogFunc env)
   => ReaderT SqlBackend (RIO env) a
   -> RIO env a
-withStorage action =
-  flip SQLite.withStorage_ action =<< view (P.pantryConfigL.to P.pcStorage)
+withStorage action = do
+  storage <- view (P.pantryConfigL.to P.pcStorage)
+  SQLite.withStorage_ storage action
 
 -- | This is a helper type to distinguish db queries between different rdbms backends. The important
 -- part is that the affects described in this data type should be semantically equivalent between
