catalogstore

package
v1.147.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package catalogstore stores the platform catalog in PostgreSQL (#1917).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StoreFor

func StoreFor(db *sql.DB) catalog.Store

StoreFor returns the catalog store over db, or nil on a deployment with no database, so a caller can leave the catalog out without a nil check.

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 New

func New(db *sql.DB) *Store

New returns a catalog store over db.

func (*Store) AddEdges

func (s *Store) AddEdges(ctx context.Context, edges []catalog.Edge) error

AddEdges records lineage edges in one transaction. An edge from a dataset to itself says nothing and is skipped.

func (*Store) Browse

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

func (s *Store) DatasetsByPath(ctx context.Context, connectionKind, path string) ([]string, error)

DatasetsByPath returns the datasets one kind of connection names by path.

func (*Store) DeleteDefinition

func (s *Store) DeleteDefinition(ctx context.Context, ref catalog.Ref) error

DeleteDefinition deletes a definition no glossary entry sits under and no dataset or column carries.

func (*Store) GetDataset

func (s *Store) GetDataset(ctx context.Context, ref catalog.Ref) (*catalog.Dataset, error)

GetDataset reads a dataset with its columns and curation.

func (*Store) GetDefinition

func (s *Store) GetDefinition(ctx context.Context, ref catalog.Ref) (*catalog.Definition, error)

GetDefinition reads a definition by a reference whose key is its id or slug.

func (*Store) GetDocument

func (s *Store) GetDocument(ctx context.Context, ref catalog.Ref) (*catalog.SchemaDocument, error)

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

func (s *Store) ListDocuments(ctx context.Context) ([]catalog.SchemaDocument, error)

ListDocuments lists every schema document without its content.

func (*Store) MarkDatasetRemoved

func (s *Store) MarkDatasetRemoved(ctx context.Context, ref catalog.Ref) error

MarkDatasetRemoved marks one dataset removed.

func (*Store) MarkRemoved

func (s *Store) MarkRemoved(ctx context.Context, r catalog.Removal) (int, error)

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

func (s *Store) PutDataset(ctx context.Context, in catalog.DatasetInput) (*catalog.Dataset, error)

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) Rollback

func (s *Store) Rollback(ctx context.Context, changeID, by string) (*catalog.Change, error)

Rollback restores the value a change replaced, recorded as a new change.

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

func (s *Store) TaggedEntities(ctx context.Context, tag string, limit int) ([]string, error)

TaggedEntities returns the datasets and columns carrying a tag.

func (*Store) Uses

func (s *Store) Uses(ctx context.Context, ref catalog.Ref, limit int) ([]catalog.Use, error)

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.

func (*Store) WriteAspects

func (s *Store) WriteAspects(ctx context.Context, edits []catalog.AspectEdit, by string) ([]catalog.Change, error)

WriteAspects writes several aspects in one transaction.

Jump to

Keyboard shortcuts

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