{-# LANGUAGE DeriveGeneric #-}

module Database.EJDB2.IndexMeta where

import           Data.Aeson   ( FromJSON )
import           Data.Int

import           GHC.Generics

-- | Metadata abount collection index.
data IndexMeta =
    IndexMeta { IndexMeta -> String
ptr  :: String     -- ^ rfc6901 JSON pointer to indexed field
              , IndexMeta -> Int64
mode :: Int64      -- ^ Index mode
              , IndexMeta -> Int64
idbf :: Int64      -- ^ Index flags
              , IndexMeta -> Int64
dbid :: Int64      -- ^ Index database ID
              , IndexMeta -> Int64
rnum :: Int64      -- ^ Number records stored in index database
              }
    deriving ( IndexMeta -> IndexMeta -> Bool
(IndexMeta -> IndexMeta -> Bool)
-> (IndexMeta -> IndexMeta -> Bool) -> Eq IndexMeta
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IndexMeta -> IndexMeta -> Bool
$c/= :: IndexMeta -> IndexMeta -> Bool
== :: IndexMeta -> IndexMeta -> Bool
$c== :: IndexMeta -> IndexMeta -> Bool
Eq, (forall x. IndexMeta -> Rep IndexMeta x)
-> (forall x. Rep IndexMeta x -> IndexMeta) -> Generic IndexMeta
forall x. Rep IndexMeta x -> IndexMeta
forall x. IndexMeta -> Rep IndexMeta x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IndexMeta x -> IndexMeta
$cfrom :: forall x. IndexMeta -> Rep IndexMeta x
Generic, Int -> IndexMeta -> ShowS
[IndexMeta] -> ShowS
IndexMeta -> String
(Int -> IndexMeta -> ShowS)
-> (IndexMeta -> String)
-> ([IndexMeta] -> ShowS)
-> Show IndexMeta
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IndexMeta] -> ShowS
$cshowList :: [IndexMeta] -> ShowS
show :: IndexMeta -> String
$cshow :: IndexMeta -> String
showsPrec :: Int -> IndexMeta -> ShowS
$cshowsPrec :: Int -> IndexMeta -> ShowS
Show )

instance FromJSON IndexMeta