Skip to content

Commit cfde593

Browse files
committed
agent: restore methods for backwards compatibility with simplex-chat
1 parent 69fb9a9 commit cfde593

File tree

1 file changed

+13
-1
lines changed
  • src/Simplex/Messaging/Agent/Store/SQLite

1 file changed

+13
-1
lines changed

src/Simplex/Messaging/Agent/Store/SQLite/DB.hs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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
)
2224
where
2325

@@ -31,7 +33,7 @@ import Data.Map.Strict (Map)
3133
import qualified Data.Map.Strict as M
3234
import Data.Text (Text)
3335
import Data.Time (diffUTCTime, getCurrentTime)
34-
import Database.SQLite.Simple (FromRow, Query, ToRow)
36+
import Database.SQLite.Simple (FromRow, NamedParam, Query, ToRow)
3537
import qualified Database.SQLite.Simple as SQL
3638
import Database.SQLite.Simple.FromField (FromField (..))
3739
import Database.SQLite.Simple.ToField (ToField (..))
@@ -103,6 +105,11 @@ execute_ :: Connection -> Query -> IO ()
103105
execute_ 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+
106113
executeMany :: ToRow q => Connection -> Query -> [q] -> IO ()
107114
executeMany 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]
115122
query_ 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

Comments
 (0)