Documentation ¶
Overview ¶
Package pfsdb_28x contains the database schema that PFS uses.
This is copied from src/internal/pfsdb as of v2.8.6.
Index ¶
- Constants
- Variables
- func AddCommit(tx *pachsql.Tx, commit *pfs.Commit) error
- func AddCommitProvenance(tx *pachsql.Tx, from, to *pfs.Commit) error
- func BranchKey(branch *pfs.Branch) string
- func Branches(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection
- func BranchesInRepoChannel(repoID RepoID) string
- func CommitDirectProvenance(ctx context.Context, extCtx sqlx.ExtContext, id CommitID) ([]*pfs.Commit, error)
- func CommitKey(commit *pfs.Commit) string
- func CommitSetProvenance(tx *pachsql.Tx, id string) (_ []*pfs.Commit, retErr error)
- func CommitSetSubvenance(tx *pachsql.Tx, id string) (_ []*pfs.Commit, retErr error)
- func Commits(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection
- func CommitsInRepoChannel(repoID RepoID) string
- func CreateCommitAncestries(ctx context.Context, tx *pachsql.Tx, parentCommit CommitID, ...) error
- func CreateCommitChildren(ctx context.Context, tx *pachsql.Tx, parentCommit CommitID, ...) error
- func CreateCommitParent(ctx context.Context, tx *pachsql.Tx, parentCommit *pfs.Commit, ...) error
- func CreateDirectBranchProvenance(ctx context.Context, ext sqlx.ExtContext, from, to BranchID) error
- func CreateProject(ctx context.Context, tx *pachsql.Tx, project *pfs.ProjectInfo) error
- func DeleteBranch(ctx context.Context, tx *pachsql.Tx, id BranchID, force bool) error
- func DeleteBranchTrigger(ctx context.Context, tx *pachsql.Tx, from BranchID) error
- func DeleteCommit(ctx context.Context, tx *pachsql.Tx, commit *pfs.Commit) error
- func DeleteProject(ctx context.Context, tx *pachsql.Tx, projectName string) error
- func DeleteRepo(ctx context.Context, tx *pachsql.Tx, repoProject, repoName, repoType string) error
- func ForEachBranch(ctx context.Context, tx *pachsql.Tx, filter *pfs.Branch, ...) error
- func ForEachCommit(ctx context.Context, db *pachsql.DB, filter *pfs.Commit, ...) error
- func ForEachCommitTxByFilter(ctx context.Context, tx *pachsql.Tx, filter *pfs.Commit, ...) error
- func ForEachProject(ctx context.Context, tx *pachsql.Tx, ...) error
- func ForEachRepo(ctx context.Context, tx *pachsql.Tx, filter *pfs.Repo, ...) error
- func GetBranchInfo(ctx context.Context, tx *pachsql.Tx, id BranchID) (*pfs.BranchInfo, error)
- func GetBranchProvenance(ctx context.Context, ext sqlx.ExtContext, id BranchID) ([]*pfs.Branch, error)
- func GetBranchSubvenance(ctx context.Context, ext sqlx.ExtContext, id BranchID) ([]*pfs.Branch, error)
- func GetBranchTrigger(ctx context.Context, ext sqlx.ExtContext, from BranchID) (*pfs.Trigger, error)
- func GetCommit(ctx context.Context, tx *pachsql.Tx, id CommitID) (*pfs.CommitInfo, error)
- func GetCommitByCommitKey(ctx context.Context, tx *pachsql.Tx, commit *pfs.Commit) (*pfs.CommitInfo, error)
- func GetCommitChildren(ctx context.Context, tx *pachsql.Tx, parentCommit CommitID) ([]*pfs.Commit, error)
- func GetCommitParent(ctx context.Context, tx *pachsql.Tx, childCommit CommitID) (*pfs.Commit, error)
- func GetCommitSubvenance(ctx context.Context, tx *pachsql.Tx, commit *pfs.Commit) ([]*pfs.Commit, error)
- func GetDirectBranchProvenance(ctx context.Context, ext sqlx.ExtContext, id BranchID) ([]*pfs.Branch, error)
- func GetProject(ctx context.Context, tx *pachsql.Tx, id ProjectID) (*pfs.ProjectInfo, error)
- func GetProjectByName(ctx context.Context, tx *pachsql.Tx, projectName string) (*pfs.ProjectInfo, error)
- func GetRepo(ctx context.Context, tx *pachsql.Tx, id RepoID) (*pfs.RepoInfo, error)
- func GetRepoByName(ctx context.Context, tx *pachsql.Tx, repoProject, repoName, repoType string) (*pfs.RepoInfo, error)
- func IsChildCommitNotFound(err error) bool
- func IsDuplicateKeyErr(err error) bool
- func IsErrProjectAlreadyExists(err error) bool
- func IsErrRepoNotFound(err error) bool
- func IsNotFoundError(err error) bool
- func IsParentCommitNotFound(err error) bool
- func ListCommitTxByFilter(ctx context.Context, tx *pachsql.Tx, filter *pfs.Commit, ...) ([]*pfs.CommitInfo, error)
- func OrderByQuery[T ColumnName](orderBys ...OrderByColumn[T]) string
- func ParseBranch(key string) *pfs.Branch
- func ParseCommit(key string) *pfs.Commit
- func ParseRepo(key string) *pfs.Repo
- func ProjectKey(project *pfs.Project) string
- func RepoKey(repo *pfs.Repo) string
- func ResolveCommitProvenance(tx *pachsql.Tx, repo *pfs.Repo, commitSet string) (*pfs.Commit, error)
- func UpdateCommit(ctx context.Context, tx *pachsql.Tx, id CommitID, commitInfo *pfs.CommitInfo, ...) error
- func UpdateProject(ctx context.Context, tx *pachsql.Tx, id ProjectID, project *pfs.ProjectInfo) error
- func UpsertBranchTrigger(ctx context.Context, tx *pachsql.Tx, from BranchID, to BranchID, ...) error
- func UpsertProject(ctx context.Context, tx *pachsql.Tx, project *pfs.ProjectInfo) error
- func WatchBranchesInRepo(ctx context.Context, db *pachsql.DB, listener collection.PostgresListener, ...) error
- func WatchCommit(ctx context.Context, db *pachsql.DB, listener collection.PostgresListener, ...) error
- func WatchCommits(ctx context.Context, db *pachsql.DB, listener collection.PostgresListener, ...) error
- func WatchCommitsInRepo(ctx context.Context, db *pachsql.DB, listener collection.PostgresListener, ...) error
- func WatchRepos(ctx context.Context, db *pachsql.DB, listener collection.PostgresListener, ...) error
- type AncestryOpt
- type Branch
- type BranchID
- type BranchInfoWithID
- type BranchIterator
- type BranchNotFoundError
- type BranchProvCycleError
- type BranchTrigger
- type ChildCommitNotFoundError
- type ColumnName
- type Commit
- type CommitAlreadyExistsError
- type CommitID
- func CreateCommit(ctx context.Context, tx *pachsql.Tx, commitInfo *pfs.CommitInfo, ...) (CommitID, error)
- func GetCommitID(ctx context.Context, tx *pachsql.Tx, commit *pfs.Commit) (CommitID, error)
- func UpsertCommit(ctx context.Context, tx *pachsql.Tx, commitInfo *pfs.CommitInfo, ...) (CommitID, error)
- type CommitIterator
- type CommitMissingInfoError
- type CommitNotFoundError
- type CommitWithID
- type CreatedAtUpdatedAt
- type ModelType
- type OrderByBranchColumn
- type OrderByColumn
- type OrderByCommitColumn
- type OrderByProjectColumn
- type OrderByRepoColumn
- type ParentCommitNotFoundError
- type Project
- type ProjectAlreadyExistsError
- type ProjectID
- type ProjectIterator
- type ProjectNotFoundError
- type ProjectWithID
- type Repo
- type RepoID
- type RepoInfoWithID
- type RepoIterator
- type RepoNotFoundError
Constants ¶
const ( BranchesChannelName = "pfs_branches" BranchesRepoChannelName = "pfs_branches_repo_" )
const ( BranchColumnID = branchColumn("branch.id") BranchColumnRepoID = branchColumn("branch.repo_id") BranchColumnCreatedAt = branchColumn("branch.created_at") BranchColumnUpdatedAt = branchColumn("branch.updated_at") )
const ( // CommitsChannelName is used to watch events for the commits table. CommitsChannelName = "pfs_commits" CommitsRepoChannelName = "pfs_commits_repo_" CommitChannelName = "pfs_commits_" )
const ( SortOrderNone = sortOrder("") SortOrderAsc = sortOrder("ASC") SortOrderDesc = sortOrder("DESC") )
const ( RepoColumnID = repoColumn("repo.id") RepoColumnCreatedAt = repoColumn("repo.created_at") RepoColumnUpdatedAt = repoColumn("repo.updated_at") )
const (
// ReposChannelName is used to watch events for the repos table.
ReposChannelName = "pfs_repos"
)
Variables ¶
var ( CommitColumnID = commitColumn("commit.int_id") CommitColumnSetID = commitColumn("commit.commit_set_id") CommitColumnRepoID = commitColumn("commit.repo_id") CommitColumnOrigin = commitColumn("commit.origin") CommitColumnCreatedAt = commitColumn("commit.created_at") CommitColumnUpdatedAt = commitColumn("commit.updated_at") )
var ( ProjectColumnID = projectColumn("project.id") ProjectColumnCreatedAt = projectColumn("project.created_at") ProjectColumnUpdatedAt = projectColumn("project.updated_at") )
var BranchesRepoIndex = &col.Index{ Name: "repo", Extract: func(val proto.Message) string { return RepoKey(val.(*pfs.BranchInfo).Branch.Repo) }, }
var CommitsBranchlessIndex = &col.Index{ Name: "branchless", Extract: func(val proto.Message) string { return CommitKey(val.(*pfs.CommitInfo).Commit) }, }
var CommitsCommitSetIndex = &col.Index{ Name: "commitset", Extract: func(val proto.Message) string { return val.(*pfs.CommitInfo).Commit.Id }, }
var CommitsRepoIndex = &col.Index{ Name: "repo", Extract: func(val proto.Message) string { return RepoKey(val.(*pfs.CommitInfo).Commit.Repo) }, }
Functions ¶
func Branches ¶
func Branches(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection
Branches returns a collection of branches
func BranchesInRepoChannel ¶
BranchesInRepoChannel returns the name of the channel that is notified when branches in repo 'repoID' are created, updated, or deleted
func CommitDirectProvenance ¶
func CommitSetProvenance ¶
CommitSetProvenance returns all the commit IDs that are in the provenance of all the commits in this commit set.
TODO(provenance): is 'SELECT DISTINCT commit_id' a performance concern?
func CommitSetSubvenance ¶
CommitSetSubvenance returns all the commit IDs that contain commits in this commit set in their full (transitive) provenance
func Commits ¶
func Commits(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection
Commits returns a collection of commits
func CommitsInRepoChannel ¶
CommitsInRepoChannel returns the name of the channel that is notified when commits in repo 'repoID' are created, updated, or deleted
func CreateCommitAncestries ¶
func CreateCommitAncestries(ctx context.Context, tx *pachsql.Tx, parentCommit CommitID, childrenCommits []CommitID) error
CreateCommitAncestries inserts ancestry relationships where the ids of both parent and children are known.
func CreateCommitChildren ¶
func CreateCommitChildren(ctx context.Context, tx *pachsql.Tx, parentCommit CommitID, childCommits []*pfs.Commit) error
CreateCommitChildren inserts ancestry relationships using a single query for all of the children.
func CreateCommitParent ¶
func CreateCommitParent(ctx context.Context, tx *pachsql.Tx, parentCommit *pfs.Commit, childCommit CommitID) error
CreateCommitParent inserts a single ancestry relationship where the child is known and parent must be derived.
func CreateDirectBranchProvenance ¶
func CreateDirectBranchProvenance(ctx context.Context, ext sqlx.ExtContext, from, to BranchID) error
CreateBranchProvenance creates a provenance relationship between two branches.
func CreateProject ¶
CreateProject creates an entry in the core.projects table.
func DeleteBranch ¶
DeleteBranch deletes a branch.
func DeleteBranchTrigger ¶
func DeleteCommit ¶
DeleteCommit deletes an entry in the pfs.commits table. It also repoints the references in the commit_ancestry table. The caller is responsible for updating branchesg.
func DeleteProject ¶
DeleteProject deletes an entry in the core.projects table.
func DeleteRepo ¶
DeleteRepo deletes an entry in the pfs.repos table.
func ForEachBranch ¶
func ForEachBranch(ctx context.Context, tx *pachsql.Tx, filter *pfs.Branch, cb func(branchInfoWithID BranchInfoWithID) error, orderBys ...OrderByBranchColumn) error
func ForEachCommit ¶
func ForEachCommit(ctx context.Context, db *pachsql.DB, filter *pfs.Commit, cb func(commitWithID CommitWithID) error, orderBys ...OrderByCommitColumn) error
func ForEachCommitTxByFilter ¶
func ForEachCommitTxByFilter(ctx context.Context, tx *pachsql.Tx, filter *pfs.Commit, cb func(commitWithID CommitWithID) error, orderBys ...OrderByCommitColumn) error
func ForEachProject ¶
func ForEachRepo ¶
func ForEachRepo(ctx context.Context, tx *pachsql.Tx, filter *pfs.Repo, cb func(repoWithID RepoInfoWithID) error, orderBys ...OrderByRepoColumn) error
func GetBranchInfo ¶
GetBranchInfo returns a *pfs.BranchInfo by id.
func GetBranchProvenance ¶
func GetBranchProvenance(ctx context.Context, ext sqlx.ExtContext, id BranchID) ([]*pfs.Branch, error)
GetBranchProvenance returns the full provenance of a branch, i.e. all branches that it either directly or transitively depends on.
func GetBranchSubvenance ¶
func GetBranchSubvenance(ctx context.Context, ext sqlx.ExtContext, id BranchID) ([]*pfs.Branch, error)
GetBranchSubvenance returns the full subvenance of a branch, i.e. all branches that either directly or transitively depend on it.
func GetBranchTrigger ¶
func GetCommitByCommitKey ¶
func GetCommitByCommitKey(ctx context.Context, tx *pachsql.Tx, commit *pfs.Commit) (*pfs.CommitInfo, error)
GetCommitByCommitKey is like GetCommit but derives the int_id on behalf of the caller.
func GetCommitChildren ¶
func GetCommitChildren(ctx context.Context, tx *pachsql.Tx, parentCommit CommitID) ([]*pfs.Commit, error)
GetCommitChildren uses the pfs.commit_ancestry and pfs.commits tables to retrieve commits of all of the children given an int_id of the parent.
func GetCommitParent ¶
func GetCommitParent(ctx context.Context, tx *pachsql.Tx, childCommit CommitID) (*pfs.Commit, error)
GetCommitParent uses the pfs.commit_ancestry and pfs.commits tables to retrieve a commit given an int_id of one of its children.
func GetCommitSubvenance ¶
func GetDirectBranchProvenance ¶
func GetDirectBranchProvenance(ctx context.Context, ext sqlx.ExtContext, id BranchID) ([]*pfs.Branch, error)
GetDirectBranchProvenance returns the direct provenance of a branch, i.e. all branches that it directly depends on.
func GetProject ¶
GetProject is like GetProjectByName, but retrieves an entry using the row id.
func GetProjectByName ¶
func GetProjectByName(ctx context.Context, tx *pachsql.Tx, projectName string) (*pfs.ProjectInfo, error)
GetProjectByName retrieves an entry from the core.projects table by project name.
func GetRepo ¶
todo(fahad): rewrite branch related code during the branches migration. GetRepo retrieves an entry from the pfs.repos table by using the row id.
func GetRepoByName ¶
func GetRepoByName(ctx context.Context, tx *pachsql.Tx, repoProject, repoName, repoType string) (*pfs.RepoInfo, error)
GetRepoByName retrieves an entry from the pfs.repos table by project, repo name, and type.
func IsChildCommitNotFound ¶
func IsDuplicateKeyErr ¶
func IsErrRepoNotFound ¶
func IsNotFoundError ¶
func IsParentCommitNotFound ¶
func ListCommitTxByFilter ¶
func ListCommitTxByFilter(ctx context.Context, tx *pachsql.Tx, filter *pfs.Commit, orderBys ...OrderByCommitColumn) ([]*pfs.CommitInfo, error)
func OrderByQuery ¶
func OrderByQuery[T ColumnName](orderBys ...OrderByColumn[T]) string
func ParseBranch ¶
func ParseCommit ¶
func ProjectKey ¶
func ResolveCommitProvenance ¶
returns the commit of a certain repo in a commit set.
func UpdateCommit ¶
func UpdateCommit(ctx context.Context, tx *pachsql.Tx, id CommitID, commitInfo *pfs.CommitInfo, opts ...AncestryOpt) error
UpdateCommit overwrites an existing commit entry by CommitID as well as the corresponding ancestry entries.
func UpdateProject ¶
func UpdateProject(ctx context.Context, tx *pachsql.Tx, id ProjectID, project *pfs.ProjectInfo) error
UpdateProject overwrites an existing project entry by ID.
func UpsertBranchTrigger ¶
func UpsertProject ¶
UpsertProject updates all fields of an existing project entry in the core.projects table by name. If 'upsert' is set to true, UpsertProject() will attempt to call CreateProject() if the entry does not exist.
func WatchBranchesInRepo ¶
func WatchBranchesInRepo(ctx context.Context, db *pachsql.DB, listener collection.PostgresListener, repoID RepoID, onUpsert branchUpsertHandler, onDelete branchDeleteHandler) error
func WatchCommit ¶
func WatchCommit(ctx context.Context, db *pachsql.DB, listener collection.PostgresListener, commitID CommitID, onUpsert commitUpsertHandler, onDelete commitDeleteHandler) error
WatchCommit creates a watcher and watches for changes to a single commit.
func WatchCommits ¶
func WatchCommits(ctx context.Context, db *pachsql.DB, listener collection.PostgresListener, onUpsert commitUpsertHandler, onDelete commitDeleteHandler) error
WatchCommits creates a watcher and watches the pfs.commits table for changes.
func WatchCommitsInRepo ¶
func WatchCommitsInRepo(ctx context.Context, db *pachsql.DB, listener collection.PostgresListener, repoID RepoID, onUpsert commitUpsertHandler, onDelete commitDeleteHandler) error
WatchCommitsInRepo creates a watcher and watches for commits in a repo.
func WatchRepos ¶
func WatchRepos(ctx context.Context, db *pachsql.DB, listener collection.PostgresListener, onUpsert repoUpsertHandler, onDelete repoDeleteHandler) error
Types ¶
type AncestryOpt ¶
AncestryOpt allows users to create commitInfos and skip creating the ancestry information. This allows a user to create the commits in an arbitrary order, then create their ancestry later.
type Branch ¶
type Branch struct { ID BranchID `db:"id"` Head Commit `db:"head"` Repo Repo `db:"repo"` Name string `db:"name"` CreatedAtUpdatedAt }
Branch is a row in the pfs.branches table.
func (Branch) GetCreatedAtUpdatedAt ¶
func (branch Branch) GetCreatedAtUpdatedAt() CreatedAtUpdatedAt
type BranchID ¶
type BranchID uint64
BranchID is the row id for a branch entry in postgres.
func GetBranchID ¶
GetBranchID returns the id of a branch given a set strings that uniquely identify a branch.
func UpsertBranch ¶
func UpsertBranch(ctx context.Context, tx *pachsql.Tx, branchInfo *pfs.BranchInfo) (BranchID, error)
UpsertBranch creates a branch if it does not exist, or updates the head if the branch already exists. If direct provenance is specified, it will be used to update the branch's provenance relationships.
type BranchInfoWithID ¶
type BranchInfoWithID struct { ID BranchID Revision int64 *pfs.BranchInfo }
func GetBranchInfoWithID ¶
func GetBranchInfoWithID(ctx context.Context, tx *pachsql.Tx, b *pfs.Branch) (*BranchInfoWithID, error)
GetBranchInfoWithID returns a *pfs.BranchInfo by name
func ListBranches ¶
func ListBranches(ctx context.Context, tx *pachsql.Tx, filter *pfs.Branch, orderBys ...OrderByBranchColumn) ([]BranchInfoWithID, error)
type BranchIterator ¶
type BranchIterator struct {
// contains filtered or unexported fields
}
func NewBranchIterator ¶
func NewBranchIterator(ctx context.Context, ext sqlx.ExtContext, startPage, pageSize uint64, filter *pfs.Branch, orderBys ...OrderByBranchColumn) (*BranchIterator, error)
func (*BranchIterator) Next ¶
func (i *BranchIterator) Next(ctx context.Context, dst *BranchInfoWithID) error
type BranchNotFoundError ¶
BranchNotFoundError is returned when a branch is not found in postgres.
func (*BranchNotFoundError) Error ¶
func (err *BranchNotFoundError) Error() string
func (*BranchNotFoundError) GRPCStatus ¶
func (err *BranchNotFoundError) GRPCStatus() *status.Status
type BranchProvCycleError ¶
type BranchProvCycleError struct {
From, To string
}
BranchProvCycleError is returned when a cycle is detected at branch creation time.
func (*BranchProvCycleError) Error ¶
func (err *BranchProvCycleError) Error() string
func (*BranchProvCycleError) GRPCStatus ¶
func (err *BranchProvCycleError) GRPCStatus() *status.Status
type BranchTrigger ¶
type BranchTrigger struct { FromBranch Branch `db:"from_branch"` ToBranch Branch `db:"to_branch"` CronSpec string `db:"cron_spec"` RateLimitSpec string `db:"rate_limit_spec"` Size string `db:"size"` NumCommits int64 `db:"num_commits"` AllConditions bool `db:"all_conditions"` }
func (*BranchTrigger) Pb ¶
func (trigger *BranchTrigger) Pb() *pfs.Trigger
type ChildCommitNotFoundError ¶
ChildCommitNotFoundError is returned when a commit's child is not found in postgres.
func (*ChildCommitNotFoundError) Error ¶
func (err *ChildCommitNotFoundError) Error() string
func (*ChildCommitNotFoundError) GRPCStatus ¶
func (err *ChildCommitNotFoundError) GRPCStatus() *status.Status
type ColumnName ¶
type ColumnName interface { string | projectColumn | branchColumn | commitColumn | repoColumn }
type Commit ¶
type Commit struct { ID CommitID `db:"int_id"` CommitSetID string `db:"commit_set_id"` CommitID string `db:"commit_id"` Origin string `db:"origin"` Description string `db:"description"` StartTime sql.NullTime `db:"start_time"` FinishingTime sql.NullTime `db:"finishing_time"` FinishedTime sql.NullTime `db:"finished_time"` CompactingTime sql.NullInt64 `db:"compacting_time_s"` ValidatingTime sql.NullInt64 `db:"validating_time_s"` Error string `db:"error"` Size int64 `db:"size"` // BranchName is used to derive the BranchID in commit related queries. BranchName sql.NullString `db:"branch_name"` BranchID sql.NullInt64 `db:"branch_id"` Repo Repo `db:"repo"` CreatedAtUpdatedAt }
func (Commit) GetCreatedAtUpdatedAt ¶
func (commit Commit) GetCreatedAtUpdatedAt() CreatedAtUpdatedAt
type CommitAlreadyExistsError ¶
type CommitAlreadyExistsError struct {
CommitID string
}
CommitAlreadyExistsError is returned when a commit with the same name already exists in postgres.
func (*CommitAlreadyExistsError) Error ¶
func (err *CommitAlreadyExistsError) Error() string
Error satisfies the error interface.
func (*CommitAlreadyExistsError) GRPCStatus ¶
func (err *CommitAlreadyExistsError) GRPCStatus() *status.Status
type CommitID ¶
type CommitID uint64
CommitID is the row id for a commit entry in postgres.
func CreateCommit ¶
func CreateCommit(ctx context.Context, tx *pachsql.Tx, commitInfo *pfs.CommitInfo, opts ...AncestryOpt) (CommitID, error)
CreateCommit creates an entry in the pfs.commits table. If the commit has a parent or children, it will attempt to create entries in the pfs.commit_ancestry table unless options are provided to skip ancestry creation.
func GetCommitID ¶
GetCommitID returns the int_id of a commit in postgres.
func UpsertCommit ¶
func UpsertCommit(ctx context.Context, tx *pachsql.Tx, commitInfo *pfs.CommitInfo, opts ...AncestryOpt) (CommitID, error)
UpsertCommit will attempt to insert a commit and its ancestry relationships. If the commit already exists, it will update its description.
type CommitIterator ¶
type CommitIterator struct {
// contains filtered or unexported fields
}
func NewCommitsIterator ¶
func NewCommitsIterator(ctx context.Context, extCtx sqlx.ExtContext, startPage, pageSize uint64, filter *pfs.Commit, orderBys ...OrderByCommitColumn) (*CommitIterator, error)
func (*CommitIterator) Next ¶
func (i *CommitIterator) Next(ctx context.Context, dst *CommitWithID) error
type CommitMissingInfoError ¶
type CommitMissingInfoError struct {
Field string
}
CommitMissingInfoError is returned when a commitInfo is missing a field.
func (*CommitMissingInfoError) Error ¶
func (err *CommitMissingInfoError) Error() string
func (*CommitMissingInfoError) GRPCStatus ¶
func (err *CommitMissingInfoError) GRPCStatus() *status.Status
type CommitNotFoundError ¶
CommitNotFoundError is returned by GetCommit() when a commit is not found in postgres.
func (*CommitNotFoundError) Error ¶
func (err *CommitNotFoundError) Error() string
func (*CommitNotFoundError) GRPCStatus ¶
func (err *CommitNotFoundError) GRPCStatus() *status.Status
type CommitWithID ¶
type CommitWithID struct { ID CommitID CommitInfo *pfs.CommitInfo Revision int64 }
CommitWithID is returned by the commit iterator.
func GetCommitWithIDByKey ¶
type CreatedAtUpdatedAt ¶
type ModelType ¶
type ModelType interface { Repo | Commit | Branch | Project GetCreatedAtUpdatedAt() CreatedAtUpdatedAt }
type OrderByBranchColumn ¶
type OrderByBranchColumn OrderByColumn[branchColumn]
type OrderByColumn ¶
type OrderByColumn[T ColumnName] struct { Column T Order sortOrder }
type OrderByCommitColumn ¶
type OrderByCommitColumn OrderByColumn[commitColumn]
type OrderByProjectColumn ¶
type OrderByProjectColumn OrderByColumn[projectColumn]
type OrderByRepoColumn ¶
type OrderByRepoColumn OrderByColumn[repoColumn]
type ParentCommitNotFoundError ¶
ParentCommitNotFoundError is returned when a commit's parent is not found in postgres.
func (*ParentCommitNotFoundError) Error ¶
func (err *ParentCommitNotFoundError) Error() string
func (*ParentCommitNotFoundError) GRPCStatus ¶
func (err *ParentCommitNotFoundError) GRPCStatus() *status.Status
type Project ¶
type Project struct { ID ProjectID `db:"id"` Name string `db:"name"` Description string `db:"description"` CreatedAtUpdatedAt }
func (Project) GetCreatedAtUpdatedAt ¶
func (project Project) GetCreatedAtUpdatedAt() CreatedAtUpdatedAt
func (*Project) PbInfo ¶
func (project *Project) PbInfo() *pfs.ProjectInfo
type ProjectAlreadyExistsError ¶
type ProjectAlreadyExistsError struct {
Name string
}
ProjectAlreadyExistsError is returned by CreateProject() when a project with the same name already exists in postgres.
func (*ProjectAlreadyExistsError) Error ¶
func (err *ProjectAlreadyExistsError) Error() string
Error satisfies the error interface.
func (*ProjectAlreadyExistsError) GRPCStatus ¶
func (err *ProjectAlreadyExistsError) GRPCStatus() *status.Status
func (*ProjectAlreadyExistsError) Is ¶
func (err *ProjectAlreadyExistsError) Is(other error) bool
type ProjectIterator ¶
type ProjectIterator struct {
// contains filtered or unexported fields
}
func NewProjectIterator ¶
func NewProjectIterator(ctx context.Context, extCtx sqlx.ExtContext, startPage, pageSize uint64, filter *pfs.Project, orderBys ...OrderByProjectColumn) (*ProjectIterator, error)
func (*ProjectIterator) Next ¶
func (i *ProjectIterator) Next(ctx context.Context, dst *ProjectWithID) error
type ProjectNotFoundError ¶
ProjectNotFoundError is returned by GetProject() when a project is not found in postgres.
func (*ProjectNotFoundError) Error ¶
func (err *ProjectNotFoundError) Error() string
Error satisfies the error interface.
func (*ProjectNotFoundError) GRPCStatus ¶
func (err *ProjectNotFoundError) GRPCStatus() *status.Status
func (*ProjectNotFoundError) Is ¶
func (err *ProjectNotFoundError) Is(other error) bool
type ProjectWithID ¶
type ProjectWithID struct { ProjectInfo *pfs.ProjectInfo ID ProjectID Revision int64 }
func ListProject ¶
type Repo ¶
type Repo struct { ID RepoID `db:"id"` Project Project `db:"project"` Name string `db:"name"` Type string `db:"type"` Description string `db:"description"` CreatedAtUpdatedAt BranchesNames string `db:"branches"` }
Repo is a row in the pfs.repos table.
func (Repo) GetCreatedAtUpdatedAt ¶
func (repo Repo) GetCreatedAtUpdatedAt() CreatedAtUpdatedAt
type RepoID ¶
type RepoID uint64
RepoID is the row id for a repo entry in postgres.
type RepoInfoWithID ¶
RepoInfoWithID is an (id, repoInfo) tuple returned by the repo iterator.
type RepoIterator ¶
type RepoIterator struct {
// contains filtered or unexported fields
}
func NewRepoIterator ¶
func NewRepoIterator(ctx context.Context, ext sqlx.ExtContext, startPage, pageSize uint64, filter *pfs.Repo, orderBys ...OrderByRepoColumn) (*RepoIterator, error)
func (*RepoIterator) Next ¶
func (i *RepoIterator) Next(ctx context.Context, dst *RepoInfoWithID) error
type RepoNotFoundError ¶
RepoNotFoundError is returned by GetRepo() when a repo is not found in postgres.
func (*RepoNotFoundError) Error ¶
func (err *RepoNotFoundError) Error() string
Error satisfies the error interface.
func (*RepoNotFoundError) GRPCStatus ¶
func (err *RepoNotFoundError) GRPCStatus() *status.Status