module U.Codebase.Sqlite.ProjectBranch
( ProjectBranch (..),
ProjectBranchRow (..),
)
where
import U.Codebase.Sqlite.DbId (ProjectBranchId, ProjectId)
import Unison.Core.Orphans.Sqlite ()
import Unison.Core.Project (ProjectBranchName)
import Unison.Prelude
import Unison.Sqlite (FromRow, ToRow)
data ProjectBranch = ProjectBranch
{ ProjectBranch -> ProjectId
projectId :: !ProjectId,
ProjectBranch -> ProjectBranchId
branchId :: !ProjectBranchId,
ProjectBranch -> ProjectBranchName
name :: !ProjectBranchName,
ProjectBranch -> Maybe ProjectBranchId
parentBranchId :: !(Maybe ProjectBranchId),
ProjectBranch -> Bool
isUpdate :: !Bool,
ProjectBranch -> Bool
isUpgrade :: !Bool
}
deriving stock (ProjectBranch -> ProjectBranch -> Bool
(ProjectBranch -> ProjectBranch -> Bool)
-> (ProjectBranch -> ProjectBranch -> Bool) -> Eq ProjectBranch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ProjectBranch -> ProjectBranch -> Bool
== :: ProjectBranch -> ProjectBranch -> Bool
$c/= :: ProjectBranch -> ProjectBranch -> Bool
/= :: ProjectBranch -> ProjectBranch -> Bool
Eq, (forall x. ProjectBranch -> Rep ProjectBranch x)
-> (forall x. Rep ProjectBranch x -> ProjectBranch)
-> Generic ProjectBranch
forall x. Rep ProjectBranch x -> ProjectBranch
forall x. ProjectBranch -> Rep ProjectBranch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ProjectBranch -> Rep ProjectBranch x
from :: forall x. ProjectBranch -> Rep ProjectBranch x
$cto :: forall x. Rep ProjectBranch x -> ProjectBranch
to :: forall x. Rep ProjectBranch x -> ProjectBranch
Generic, Int -> ProjectBranch -> ShowS
[ProjectBranch] -> ShowS
ProjectBranch -> String
(Int -> ProjectBranch -> ShowS)
-> (ProjectBranch -> String)
-> ([ProjectBranch] -> ShowS)
-> Show ProjectBranch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ProjectBranch -> ShowS
showsPrec :: Int -> ProjectBranch -> ShowS
$cshow :: ProjectBranch -> String
show :: ProjectBranch -> String
$cshowList :: [ProjectBranch] -> ShowS
showList :: [ProjectBranch] -> ShowS
Show)
data ProjectBranchRow = ProjectBranchRow
{ ProjectBranchRow -> ProjectId
projectId :: !ProjectId,
ProjectBranchRow -> ProjectBranchId
branchId :: !ProjectBranchId,
ProjectBranchRow -> ProjectBranchName
name :: !ProjectBranchName,
ProjectBranchRow -> Maybe ProjectBranchId
parentBranchId :: !(Maybe ProjectBranchId)
}
deriving stock (ProjectBranchRow -> ProjectBranchRow -> Bool
(ProjectBranchRow -> ProjectBranchRow -> Bool)
-> (ProjectBranchRow -> ProjectBranchRow -> Bool)
-> Eq ProjectBranchRow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ProjectBranchRow -> ProjectBranchRow -> Bool
== :: ProjectBranchRow -> ProjectBranchRow -> Bool
$c/= :: ProjectBranchRow -> ProjectBranchRow -> Bool
/= :: ProjectBranchRow -> ProjectBranchRow -> Bool
Eq, (forall x. ProjectBranchRow -> Rep ProjectBranchRow x)
-> (forall x. Rep ProjectBranchRow x -> ProjectBranchRow)
-> Generic ProjectBranchRow
forall x. Rep ProjectBranchRow x -> ProjectBranchRow
forall x. ProjectBranchRow -> Rep ProjectBranchRow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ProjectBranchRow -> Rep ProjectBranchRow x
from :: forall x. ProjectBranchRow -> Rep ProjectBranchRow x
$cto :: forall x. Rep ProjectBranchRow x -> ProjectBranchRow
to :: forall x. Rep ProjectBranchRow x -> ProjectBranchRow
Generic, Int -> ProjectBranchRow -> ShowS
[ProjectBranchRow] -> ShowS
ProjectBranchRow -> String
(Int -> ProjectBranchRow -> ShowS)
-> (ProjectBranchRow -> String)
-> ([ProjectBranchRow] -> ShowS)
-> Show ProjectBranchRow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ProjectBranchRow -> ShowS
showsPrec :: Int -> ProjectBranchRow -> ShowS
$cshow :: ProjectBranchRow -> String
show :: ProjectBranchRow -> String
$cshowList :: [ProjectBranchRow] -> ShowS
showList :: [ProjectBranchRow] -> ShowS
Show)
deriving anyclass (RowParser ProjectBranchRow
RowParser ProjectBranchRow -> FromRow ProjectBranchRow
forall a. RowParser a -> FromRow a
$cfromRow :: RowParser ProjectBranchRow
fromRow :: RowParser ProjectBranchRow
FromRow, ProjectBranchRow -> [SQLData]
(ProjectBranchRow -> [SQLData]) -> ToRow ProjectBranchRow
forall a. (a -> [SQLData]) -> ToRow a
$ctoRow :: ProjectBranchRow -> [SQLData]
toRow :: ProjectBranchRow -> [SQLData]
ToRow)