Skip to content

Commit 0926409

Browse files
committed
Update MySQL and Sqlite libraries to use new StatementCache mechanism
1 parent d340716 commit 0926409

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

persistent-mysql/Database/Persist/MySQL.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ open' :: MySQL.ConnectInfo -> LogFunc -> IO SqlBackend
126126
open' ci logFunc = do
127127
conn <- MySQL.connect ci
128128
MySQLBase.autocommit conn False -- disable autocommit!
129-
smap <- newIORef $ Map.empty
129+
smap <- makeSimpleStatementCache
130130
return $ SqlBackend
131131
{ connPrepare = prepare' conn
132132
, connStmtMap = smap

persistent-sqlite/Database/Persist/Sqlite.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ wrapConnectionInfo connInfo conn logFunc = do
266266
Sqlite.reset conn stmt
267267
Sqlite.finalize stmt
268268

269-
smap <- newIORef $ Map.empty
269+
smap <- makeSimpleStatementCache
270270
return $ SqlBackend
271271
{ connPrepare = prepare' conn
272272
, connStmtMap = smap
@@ -455,7 +455,7 @@ migrate' allDefs getter val = do
455455
-- with the difference that an actual database isn't needed for it.
456456
mockMigration :: Migration -> IO ()
457457
mockMigration mig = do
458-
smap <- newIORef $ Map.empty
458+
smap <- makeSimpleStatementCache
459459
let sqlbackend = SqlBackend
460460
{ connPrepare = \_ -> do
461461
return Statement

0 commit comments

Comments
 (0)