mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-30 11:51:57 +00:00
remove postgresql-simple dependency
This commit is contained in:
@@ -40,7 +40,6 @@ dependencies:
|
|||||||
- persistent
|
- persistent
|
||||||
- persistent-postgresql
|
- persistent-postgresql
|
||||||
- persistent-template
|
- persistent-template
|
||||||
- postgresql-simple
|
|
||||||
- process
|
- process
|
||||||
- protolude
|
- protolude
|
||||||
- shakespeare
|
- shakespeare
|
||||||
|
|||||||
@@ -9,12 +9,10 @@ import Startlude
|
|||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import qualified Data.Attoparsec.Text as Atto
|
import qualified Data.Attoparsec.Text as Atto
|
||||||
|
|
||||||
import Lib.Types.Emver
|
|
||||||
import Database.Persist.Sql
|
|
||||||
import qualified Data.Text as T
|
|
||||||
import Control.Monad.Fail ( MonadFail(fail) )
|
import Control.Monad.Fail ( MonadFail(fail) )
|
||||||
import Database.PostgreSQL.Simple.FromField
|
import qualified Data.Text as T
|
||||||
import Database.PostgreSQL.Simple.ToField
|
import Database.Persist.Sql
|
||||||
|
import Lib.Types.Emver
|
||||||
|
|
||||||
instance FromJSON Version where
|
instance FromJSON Version where
|
||||||
parseJSON = withText "Emver Version" $ either fail pure . Atto.parseOnly parseVersion
|
parseJSON = withText "Emver Version" $ either fail pure . Atto.parseOnly parseVersion
|
||||||
@@ -35,9 +33,3 @@ instance PersistField VersionRange where
|
|||||||
fromPersistValue = first T.pack . Atto.parseOnly parseRange <=< fromPersistValue
|
fromPersistValue = first T.pack . Atto.parseOnly parseRange <=< fromPersistValue
|
||||||
instance PersistFieldSql VersionRange where
|
instance PersistFieldSql VersionRange where
|
||||||
sqlType _ = SqlString
|
sqlType _ = SqlString
|
||||||
instance FromField Version where
|
|
||||||
fromField a = fromJSONField a
|
|
||||||
instance FromField [Version] where
|
|
||||||
fromField a = fromJSONField a
|
|
||||||
instance ToField [Version] where
|
|
||||||
toField a = toJSONField a
|
|
||||||
Reference in New Issue
Block a user