agent: remove unused functions (#1432)

* agent: remove unused functions

* cleanup imports
This commit is contained in:
spaced4ndy
2025-01-10 11:59:17 +04:00
committed by GitHub
parent 992b42e922
commit 9d9ec8cd0b
3 changed files with 2 additions and 22 deletions
@@ -5,7 +5,6 @@
module Simplex.Messaging.Agent.Store.Postgres
( createDBStore,
defaultSimplexConnectInfo,
closeDBStore,
execSQL
)
@@ -29,13 +28,6 @@ import UnliftIO.Exception (onException)
import UnliftIO.MVar
import UnliftIO.STM
defaultSimplexConnectInfo :: ConnectInfo
defaultSimplexConnectInfo =
defaultConnectInfo
{ connectUser = "simplex",
connectDatabase = "simplex_v6_3_client_db"
}
-- | Create a new Postgres DBStore with the given connection info, schema name and migrations.
-- This function creates the user and/or database passed in connectInfo if they do not exist
-- (expects the default 'postgres' user and 'postgres' db to exist).
+1 -13
View File
@@ -16,10 +16,8 @@ module Simplex.Messaging.Agent.Store.SQLite.DB
execute,
execute_,
executeMany,
executeNamed,
query,
query_,
queryNamed,
)
where
@@ -33,7 +31,7 @@ import Data.Map.Strict (Map)
import qualified Data.Map.Strict as M
import Data.Text (Text)
import Data.Time (diffUTCTime, getCurrentTime)
import Database.SQLite.Simple (FromRow, NamedParam, Query, ToRow)
import Database.SQLite.Simple (FromRow, Query, ToRow)
import qualified Database.SQLite.Simple as SQL
import Database.SQLite.Simple.FromField (FromField (..))
import Database.SQLite.Simple.ToField (ToField (..))
@@ -105,11 +103,6 @@ execute_ :: Connection -> Query -> IO ()
execute_ Connection {conn, slow} sql = timeIt slow sql $ SQL.execute_ conn sql
{-# INLINE execute_ #-}
-- TODO [postgres] remove
executeNamed :: Connection -> Query -> [NamedParam] -> IO ()
executeNamed Connection {conn, slow} sql = timeIt slow sql . SQL.executeNamed conn sql
{-# INLINE executeNamed #-}
executeMany :: ToRow q => Connection -> Query -> [q] -> IO ()
executeMany Connection {conn, slow} sql = timeIt slow sql . SQL.executeMany conn sql
{-# INLINE executeMany #-}
@@ -122,9 +115,4 @@ query_ :: FromRow r => Connection -> Query -> IO [r]
query_ Connection {conn, slow} sql = timeIt slow sql $ SQL.query_ conn sql
{-# INLINE query_ #-}
-- TODO [postgres] remove
queryNamed :: FromRow r => Connection -> Query -> [NamedParam] -> IO [r]
queryNamed Connection {conn, slow} sql = timeIt slow sql . SQL.queryNamed conn sql
{-# INLINE queryNamed #-}
$(J.deriveJSON defaultJSON ''SlowQueryStats)
+1 -1
View File
@@ -10,7 +10,7 @@ import Database.PostgreSQL.Simple (ConnectInfo (..), defaultConnectInfo)
testDBConnectInfo :: ConnectInfo
testDBConnectInfo =
defaultConnectInfo {
connectUser = "test_user",
connectUser = "test_agent_user",
connectDatabase = "test_agent_db"
}
#endif