pfsdb

package
v2.7.0-nightly.20230706 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package pfsdb contains the database schema that PFS uses.

Index

Constants

This section is empty.

Variables

View Source
var BranchesRepoIndex = &col.Index{
	Name: "repo",
	Extract: func(val proto.Message) string {
		return RepoKey(val.(*pfs.BranchInfo).Branch.Repo)
	},
}
View Source
var CommitsBranchlessIndex = &col.Index{
	Name: "branchless",
	Extract: func(val proto.Message) string {
		return CommitKey(val.(*pfs.CommitInfo).Commit)
	},
}
View Source
var CommitsCommitSetIndex = &col.Index{
	Name: "commitset",
	Extract: func(val proto.Message) string {
		return val.(*pfs.CommitInfo).Commit.Id
	},
}
View Source
var CommitsRepoIndex = &col.Index{
	Name: "repo",
	Extract: func(val proto.Message) string {
		return RepoKey(val.(*pfs.CommitInfo).Commit.Repo)
	},
}
View Source
var ReposNameIndex = &col.Index{
	Name: "name",
	Extract: func(val proto.Message) string {
		return ReposNameKey(val.(*pfs.RepoInfo).Repo)
	},
}
View Source
var ReposTypeIndex = &col.Index{
	Name: "type",
	Extract: func(val proto.Message) string {
		return val.(*pfs.RepoInfo).Repo.Type
	},
}

Functions

func AddCommit

func AddCommit(tx *pachsql.Tx, commit *pfs.Commit) error

func AddCommitProvenance

func AddCommitProvenance(tx *pachsql.Tx, from, to *pfs.Commit) error

func BranchKey

func BranchKey(branch *pfs.Branch) string

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 CommitKey

func CommitKey(commit *pfs.Commit) string

func CommitSetProvenance

func CommitSetProvenance(tx *pachsql.Tx, id string) (_ []*pfs.Commit, retErr error)

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

func CommitSetSubvenance(tx *pachsql.Tx, id string) (_ []*pfs.Commit, retErr error)

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 ParseBranch added in v2.6.6

func ParseBranch(key string) *pfs.Branch

func ParseCommit

func ParseCommit(key string) *pfs.Commit

func ParseRepo

func ParseRepo(key string) *pfs.Repo

func ProjectKey

func ProjectKey(project *pfs.Project) string

func Projects

func Projects(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection

func RepoKey

func RepoKey(repo *pfs.Repo) string

func Repos

func Repos(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection

Repos returns a collection of repos

func ReposNameKey

func ReposNameKey(repo *pfs.Repo) string

func ResolveCommitProvenance

func ResolveCommitProvenance(tx *pachsql.Tx, repo *pfs.Repo, commitSet string) (*pfs.Commit, error)

returns the commit of a certain repo in a commit set.

func SetupCommitProvenanceV0

func SetupCommitProvenanceV0(ctx context.Context, tx *pachsql.Tx) error

func SetupCommitProvenanceV01

func SetupCommitProvenanceV01(ctx context.Context, tx *pachsql.Tx) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL