gini-storage-0.1.0.0

Safe HaskellNone
LanguageHaskell2010

Gini.Storage.Schema

Description

Schema for the ledger

Synopsis

Documentation

data AccountState #

A bit of elucidation of the decisions made during the design of this schema:

Account is really just a PublicKey, which is a 32 byte blob. AccountState has a unique constraint on the Account value, since it uniquely identifies each account. At the same time AccountState has an 8 byte primary key which is an Int64 and is much more efficient for lookups than blobs. So reusing the AccounState as a foreign key in all of the blocks we achieve three things:

  • Deduplication of data (each block stores at least 48 bytes less data: (32-8)*2) and we gonna have a lot of blocks
  • Ensure that sql queries are faster since indexing and serializing integers is faster than binary blobs. Negative affect will be on the retrieval of blocks, since queries will span more tables, which will only affect the block explorer and we don't need to optimize it as much as the blockchain state update during the actual node operation.
  • Most importantly, enforcement of consistency, having a foreign key on
  • AccountState ensures that the referenced account indeed exists on the
  • blockchain. So for example it is impossible to set a representative to some
  • bogus account address.

Last point leads up to the reason why we use Account in the SendBlock's destination instead of AccountStateId

When somebody creates a SendBlock, the receiver of the money might never exist. Until a matching OpenBlock is created the referenced account is not known to the blockchain. A good example would be the burn account with address set to all zeros. It can never be opened, but anyone can send money into that account address. That is why we can't have a foreign key onto the AccountState in SendBlock's destination and in PendingSendBlock's destination fields.

Representative is optional for older block types Send and Change from the Protocol. For these blocks representative will point to the same account as the previous block in the account chain (i.e. no representative change). Basically will do the same thing as the State block does for such block types. State block type, on the other hand, MUST have the representative field for all block types in emulates. In other words it is required for the state block the representative field to NOT be a Maybe.

Instances
PersistEntity AccountState # 
Instance details

Defined in Gini.Storage.Schema

Associated Types

type PersistEntityBackend AccountState :: *

data Key AccountState :: *

data EntityField AccountState a :: *

data Unique AccountState :: *

Methods

keyToValues :: Key AccountState -> [PersistValue]

keyFromValues :: [PersistValue] -> Either Text (Key AccountState)

persistIdField :: EntityField AccountState (Key AccountState)

entityDef :: Monad m => m AccountState -> EntityDef

persistFieldDef :: EntityField AccountState typ -> FieldDef

toPersistFields :: AccountState -> [SomePersistField]

fromPersistValues :: [PersistValue] -> Either Text AccountState

persistUniqueKeys :: AccountState -> [Unique AccountState]

persistUniqueToFieldNames :: Unique AccountState -> [(HaskellName, DBName)]

persistUniqueToValues :: Unique AccountState -> [PersistValue]

fieldLens :: EntityField AccountState field -> forall (f :: * -> *). Functor f => (field -> f field) -> Entity AccountState -> f (Entity AccountState)

PersistField AccountState # 
Instance details

Defined in Gini.Storage.Schema

Methods

toPersistValue :: AccountState -> PersistValue

fromPersistValue :: PersistValue -> Either Text AccountState

PersistFieldSql AccountState # 
Instance details

Defined in Gini.Storage.Schema

Methods

sqlType :: Proxy AccountState -> SqlType

ToBackendKey SqlBackend AccountState # 
Instance details

Defined in Gini.Storage.Schema

Methods

toBackendKey :: Key AccountState -> BackendKey SqlBackend

fromBackendKey :: BackendKey SqlBackend -> Key AccountState

Eq (Key AccountState) # 
Instance details

Defined in Gini.Storage.Schema

Methods

(==) :: Key AccountState -> Key AccountState -> Bool #

(/=) :: Key AccountState -> Key AccountState -> Bool #

Ord (Key AccountState) # 
Instance details

Defined in Gini.Storage.Schema

Read (Key AccountState) # 
Instance details

Defined in Gini.Storage.Schema

Show (Key AccountState) # 
Instance details

Defined in Gini.Storage.Schema

PathPiece (Key AccountState) # 
Instance details

Defined in Gini.Storage.Schema

PersistField (Key AccountState) # 
Instance details

Defined in Gini.Storage.Schema

Methods

toPersistValue :: Key AccountState -> PersistValue

fromPersistValue :: PersistValue -> Either Text (Key AccountState)

PersistFieldSql (Key AccountState) # 
Instance details

Defined in Gini.Storage.Schema

Methods

sqlType :: Proxy (Key AccountState) -> SqlType

FromJSON (Key AccountState) # 
Instance details

Defined in Gini.Storage.Schema

Methods

parseJSON :: Value -> Parser (Key AccountState)

parseJSONList :: Value -> Parser [Key AccountState]

ToJSON (Key AccountState) # 
Instance details

Defined in Gini.Storage.Schema

Methods

toJSON :: Key AccountState -> Value

toEncoding :: Key AccountState -> Encoding

toJSONList :: [Key AccountState] -> Value

toEncodingList :: [Key AccountState] -> Encoding

FromHttpApiData (Key AccountState) # 
Instance details

Defined in Gini.Storage.Schema

ToHttpApiData (Key AccountState) # 
Instance details

Defined in Gini.Storage.Schema

data EntityField AccountState typ # 
Instance details

Defined in Gini.Storage.Schema

data EntityField AccountState typ where
data Key AccountState # 
Instance details

Defined in Gini.Storage.Schema

data Key AccountState = AccountStateKey {}
type PersistEntityBackend AccountState # 
Instance details

Defined in Gini.Storage.Schema

type PersistEntityBackend AccountState = SqlBackend
data Unique AccountState # 
Instance details

Defined in Gini.Storage.Schema

data PendingSendBlock #

Instances
PersistEntity PendingSendBlock # 
Instance details

Defined in Gini.Storage.Schema

Associated Types

type PersistEntityBackend PendingSendBlock :: *

data Key PendingSendBlock :: *

data EntityField PendingSendBlock a :: *

data Unique PendingSendBlock :: *

Methods

keyToValues :: Key PendingSendBlock -> [PersistValue]

keyFromValues :: [PersistValue] -> Either Text (Key PendingSendBlock)

persistIdField :: EntityField PendingSendBlock (Key PendingSendBlock)

entityDef :: Monad m => m PendingSendBlock -> EntityDef

persistFieldDef :: EntityField PendingSendBlock typ -> FieldDef

toPersistFields :: PendingSendBlock -> [SomePersistField]

fromPersistValues :: [PersistValue] -> Either Text PendingSendBlock

persistUniqueKeys :: PendingSendBlock -> [Unique PendingSendBlock]

persistUniqueToFieldNames :: Unique PendingSendBlock -> [(HaskellName, DBName)]

persistUniqueToValues :: Unique PendingSendBlock -> [PersistValue]

fieldLens :: EntityField PendingSendBlock field -> forall (f :: * -> *). Functor f => (field -> f field) -> Entity PendingSendBlock -> f (Entity PendingSendBlock)

PersistField PendingSendBlock # 
Instance details

Defined in Gini.Storage.Schema

Methods

toPersistValue :: PendingSendBlock -> PersistValue

fromPersistValue :: PersistValue -> Either Text PendingSendBlock

PersistFieldSql PendingSendBlock # 
Instance details

Defined in Gini.Storage.Schema

Methods

sqlType :: Proxy PendingSendBlock -> SqlType

ToBackendKey SqlBackend PendingSendBlock # 
Instance details

Defined in Gini.Storage.Schema

Methods

toBackendKey :: Key PendingSendBlock -> BackendKey SqlBackend

fromBackendKey :: BackendKey SqlBackend -> Key PendingSendBlock

Eq (Key PendingSendBlock) # 
Instance details

Defined in Gini.Storage.Schema

Ord (Key PendingSendBlock) # 
Instance details

Defined in Gini.Storage.Schema

Read (Key PendingSendBlock) # 
Instance details

Defined in Gini.Storage.Schema

Show (Key PendingSendBlock) # 
Instance details

Defined in Gini.Storage.Schema

PathPiece (Key PendingSendBlock) # 
Instance details

Defined in Gini.Storage.Schema

PersistField (Key PendingSendBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

toPersistValue :: Key PendingSendBlock -> PersistValue

fromPersistValue :: PersistValue -> Either Text (Key PendingSendBlock)

PersistFieldSql (Key PendingSendBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

sqlType :: Proxy (Key PendingSendBlock) -> SqlType

FromJSON (Key PendingSendBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

parseJSON :: Value -> Parser (Key PendingSendBlock)

parseJSONList :: Value -> Parser [Key PendingSendBlock]

ToJSON (Key PendingSendBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

toJSON :: Key PendingSendBlock -> Value

toEncoding :: Key PendingSendBlock -> Encoding

toJSONList :: [Key PendingSendBlock] -> Value

toEncodingList :: [Key PendingSendBlock] -> Encoding

FromHttpApiData (Key PendingSendBlock) # 
Instance details

Defined in Gini.Storage.Schema

ToHttpApiData (Key PendingSendBlock) # 
Instance details

Defined in Gini.Storage.Schema

data EntityField PendingSendBlock typ # 
Instance details

Defined in Gini.Storage.Schema

data Key PendingSendBlock # 
Instance details

Defined in Gini.Storage.Schema

data Key PendingSendBlock = PendingSendBlockKey {}
type PersistEntityBackend PendingSendBlock # 
Instance details

Defined in Gini.Storage.Schema

type PersistEntityBackend PendingSendBlock = SqlBackend
data Unique PendingSendBlock # 
Instance details

Defined in Gini.Storage.Schema

data BlockHeader #

Instances
PersistEntity BlockHeader # 
Instance details

Defined in Gini.Storage.Schema

Associated Types

type PersistEntityBackend BlockHeader :: *

data Key BlockHeader :: *

data EntityField BlockHeader a :: *

data Unique BlockHeader :: *

Methods

keyToValues :: Key BlockHeader -> [PersistValue]

keyFromValues :: [PersistValue] -> Either Text (Key BlockHeader)

persistIdField :: EntityField BlockHeader (Key BlockHeader)

entityDef :: Monad m => m BlockHeader -> EntityDef

persistFieldDef :: EntityField BlockHeader typ -> FieldDef

toPersistFields :: BlockHeader -> [SomePersistField]

fromPersistValues :: [PersistValue] -> Either Text BlockHeader

persistUniqueKeys :: BlockHeader -> [Unique BlockHeader]

persistUniqueToFieldNames :: Unique BlockHeader -> [(HaskellName, DBName)]

persistUniqueToValues :: Unique BlockHeader -> [PersistValue]

fieldLens :: EntityField BlockHeader field -> forall (f :: * -> *). Functor f => (field -> f field) -> Entity BlockHeader -> f (Entity BlockHeader)

PersistField BlockHeader # 
Instance details

Defined in Gini.Storage.Schema

Methods

toPersistValue :: BlockHeader -> PersistValue

fromPersistValue :: PersistValue -> Either Text BlockHeader

PersistFieldSql BlockHeader # 
Instance details

Defined in Gini.Storage.Schema

Methods

sqlType :: Proxy BlockHeader -> SqlType

ToBackendKey SqlBackend BlockHeader # 
Instance details

Defined in Gini.Storage.Schema

Methods

toBackendKey :: Key BlockHeader -> BackendKey SqlBackend

fromBackendKey :: BackendKey SqlBackend -> Key BlockHeader

Eq (Key BlockHeader) # 
Instance details

Defined in Gini.Storage.Schema

Methods

(==) :: Key BlockHeader -> Key BlockHeader -> Bool #

(/=) :: Key BlockHeader -> Key BlockHeader -> Bool #

Ord (Key BlockHeader) # 
Instance details

Defined in Gini.Storage.Schema

Methods

compare :: Key BlockHeader -> Key BlockHeader -> Ordering #

(<) :: Key BlockHeader -> Key BlockHeader -> Bool #

(<=) :: Key BlockHeader -> Key BlockHeader -> Bool #

(>) :: Key BlockHeader -> Key BlockHeader -> Bool #

(>=) :: Key BlockHeader -> Key BlockHeader -> Bool #

max :: Key BlockHeader -> Key BlockHeader -> Key BlockHeader #

min :: Key BlockHeader -> Key BlockHeader -> Key BlockHeader #

Read (Key BlockHeader) # 
Instance details

Defined in Gini.Storage.Schema

Show (Key BlockHeader) # 
Instance details

Defined in Gini.Storage.Schema

Methods

showsPrec :: Int -> Key BlockHeader -> ShowS #

show :: Key BlockHeader -> String #

showList :: [Key BlockHeader] -> ShowS #

PathPiece (Key BlockHeader) # 
Instance details

Defined in Gini.Storage.Schema

PersistField (Key BlockHeader) # 
Instance details

Defined in Gini.Storage.Schema

Methods

toPersistValue :: Key BlockHeader -> PersistValue

fromPersistValue :: PersistValue -> Either Text (Key BlockHeader)

PersistFieldSql (Key BlockHeader) # 
Instance details

Defined in Gini.Storage.Schema

Methods

sqlType :: Proxy (Key BlockHeader) -> SqlType

FromJSON (Key BlockHeader) # 
Instance details

Defined in Gini.Storage.Schema

Methods

parseJSON :: Value -> Parser (Key BlockHeader)

parseJSONList :: Value -> Parser [Key BlockHeader]

ToJSON (Key BlockHeader) # 
Instance details

Defined in Gini.Storage.Schema

Methods

toJSON :: Key BlockHeader -> Value

toEncoding :: Key BlockHeader -> Encoding

toJSONList :: [Key BlockHeader] -> Value

toEncodingList :: [Key BlockHeader] -> Encoding

FromHttpApiData (Key BlockHeader) # 
Instance details

Defined in Gini.Storage.Schema

ToHttpApiData (Key BlockHeader) # 
Instance details

Defined in Gini.Storage.Schema

data EntityField BlockHeader typ # 
Instance details

Defined in Gini.Storage.Schema

data EntityField BlockHeader typ where
data Key BlockHeader # 
Instance details

Defined in Gini.Storage.Schema

data Key BlockHeader = BlockHeaderKey {}
type PersistEntityBackend BlockHeader # 
Instance details

Defined in Gini.Storage.Schema

type PersistEntityBackend BlockHeader = SqlBackend
data Unique BlockHeader # 
Instance details

Defined in Gini.Storage.Schema

data OpenBlock #

Instances
PersistEntity OpenBlock # 
Instance details

Defined in Gini.Storage.Schema

Associated Types

type PersistEntityBackend OpenBlock :: *

data Key OpenBlock :: *

data EntityField OpenBlock a :: *

data Unique OpenBlock :: *

Methods

keyToValues :: Key OpenBlock -> [PersistValue]

keyFromValues :: [PersistValue] -> Either Text (Key OpenBlock)

persistIdField :: EntityField OpenBlock (Key OpenBlock)

entityDef :: Monad m => m OpenBlock -> EntityDef

persistFieldDef :: EntityField OpenBlock typ -> FieldDef

toPersistFields :: OpenBlock -> [SomePersistField]

fromPersistValues :: [PersistValue] -> Either Text OpenBlock

persistUniqueKeys :: OpenBlock -> [Unique OpenBlock]

persistUniqueToFieldNames :: Unique OpenBlock -> [(HaskellName, DBName)]

persistUniqueToValues :: Unique OpenBlock -> [PersistValue]

fieldLens :: EntityField OpenBlock field -> forall (f :: * -> *). Functor f => (field -> f field) -> Entity OpenBlock -> f (Entity OpenBlock)

PersistField OpenBlock # 
Instance details

Defined in Gini.Storage.Schema

Methods

toPersistValue :: OpenBlock -> PersistValue

fromPersistValue :: PersistValue -> Either Text OpenBlock

PersistFieldSql OpenBlock # 
Instance details

Defined in Gini.Storage.Schema

Methods

sqlType :: Proxy OpenBlock -> SqlType

ToBackendKey SqlBackend OpenBlock # 
Instance details

Defined in Gini.Storage.Schema

Methods

toBackendKey :: Key OpenBlock -> BackendKey SqlBackend

fromBackendKey :: BackendKey SqlBackend -> Key OpenBlock

Eq (Key OpenBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

(==) :: Key OpenBlock -> Key OpenBlock -> Bool #

(/=) :: Key OpenBlock -> Key OpenBlock -> Bool #

Ord (Key OpenBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

compare :: Key OpenBlock -> Key OpenBlock -> Ordering #

(<) :: Key OpenBlock -> Key OpenBlock -> Bool #

(<=) :: Key OpenBlock -> Key OpenBlock -> Bool #

(>) :: Key OpenBlock -> Key OpenBlock -> Bool #

(>=) :: Key OpenBlock -> Key OpenBlock -> Bool #

max :: Key OpenBlock -> Key OpenBlock -> Key OpenBlock #

min :: Key OpenBlock -> Key OpenBlock -> Key OpenBlock #

Read (Key OpenBlock) # 
Instance details

Defined in Gini.Storage.Schema

Show (Key OpenBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

showsPrec :: Int -> Key OpenBlock -> ShowS #

show :: Key OpenBlock -> String #

showList :: [Key OpenBlock] -> ShowS #

PathPiece (Key OpenBlock) # 
Instance details

Defined in Gini.Storage.Schema

PersistField (Key OpenBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

toPersistValue :: Key OpenBlock -> PersistValue

fromPersistValue :: PersistValue -> Either Text (Key OpenBlock)

PersistFieldSql (Key OpenBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

sqlType :: Proxy (Key OpenBlock) -> SqlType

FromJSON (Key OpenBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

parseJSON :: Value -> Parser (Key OpenBlock)

parseJSONList :: Value -> Parser [Key OpenBlock]

ToJSON (Key OpenBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

toJSON :: Key OpenBlock -> Value

toEncoding :: Key OpenBlock -> Encoding

toJSONList :: [Key OpenBlock] -> Value

toEncodingList :: [Key OpenBlock] -> Encoding

FromHttpApiData (Key OpenBlock) # 
Instance details

Defined in Gini.Storage.Schema

ToHttpApiData (Key OpenBlock) # 
Instance details

Defined in Gini.Storage.Schema

data EntityField OpenBlock typ # 
Instance details

Defined in Gini.Storage.Schema

data EntityField OpenBlock typ where
data Key OpenBlock # 
Instance details

Defined in Gini.Storage.Schema

data Key OpenBlock = OpenBlockKey {}
type PersistEntityBackend OpenBlock # 
Instance details

Defined in Gini.Storage.Schema

type PersistEntityBackend OpenBlock = SqlBackend
data Unique OpenBlock # 
Instance details

Defined in Gini.Storage.Schema

data SendBlock #

Instances
PersistEntity SendBlock # 
Instance details

Defined in Gini.Storage.Schema

Associated Types

type PersistEntityBackend SendBlock :: *

data Key SendBlock :: *

data EntityField SendBlock a :: *

data Unique SendBlock :: *

Methods

keyToValues :: Key SendBlock -> [PersistValue]

keyFromValues :: [PersistValue] -> Either Text (Key SendBlock)

persistIdField :: EntityField SendBlock (Key SendBlock)

entityDef :: Monad m => m SendBlock -> EntityDef

persistFieldDef :: EntityField SendBlock typ -> FieldDef

toPersistFields :: SendBlock -> [SomePersistField]

fromPersistValues :: [PersistValue] -> Either Text SendBlock

persistUniqueKeys :: SendBlock -> [Unique SendBlock]

persistUniqueToFieldNames :: Unique SendBlock -> [(HaskellName, DBName)]

persistUniqueToValues :: Unique SendBlock -> [PersistValue]

fieldLens :: EntityField SendBlock field -> forall (f :: * -> *). Functor f => (field -> f field) -> Entity SendBlock -> f (Entity SendBlock)

PersistField SendBlock # 
Instance details

Defined in Gini.Storage.Schema

Methods

toPersistValue :: SendBlock -> PersistValue

fromPersistValue :: PersistValue -> Either Text SendBlock

PersistFieldSql SendBlock # 
Instance details

Defined in Gini.Storage.Schema

Methods

sqlType :: Proxy SendBlock -> SqlType

ToBackendKey SqlBackend SendBlock # 
Instance details

Defined in Gini.Storage.Schema

Methods

toBackendKey :: Key SendBlock -> BackendKey SqlBackend

fromBackendKey :: BackendKey SqlBackend -> Key SendBlock

Eq (Key SendBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

(==) :: Key SendBlock -> Key SendBlock -> Bool #

(/=) :: Key SendBlock -> Key SendBlock -> Bool #

Ord (Key SendBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

compare :: Key SendBlock -> Key SendBlock -> Ordering #

(<) :: Key SendBlock -> Key SendBlock -> Bool #

(<=) :: Key SendBlock -> Key SendBlock -> Bool #

(>) :: Key SendBlock -> Key SendBlock -> Bool #

(>=) :: Key SendBlock -> Key SendBlock -> Bool #

max :: Key SendBlock -> Key SendBlock -> Key SendBlock #

min :: Key SendBlock -> Key SendBlock -> Key SendBlock #

Read (Key SendBlock) # 
Instance details

Defined in Gini.Storage.Schema

Show (Key SendBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

showsPrec :: Int -> Key SendBlock -> ShowS #

show :: Key SendBlock -> String #

showList :: [Key SendBlock] -> ShowS #

PathPiece (Key SendBlock) # 
Instance details

Defined in Gini.Storage.Schema

PersistField (Key SendBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

toPersistValue :: Key SendBlock -> PersistValue

fromPersistValue :: PersistValue -> Either Text (Key SendBlock)

PersistFieldSql (Key SendBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

sqlType :: Proxy (Key SendBlock) -> SqlType

FromJSON (Key SendBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

parseJSON :: Value -> Parser (Key SendBlock)

parseJSONList :: Value -> Parser [Key SendBlock]

ToJSON (Key SendBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

toJSON :: Key SendBlock -> Value

toEncoding :: Key SendBlock -> Encoding

toJSONList :: [Key SendBlock] -> Value

toEncodingList :: [Key SendBlock] -> Encoding

FromHttpApiData (Key SendBlock) # 
Instance details

Defined in Gini.Storage.Schema

ToHttpApiData (Key SendBlock) # 
Instance details

Defined in Gini.Storage.Schema

data EntityField SendBlock typ # 
Instance details

Defined in Gini.Storage.Schema

data EntityField SendBlock typ where
data Key SendBlock # 
Instance details

Defined in Gini.Storage.Schema

data Key SendBlock = SendBlockKey {}
type PersistEntityBackend SendBlock # 
Instance details

Defined in Gini.Storage.Schema

type PersistEntityBackend SendBlock = SqlBackend
data Unique SendBlock # 
Instance details

Defined in Gini.Storage.Schema

data ReceiveBlock #

Instances
PersistEntity ReceiveBlock # 
Instance details

Defined in Gini.Storage.Schema

Associated Types

type PersistEntityBackend ReceiveBlock :: *

data Key ReceiveBlock :: *

data EntityField ReceiveBlock a :: *

data Unique ReceiveBlock :: *

Methods

keyToValues :: Key ReceiveBlock -> [PersistValue]

keyFromValues :: [PersistValue] -> Either Text (Key ReceiveBlock)

persistIdField :: EntityField ReceiveBlock (Key ReceiveBlock)

entityDef :: Monad m => m ReceiveBlock -> EntityDef

persistFieldDef :: EntityField ReceiveBlock typ -> FieldDef

toPersistFields :: ReceiveBlock -> [SomePersistField]

fromPersistValues :: [PersistValue] -> Either Text ReceiveBlock

persistUniqueKeys :: ReceiveBlock -> [Unique ReceiveBlock]

persistUniqueToFieldNames :: Unique ReceiveBlock -> [(HaskellName, DBName)]

persistUniqueToValues :: Unique ReceiveBlock -> [PersistValue]

fieldLens :: EntityField ReceiveBlock field -> forall (f :: * -> *). Functor f => (field -> f field) -> Entity ReceiveBlock -> f (Entity ReceiveBlock)

PersistField ReceiveBlock # 
Instance details

Defined in Gini.Storage.Schema

Methods

toPersistValue :: ReceiveBlock -> PersistValue

fromPersistValue :: PersistValue -> Either Text ReceiveBlock

PersistFieldSql ReceiveBlock # 
Instance details

Defined in Gini.Storage.Schema

Methods

sqlType :: Proxy ReceiveBlock -> SqlType

ToBackendKey SqlBackend ReceiveBlock # 
Instance details

Defined in Gini.Storage.Schema

Methods

toBackendKey :: Key ReceiveBlock -> BackendKey SqlBackend

fromBackendKey :: BackendKey SqlBackend -> Key ReceiveBlock

Eq (Key ReceiveBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

(==) :: Key ReceiveBlock -> Key ReceiveBlock -> Bool #

(/=) :: Key ReceiveBlock -> Key ReceiveBlock -> Bool #

Ord (Key ReceiveBlock) # 
Instance details

Defined in Gini.Storage.Schema

Read (Key ReceiveBlock) # 
Instance details

Defined in Gini.Storage.Schema

Show (Key ReceiveBlock) # 
Instance details

Defined in Gini.Storage.Schema

PathPiece (Key ReceiveBlock) # 
Instance details

Defined in Gini.Storage.Schema

PersistField (Key ReceiveBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

toPersistValue :: Key ReceiveBlock -> PersistValue

fromPersistValue :: PersistValue -> Either Text (Key ReceiveBlock)

PersistFieldSql (Key ReceiveBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

sqlType :: Proxy (Key ReceiveBlock) -> SqlType

FromJSON (Key ReceiveBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

parseJSON :: Value -> Parser (Key ReceiveBlock)

parseJSONList :: Value -> Parser [Key ReceiveBlock]

ToJSON (Key ReceiveBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

toJSON :: Key ReceiveBlock -> Value

toEncoding :: Key ReceiveBlock -> Encoding

toJSONList :: [Key ReceiveBlock] -> Value

toEncodingList :: [Key ReceiveBlock] -> Encoding

FromHttpApiData (Key ReceiveBlock) # 
Instance details

Defined in Gini.Storage.Schema

ToHttpApiData (Key ReceiveBlock) # 
Instance details

Defined in Gini.Storage.Schema

data EntityField ReceiveBlock typ # 
Instance details

Defined in Gini.Storage.Schema

data EntityField ReceiveBlock typ where
data Key ReceiveBlock # 
Instance details

Defined in Gini.Storage.Schema

data Key ReceiveBlock = ReceiveBlockKey {}
type PersistEntityBackend ReceiveBlock # 
Instance details

Defined in Gini.Storage.Schema

type PersistEntityBackend ReceiveBlock = SqlBackend
data Unique ReceiveBlock # 
Instance details

Defined in Gini.Storage.Schema

data ChangeBlock #

Instances
PersistEntity ChangeBlock # 
Instance details

Defined in Gini.Storage.Schema

Associated Types

type PersistEntityBackend ChangeBlock :: *

data Key ChangeBlock :: *

data EntityField ChangeBlock a :: *

data Unique ChangeBlock :: *

Methods

keyToValues :: Key ChangeBlock -> [PersistValue]

keyFromValues :: [PersistValue] -> Either Text (Key ChangeBlock)

persistIdField :: EntityField ChangeBlock (Key ChangeBlock)

entityDef :: Monad m => m ChangeBlock -> EntityDef

persistFieldDef :: EntityField ChangeBlock typ -> FieldDef

toPersistFields :: ChangeBlock -> [SomePersistField]

fromPersistValues :: [PersistValue] -> Either Text ChangeBlock

persistUniqueKeys :: ChangeBlock -> [Unique ChangeBlock]

persistUniqueToFieldNames :: Unique ChangeBlock -> [(HaskellName, DBName)]

persistUniqueToValues :: Unique ChangeBlock -> [PersistValue]

fieldLens :: EntityField ChangeBlock field -> forall (f :: * -> *). Functor f => (field -> f field) -> Entity ChangeBlock -> f (Entity ChangeBlock)

PersistField ChangeBlock # 
Instance details

Defined in Gini.Storage.Schema

Methods

toPersistValue :: ChangeBlock -> PersistValue

fromPersistValue :: PersistValue -> Either Text ChangeBlock

PersistFieldSql ChangeBlock # 
Instance details

Defined in Gini.Storage.Schema

Methods

sqlType :: Proxy ChangeBlock -> SqlType

ToBackendKey SqlBackend ChangeBlock # 
Instance details

Defined in Gini.Storage.Schema

Methods

toBackendKey :: Key ChangeBlock -> BackendKey SqlBackend

fromBackendKey :: BackendKey SqlBackend -> Key ChangeBlock

Eq (Key ChangeBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

(==) :: Key ChangeBlock -> Key ChangeBlock -> Bool #

(/=) :: Key ChangeBlock -> Key ChangeBlock -> Bool #

Ord (Key ChangeBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

compare :: Key ChangeBlock -> Key ChangeBlock -> Ordering #

(<) :: Key ChangeBlock -> Key ChangeBlock -> Bool #

(<=) :: Key ChangeBlock -> Key ChangeBlock -> Bool #

(>) :: Key ChangeBlock -> Key ChangeBlock -> Bool #

(>=) :: Key ChangeBlock -> Key ChangeBlock -> Bool #

max :: Key ChangeBlock -> Key ChangeBlock -> Key ChangeBlock #

min :: Key ChangeBlock -> Key ChangeBlock -> Key ChangeBlock #

Read (Key ChangeBlock) # 
Instance details

Defined in Gini.Storage.Schema

Show (Key ChangeBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

showsPrec :: Int -> Key ChangeBlock -> ShowS #

show :: Key ChangeBlock -> String #

showList :: [Key ChangeBlock] -> ShowS #

PathPiece (Key ChangeBlock) # 
Instance details

Defined in Gini.Storage.Schema

PersistField (Key ChangeBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

toPersistValue :: Key ChangeBlock -> PersistValue

fromPersistValue :: PersistValue -> Either Text (Key ChangeBlock)

PersistFieldSql (Key ChangeBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

sqlType :: Proxy (Key ChangeBlock) -> SqlType

FromJSON (Key ChangeBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

parseJSON :: Value -> Parser (Key ChangeBlock)

parseJSONList :: Value -> Parser [Key ChangeBlock]

ToJSON (Key ChangeBlock) # 
Instance details

Defined in Gini.Storage.Schema

Methods

toJSON :: Key ChangeBlock -> Value

toEncoding :: Key ChangeBlock -> Encoding

toJSONList :: [Key ChangeBlock] -> Value

toEncodingList :: [Key ChangeBlock] -> Encoding

FromHttpApiData (Key ChangeBlock) # 
Instance details

Defined in Gini.Storage.Schema

ToHttpApiData (Key ChangeBlock) # 
Instance details

Defined in Gini.Storage.Schema

data EntityField ChangeBlock typ # 
Instance details

Defined in Gini.Storage.Schema

data EntityField ChangeBlock typ where
data Key ChangeBlock # 
Instance details

Defined in Gini.Storage.Schema

data Key ChangeBlock = ChangeBlockKey {}
type PersistEntityBackend ChangeBlock # 
Instance details

Defined in Gini.Storage.Schema

type PersistEntityBackend ChangeBlock = SqlBackend
data Unique ChangeBlock # 
Instance details

Defined in Gini.Storage.Schema

migrateData :: Migration #