Documentation ¶
Overview ¶
Package ppsdb contains the database schema that PPS uses.
Index ¶
- Variables
- func CollectionsV0() []col.PostgresCollection
- func JobKey(j *pps.Job) string
- func Jobs(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection
- func JobsPipelineKey(p *pps.Pipeline) string
- func JobsTerminalKey(pipeline *pps.Pipeline, isTerminal bool) string
- func ParsePipelineKey(key string) (projectName, pipelineName, id string, err error)
- func Pipelines(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection
- func PipelinesNameKey(p *pps.Pipeline) string
- func VersionKey(p *pps.Pipeline, version uint64) string
Constants ¶
This section is empty.
Variables ¶
var JobsJobSetIndex = &col.Index{ Name: "jobset", Extract: func(val proto.Message) string { return val.(*pps.JobInfo).Job.ID }, }
var JobsPipelineIndex = &col.Index{ Name: "pipeline", Extract: func(val proto.Message) string { return JobsPipelineKey(val.(*pps.JobInfo).Job.Pipeline) }, }
JobsPipelineIndex maps pipeline to Jobs started by the pipeline
var JobsTerminalIndex = &col.Index{ Name: "job_state", Extract: func(val proto.Message) string { jobInfo := val.(*pps.JobInfo) return JobsTerminalKey(jobInfo.Job.Pipeline, pps.IsTerminal(jobInfo.State)) }, }
var PipelinesNameIndex = &col.Index{ Name: "name", Extract: func(val proto.Message) string { return PipelinesNameKey(val.(*pps.PipelineInfo).Pipeline) }, }
PipelinesNameIndex records the name of pipelines
var PipelinesVersionIndex = &col.Index{ Name: "version", Extract: func(val proto.Message) string { info := val.(*pps.PipelineInfo) return VersionKey(info.Pipeline, info.Version) }, }
PipelinesVersionIndex records the version numbers of pipelines
Functions ¶
func CollectionsV0 ¶
func CollectionsV0() []col.PostgresCollection
CollectionsV0 returns a list of all the PPS API 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 JobKey ¶
JobKey is a string representation of a Job suitable for use as an indexing key. It will include the project if the project name is not the empty string.
func Jobs ¶
func Jobs(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection
Jobs returns a PostgresCollection of Jobs
func JobsPipelineKey ¶
func ParsePipelineKey ¶
ParsePipelineKey expects keys to either be of the form <pipeline>@<id> or <project>/<pipeline>@<id>.
func Pipelines ¶
func Pipelines(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection
Pipelines returns a PostgresCollection of pipelines
func PipelinesNameKey ¶
PipelinesNameKey returns the key used by PipelinesNameIndex to index a PipelineInfo.
func VersionKey ¶
VersionKey return a unique key for the given project, pipeline & version. If the project is the empty string it will return an old-style key without a project; otherwise the key will include the project. The version is zero-padded in order to facilitate sorting.
Types ¶
This section is empty.