{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE NoStrictData #-}
{-# OPTIONS_GHC -Wno-missing-export-lists #-}
{-# OPTIONS_GHC -Wno-name-shadowing #-}

module BtcLsp.Storage.Model where

import BtcLsp.Class.Storage
import BtcLsp.Data.Kind
import BtcLsp.Data.Smart
import BtcLsp.Data.Type
import BtcLsp.Import.External
import qualified BtcLsp.Import.Psql as Psql
import Database.Persist.Quasi
import Database.Persist.TH
import qualified LndClient.Data.ChannelBackup as Lnd

-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities
-- at:
-- http://www.yesodweb.com/book/persistent/
share
  [mkPersist sqlSettings, mkMigrate "migrateAuto"]
  $(persistFileWith lowerCaseSettings "config/model")

instance HasTable User where
  getTable :: Key User -> Table
getTable = Table -> Key User -> Table
forall a b. a -> b -> a
const Table
UserTable

instance HasTable LnChan where
  getTable :: Key LnChan -> Table
getTable = Table -> Key LnChan -> Table
forall a b. a -> b -> a
const Table
LnChanTable

instance HasTable SwapIntoLn where
  getTable :: Key SwapIntoLn -> Table
getTable = Table -> Key SwapIntoLn -> Table
forall a b. a -> b -> a
const Table
SwapIntoLnTable

instance HasTable Block where
  getTable :: Key Block -> Table
getTable = Table -> Key Block -> Table
forall a b. a -> b -> a
const Table
BlockTable

deriving stock instance Generic (Psql.Key User)

instance Out (Psql.Key User)

instance Out User

deriving stock instance Generic (Psql.Key SwapIntoLn)

instance Out (Psql.Key SwapIntoLn)

instance Out SwapIntoLn

deriving stock instance Generic (Psql.Key LnChan)

instance Out (Psql.Key LnChan)

instance Out LnChan

deriving stock instance Generic (Psql.Key Block)

instance Out (Psql.Key Block)

instance Out Block

deriving stock instance Generic (Psql.Key SwapUtxo)

instance Out (Psql.Key SwapUtxo)

instance Out SwapUtxo