Documentation ¶
Index ¶
- type Artifact
- type ArtifactData
- type ArtifactKey
- type BaseModel
- type DBQueryExpr
- type Dataset
- type DatasetKey
- type ListModelsInput
- type ModelFilter
- type ModelJoinCondition
- type ModelValueFilter
- type Partition
- type PartitionKey
- type Reservation
- type ReservationKey
- type SortParameter
- type Tag
- type TagKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artifact ¶
type Artifact struct { BaseModel ArtifactKey DatasetUUID string `gorm:"type:uuid;index:artifacts_dataset_uuid_idx"` Dataset Dataset `gorm:"association_autocreate:false"` ArtifactData []ArtifactData `` /* 162-byte string literal not displayed */ Partitions []Partition `gorm:"references:ArtifactID;foreignkey:ArtifactID"` Tags []Tag `gorm:"references:ArtifactID,DatasetUUID;foreignkey:ArtifactID,DatasetUUID"` SerializedMetadata []byte }
type ArtifactData ¶
type ArtifactData struct { BaseModel ArtifactKey Name string `gorm:"primary_key"` Location string }
type ArtifactKey ¶
type DBQueryExpr ¶
type DBQueryExpr struct { Query string Args interface{} }
Encapsulates the query and necessary arguments to issue a DB query.
type Dataset ¶
type Dataset struct { BaseModel DatasetKey SerializedMetadata []byte PartitionKeys []PartitionKey `gorm:"references:UUID;foreignkey:DatasetUUID"` }
type DatasetKey ¶
type DatasetKey struct { Project string `gorm:"primary_key;"` // part of pkey, no index needed as it is first column in the pkey Name string `gorm:"primary_key;index:dataset_name_idx"` // part of pkey and has separate index for filtering Domain string `gorm:"primary_key;index:dataset_domain_idx"` // part of pkey and has separate index for filtering Version string `gorm:"primary_key;index:dataset_version_idx"` // part of pkey and has separate index for filtering UUID string `gorm:"type:uuid;unique;"` }
type ListModelsInput ¶
type ListModelsInput struct { // The filters for the list ModelFilters []ModelFilter // The number of models to list Limit int // The token to offset results by Offset int // Parameter to sort by SortParameter SortParameter }
Inputs to specify to list models
type ModelFilter ¶
type ModelFilter struct { ValueFilters []ModelValueFilter JoinCondition ModelJoinCondition Entity common.Entity }
A single filter for a model encompasses value filters and optionally a join condition if the filter is not on the source model
type ModelJoinCondition ¶
type ModelJoinCondition interface {
GetJoinOnDBQueryExpression(sourceTableName string, joiningTableName string, joiningTableAlias string) (string, error)
}
Generates the join expressions for filters that require other entities
type ModelValueFilter ¶
type ModelValueFilter interface {
GetDBQueryExpression(tableName string) (DBQueryExpr, error)
}
Generates db filter expressions for model values
type Partition ¶
type Partition struct { BaseModel DatasetUUID string `gorm:"primary_key;type:uuid"` Key string `gorm:"primary_key"` Value string `gorm:"primary_key"` ArtifactID string `gorm:"primary_key;index"` // index for JOINs with the Tag/Labels table when querying artifacts }
Main Use cases: 1. Filter artifacts by partition key/val in a dataset from UI [x] 2. Get the artifact that has the partitions (x,y,z + tag_name) = latest [x]
type PartitionKey ¶
type Reservation ¶
type Reservation struct { BaseModel ReservationKey // Identifies who owns the reservation OwnerID string // When the reservation will expire ExpiresAt time.Time SerializedMetadata []byte }
Reservation tracks the metadata needed to allow task cache serialization
type ReservationKey ¶
type ReservationKey struct { DatasetProject string `gorm:"primary_key"` DatasetName string `gorm:"primary_key"` DatasetDomain string `gorm:"primary_key"` DatasetVersion string `gorm:"primary_key"` TagName string `gorm:"primary_key"` }
ReservationKey uniquely identifies a reservation