datarolesfile

package
v0.153.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

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