{-# LANGUAGE DeriveGeneric #-}

module Database.EJDB2.Meta where

import           Data.Aeson                    ( FromJSON )
import           Data.Int

import           Database.EJDB2.CollectionMeta

import           GHC.Generics                  hiding ( Meta )

-- | Metadata about database.
data Meta =
    Meta { Meta -> String
version     :: String            -- ^ EJDB engine version
         , Meta -> String
file        :: String            -- ^ Path to storage file
         , Meta -> Int64
size        :: Int64             -- ^ Storage file size in bytes
         , Meta -> [CollectionMeta]
collections :: [CollectionMeta]  -- ^ List of collections
         }
    deriving ( Meta -> Meta -> Bool
(Meta -> Meta -> Bool) -> (Meta -> Meta -> Bool) -> Eq Meta
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Meta -> Meta -> Bool
$c/= :: Meta -> Meta -> Bool
== :: Meta -> Meta -> Bool
$c== :: Meta -> Meta -> Bool
Eq, (forall x. Meta -> Rep Meta x)
-> (forall x. Rep Meta x -> Meta) -> Generic Meta
forall x. Rep Meta x -> Meta
forall x. Meta -> Rep Meta x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Meta x -> Meta
$cfrom :: forall x. Meta -> Rep Meta x
Generic, Int -> Meta -> ShowS
[Meta] -> ShowS
Meta -> String
(Int -> Meta -> ShowS)
-> (Meta -> String) -> ([Meta] -> ShowS) -> Show Meta
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Meta] -> ShowS
$cshowList :: [Meta] -> ShowS
show :: Meta -> String
$cshow :: Meta -> String
showsPrec :: Int -> Meta -> ShowS
$cshowsPrec :: Int -> Meta -> ShowS
Show )

instance FromJSON Meta