diff options
Diffstat (limited to '')
-rw-r--r-- | haskell/src/SpaceTraders/Database/Systems.hs | 4 | ||||
-rw-r--r-- | haskell/src/SpaceTraders/Database/Utils.hs | 11 |
2 files changed, 2 insertions, 13 deletions
diff --git a/haskell/src/SpaceTraders/Database/Systems.hs b/haskell/src/SpaceTraders/Database/Systems.hs index f71508e..d3d19c7 100644 --- a/haskell/src/SpaceTraders/Database/Systems.hs +++ b/haskell/src/SpaceTraders/Database/Systems.hs @@ -11,8 +11,8 @@ import Data.Maybe import qualified Database.SQLite.Simple as S import SpaceTraders -import SpaceTraders.Database.Utils import SpaceTraders.Model.System +import SpaceTraders.Utils addSystems :: (HasDatabaseConn env, MonadIO m, MonadReader env m) => [System] -> m () addSystems systems = do @@ -23,5 +23,5 @@ addSystems systems = do getSystems :: (HasDatabaseConn env, MonadIO m, MonadReader env m) => m [System] getSystems = do env <- ask - ret <- liftIO $ S.query_ (getConn env) "SELECT data from systems;" + ret <- liftIO $ S.query_ (getConn env) "SELECT data FROM systems;" return . catMaybes $ map (decodeText . head) ret diff --git a/haskell/src/SpaceTraders/Database/Utils.hs b/haskell/src/SpaceTraders/Database/Utils.hs deleted file mode 100644 index 4d933bd..0000000 --- a/haskell/src/SpaceTraders/Database/Utils.hs +++ /dev/null @@ -1,11 +0,0 @@ -module SpaceTraders.Database.Utils - ( decodeText - ) where - -import Data.Aeson -import Data.ByteString.Builder(toLazyByteString) -import qualified Data.Text as T -import Data.Text.Encoding (encodeUtf8Builder) - -decodeText :: FromJSON a => T.Text -> Maybe a -decodeText = decode . toLazyByteString . encodeUtf8Builder |