module U.Codebase.Sqlite.RemoteProject
  ( RemoteProject (..),
  )
where

import Network.URI (URI)
import Network.URI.Orphans.Sqlite ()
import U.Codebase.Sqlite.DbId (RemoteProjectId)
import Unison.Core.Orphans.Sqlite ()
import Unison.Core.Project (ProjectName)
import Unison.Prelude
import Unison.Sqlite (FromRow, ToRow)

-- | A remote project.
data RemoteProject = RemoteProject
  { RemoteProject -> RemoteProjectId
projectId :: RemoteProjectId,
    RemoteProject -> URI
host :: URI,
    RemoteProject -> ProjectName
name :: ProjectName
  }
  deriving stock ((forall x. RemoteProject -> Rep RemoteProject x)
-> (forall x. Rep RemoteProject x -> RemoteProject)
-> Generic RemoteProject
forall x. Rep RemoteProject x -> RemoteProject
forall x. RemoteProject -> Rep RemoteProject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RemoteProject -> Rep RemoteProject x
from :: forall x. RemoteProject -> Rep RemoteProject x
$cto :: forall x. Rep RemoteProject x -> RemoteProject
to :: forall x. Rep RemoteProject x -> RemoteProject
Generic, Int -> RemoteProject -> ShowS
[RemoteProject] -> ShowS
RemoteProject -> String
(Int -> RemoteProject -> ShowS)
-> (RemoteProject -> String)
-> ([RemoteProject] -> ShowS)
-> Show RemoteProject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RemoteProject -> ShowS
showsPrec :: Int -> RemoteProject -> ShowS
$cshow :: RemoteProject -> String
show :: RemoteProject -> String
$cshowList :: [RemoteProject] -> ShowS
showList :: [RemoteProject] -> ShowS
Show)
  deriving anyclass (RemoteProject -> [SQLData]
(RemoteProject -> [SQLData]) -> ToRow RemoteProject
forall a. (a -> [SQLData]) -> ToRow a
$ctoRow :: RemoteProject -> [SQLData]
toRow :: RemoteProject -> [SQLData]
ToRow, RowParser RemoteProject
RowParser RemoteProject -> FromRow RemoteProject
forall a. RowParser a -> FromRow a
$cfromRow :: RowParser RemoteProject
fromRow :: RowParser RemoteProject
FromRow)