@@ -16,8 +16,10 @@ module Simplex.Messaging.Agent.Store.SQLite.DB
1616 execute ,
1717 execute_ ,
1818 executeMany ,
19+ executeNamed ,
1920 query ,
2021 query_ ,
22+ queryNamed ,
2123 )
2224where
2325
@@ -31,7 +33,7 @@ import Data.Map.Strict (Map)
3133import qualified Data.Map.Strict as M
3234import Data.Text (Text )
3335import Data.Time (diffUTCTime , getCurrentTime )
34- import Database.SQLite.Simple (FromRow , Query , ToRow )
36+ import Database.SQLite.Simple (FromRow , NamedParam , Query , ToRow )
3537import qualified Database.SQLite.Simple as SQL
3638import Database.SQLite.Simple.FromField (FromField (.. ))
3739import Database.SQLite.Simple.ToField (ToField (.. ))
@@ -103,6 +105,11 @@ execute_ :: Connection -> Query -> IO ()
103105execute_ Connection {conn, slow} sql = timeIt slow sql $ SQL. execute_ conn sql
104106{-# INLINE execute_ #-}
105107
108+ -- TODO [postgres] remove
109+ executeNamed :: Connection -> Query -> [NamedParam ] -> IO ()
110+ executeNamed Connection {conn, slow} sql = timeIt slow sql . SQL. executeNamed conn sql
111+ {-# INLINE executeNamed #-}
112+
106113executeMany :: ToRow q => Connection -> Query -> [q ] -> IO ()
107114executeMany Connection {conn, slow} sql = timeIt slow sql . SQL. executeMany conn sql
108115{-# INLINE executeMany #-}
@@ -115,4 +122,9 @@ query_ :: FromRow r => Connection -> Query -> IO [r]
115122query_ Connection {conn, slow} sql = timeIt slow sql $ SQL. query_ conn sql
116123{-# INLINE query_ #-}
117124
125+ -- TODO [postgres] remove
126+ queryNamed :: FromRow r => Connection -> Query -> [NamedParam ] -> IO [r ]
127+ queryNamed Connection {conn, slow} sql = timeIt slow sql . SQL. queryNamed conn sql
128+ {-# INLINE queryNamed #-}
129+
118130$ (J. deriveJSON defaultJSON ''SlowQueryStats)
0 commit comments