datarolesfile

package
v0.158.4 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package datarolesfile keeps a local project's data-role classifications at <project>/datatug-data-roles.json (dataroles.FileName), beside the Meaning Graph labels of meaninglabelsfile. Only confirmed entries take effect.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collections

func Collections(schema *api.CatalogSchema, foreignKeys []datatug.TableForeignKeys, indexes []datatug.TableIndexes) []dataroles.Collection

Collections is the schema-only shape of a DB model's stored tables for dataroles.Suggest: columns with their primary-key flag (the columns file's pkPosition) and single-column unique flag (the model's indexes file), and counts of the foreign keys each table holds and receives (the model's foreign-keys file). It reads no record values. Views are left out: they hold no data of their own.

Types

type Store

type Store struct {
	Dir string
}

Store is the file-backed classification store of one project directory.

func (Store) Load

func (s Store) Load() (dataroles.Document, error)

Load reads and validates the document; a project with no file has an empty one.

func (Store) Update

func (s Store) Update(ctx context.Context, change func(*dataroles.Document) error) (dataroles.Document, error)

Update loads the document under a lock, applies change and writes the result atomically when change succeeds.

Jump to

Keyboard shortcuts

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