Documentation
¶
Overview ¶
Package catalogstore stores the platform catalog in PostgreSQL (#1917).
Index ¶
- func StoreFor(db *sql.DB) catalog.Store
- type Store
- func (s *Store) AddEdges(ctx context.Context, edges []catalog.Edge) error
- func (s *Store) Browse(ctx context.Context, q catalog.BrowseQuery) ([]catalog.BrowseEntry, error)
- func (s *Store) DatasetsByPath(ctx context.Context, connectionKind, path string) ([]string, error)
- func (s *Store) DeleteDefinition(ctx context.Context, ref catalog.Ref) error
- func (s *Store) GetDataset(ctx context.Context, ref catalog.Ref) (*catalog.Dataset, error)
- func (s *Store) GetDefinition(ctx context.Context, ref catalog.Ref) (*catalog.Definition, error)
- func (s *Store) GetDocument(ctx context.Context, ref catalog.Ref) (*catalog.SchemaDocument, error)
- func (s *Store) History(ctx context.Context, ref catalog.Ref, name catalog.AspectName) ([]catalog.Change, error)
- func (s *Store) Lineage(ctx context.Context, ref string, direction catalog.Direction, maxDepth int) ([]catalog.Hop, error)
- func (s *Store) ListDefinitions(ctx context.Context, q catalog.DefinitionQuery) ([]catalog.DefinitionSummary, error)
- func (s *Store) ListDocuments(ctx context.Context) ([]catalog.SchemaDocument, error)
- func (s *Store) MarkDatasetRemoved(ctx context.Context, ref catalog.Ref) error
- func (s *Store) MarkRemoved(ctx context.Context, r catalog.Removal) (int, error)
- func (s *Store) PutDataset(ctx context.Context, in catalog.DatasetInput) (*catalog.Dataset, error)
- func (s *Store) PutDefinition(ctx context.Context, in catalog.DefinitionInput) (*catalog.Definition, error)
- func (s *Store) PutDocument(ctx context.Context, in catalog.DocumentInput) (*catalog.SchemaDocument, bool, error)
- func (s *Store) RevertChanges(ctx context.Context, changeIDs []string, by string) ([]catalog.Change, error)
- func (s *Store) Rollback(ctx context.Context, changeID, by string) (*catalog.Change, error)
- func (s *Store) SearchDatasets(ctx context.Context, q catalog.DatasetQuery) ([]catalog.DatasetSummary, error)
- func (s *Store) TaggedEntities(ctx context.Context, tag string, limit int) ([]string, error)
- func (s *Store) Uses(ctx context.Context, ref catalog.Ref, limit int) ([]catalog.Use, error)
- func (s *Store) WriteAspect(ctx context.Context, ref catalog.Ref, name catalog.AspectName, ...) (*catalog.Change, error)
- func (s *Store) WriteAspects(ctx context.Context, edits []catalog.AspectEdit, by string) ([]catalog.Change, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements catalog.Store over the catalog_entities, catalog_aspects and catalog_aspect_history tables.
func (*Store) AddEdges ¶
AddEdges records lineage edges in one transaction. An edge from a dataset to itself says nothing and is skipped.
func (*Store) Browse ¶
func (s *Store) Browse(ctx context.Context, q catalog.BrowseQuery) ([]catalog.BrowseEntry, error)
Browse lists one level of a connection's datasets: each path segment holding datasets further down, then each dataset directly under the prefix.
func (*Store) DatasetsByPath ¶
DatasetsByPath returns the datasets one kind of connection names by path.
func (*Store) DeleteDefinition ¶
DeleteDefinition deletes a definition no glossary entry sits under and no dataset or column carries.
func (*Store) GetDataset ¶
GetDataset reads a dataset with its columns and curation.
func (*Store) GetDefinition ¶
GetDefinition reads a definition by a reference whose key is its id or slug.
func (*Store) GetDocument ¶
GetDocument reads one schema document with its content.
func (*Store) History ¶
func (s *Store) History(ctx context.Context, ref catalog.Ref, name catalog.AspectName) ([]catalog.Change, error)
History lists the changes to one aspect, newest first.
func (*Store) Lineage ¶
func (s *Store) Lineage(ctx context.Context, ref string, direction catalog.Direction, maxDepth int) ([]catalog.Hop, error)
Lineage walks the edges from ref in one direction.
func (*Store) ListDefinitions ¶
func (s *Store) ListDefinitions(ctx context.Context, q catalog.DefinitionQuery) ([]catalog.DefinitionSummary, error)
ListDefinitions returns a page of definitions, ordered by name.
func (*Store) ListDocuments ¶
ListDocuments lists every schema document without its content.
func (*Store) MarkDatasetRemoved ¶
MarkDatasetRemoved marks one dataset removed.
func (*Store) MarkRemoved ¶
MarkRemoved marks the datasets of the given types on a connection that a scan did not see, leaving every dataset under a path prefix it could not read.
func (*Store) PutDataset ¶
PutDataset creates or updates a dataset and replaces its column set.
func (*Store) PutDefinition ¶
func (s *Store) PutDefinition(ctx context.Context, in catalog.DefinitionInput) (*catalog.Definition, error)
PutDefinition creates or updates a glossary term, glossary node, domain, data product or tag, keyed by kind and slug.
func (*Store) PutDocument ¶
func (s *Store) PutDocument(ctx context.Context, in catalog.DocumentInput) (*catalog.SchemaDocument, bool, error)
PutDocument stores a schema document, recording a new version only when its content or media type changed.
func (*Store) RevertChanges ¶
func (s *Store) RevertChanges(ctx context.Context, changeIDs []string, by string) ([]catalog.Change, error)
RevertChanges rolls back several changes in one transaction, refusing them all when any one's aspect has been written since.
func (*Store) SearchDatasets ¶
func (s *Store) SearchDatasets(ctx context.Context, q catalog.DatasetQuery) ([]catalog.DatasetSummary, error)
SearchDatasets returns a page of matching datasets.
func (*Store) TaggedEntities ¶
TaggedEntities returns the datasets and columns carrying a tag.
func (*Store) Uses ¶
Uses returns the datasets and columns carrying a glossary term, a tag or a domain.
func (*Store) WriteAspect ¶
func (s *Store) WriteAspect( ctx context.Context, ref catalog.Ref, name catalog.AspectName, value json.RawMessage, by string, ) (*catalog.Change, error)
WriteAspect writes one aspect and records the change.