Documentation ¶
Overview ¶
Package pfsdb contains the database schema that PFS uses.
Index ¶
- 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 CollectionsV0() []col.PostgresCollection
- 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 ParseCommit(key string) *pfs.Commit
- func ParseRepo(key string) *pfs.Repo
- func ProjectKey(project *pfs.Project) string
- func Projects(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection
- func RepoKey(repo *pfs.Repo) string
- func Repos(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection
- func ReposNameKey(repo *pfs.Repo) string
- func ResolveCommitProvenance(tx *pachsql.Tx, repo *pfs.Repo, commitSet string) (*pfs.Commit, error)
- func SetupCommitProvenanceV0(ctx context.Context, tx *pachsql.Tx) error
- func SetupCommitProvenanceV01(ctx context.Context, tx *pachsql.Tx) error
Constants ¶
This section is empty.
Variables ¶
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) }, }
var ReposNameIndex = &col.Index{ Name: "name", Extract: func(val proto.Message) string { return ReposNameKey(val.(*pfs.RepoInfo).Repo) }, }
Functions ¶
func Branches ¶
func Branches(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection
Branches returns a collection of branches
func CollectionsV0 ¶
func CollectionsV0() []col.PostgresCollection
AllCollections returns a list of all the PFS collections for postgres-initialization purposes. These collections are not usable for querying. DO NOT MODIFY THIS FUNCTION IT HAS BEEN USED IN A RELEASED MIGRATION
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 ParseCommit ¶
func ProjectKey ¶
func Projects ¶
func Projects(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection
func Repos ¶
func Repos(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection
Repos returns a collection of repos
func ReposNameKey ¶
func ResolveCommitProvenance ¶
returns the commit of a certain repo in a commit set.
func SetupCommitProvenanceV0 ¶
Types ¶
This section is empty.