Skip to content

Commit

Permalink
Update MySQL and Sqlite libraries to use new StatementCache mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
iand675 committed Mar 31, 2021
1 parent d340716 commit 0926409
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion persistent-mysql/Database/Persist/MySQL.hs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ open' :: MySQL.ConnectInfo -> LogFunc -> IO SqlBackend
open' ci logFunc = do
conn <- MySQL.connect ci
MySQLBase.autocommit conn False -- disable autocommit!
smap <- newIORef $ Map.empty
smap <- makeSimpleStatementCache
return $ SqlBackend
{ connPrepare = prepare' conn
, connStmtMap = smap
Expand Down
4 changes: 2 additions & 2 deletions persistent-sqlite/Database/Persist/Sqlite.hs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ wrapConnectionInfo connInfo conn logFunc = do
Sqlite.reset conn stmt
Sqlite.finalize stmt

smap <- newIORef $ Map.empty
smap <- makeSimpleStatementCache
return $ SqlBackend
{ connPrepare = prepare' conn
, connStmtMap = smap
Expand Down Expand Up @@ -455,7 +455,7 @@ migrate' allDefs getter val = do
-- with the difference that an actual database isn't needed for it.
mockMigration :: Migration -> IO ()
mockMigration mig = do
smap <- newIORef $ Map.empty
smap <- makeSimpleStatementCache
let sqlbackend = SqlBackend
{ connPrepare = \_ -> do
return Statement
Expand Down

0 comments on commit 0926409

Please sign in to comment.