2 Module : Gargantext.Database.Types
3 Description : Specific Types to manage core Gargantext type with database
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
12 {-# LANGUAGE TemplateHaskell #-}
14 module Gargantext.Database.Types
17 import Gargantext.Prelude
18 import Gargantext.Database.Schema.Prelude
19 import qualified Database.PostgreSQL.Simple as PGS
22 -- | Index memory of any type in Gargantext
25 Indexed { _index :: Index
28 deriving (Show, Generic, Eq, Ord)
32 instance (FromField a) => PGS.FromRow (Indexed a) where
33 fromRow = Indexed <$> field <*> field