relations

package
v0.3.12 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package relations resolves wiki-link refs into typed graph edges on top of the node tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, st *store.Store, sourceNodes []*parser.ContextNode) error

Run resolves wikilink refs into graph edges in its own transaction.

func RunTx added in v0.3.12

func RunTx(ctx context.Context, st *store.Store, tx *sql.Tx, sourceNodes []*parser.ContextNode) error

RunTx resolves wikilink refs within tx, so resolution sees nodes written earlier in the same transaction and a failure rolls those writes back too.

Types

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

func New

func New(st *store.Store) *Resolver

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, ref parser.WikilinkRef) (string, error)

Resolve a single ref to a target node ID.

func (*Resolver) ResolveTx added in v0.3.12

func (r *Resolver) ResolveTx(ctx context.Context, tx *sql.Tx, ref parser.WikilinkRef) (string, error)

Resolve a single ref to a target node ID within tx, so resolution sees nodes written earlier in the same transaction.

Jump to

Keyboard shortcuts

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