Help us shape the future of Go! Take the 2026 Go Developer Survey

ancora

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package ancora provides a read-only snapshot reader for the Ancora SQLite database. It does NOT import the ancora binary or its store package — it speaks directly to the DB file so vela stays independent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDBPath

func DefaultDBPath() (string, error)

DefaultDBPath returns the path to the ancora SQLite database. Respects ANCORA_DATA_DIR env var, otherwise uses ~/.ancora/ancora.db.

Types

type Observation

type Observation struct {
	ID           int64
	Title        string
	Content      string
	Type         string // "decision", "bugfix", "architecture", etc.
	Workspace    string // project/repo name — may be empty
	Visibility   string // "work" | "personal"
	Organization string // optional org scope
	TopicKey     string // optional dedup key
	References   string // JSON array string — may be empty
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

Observation is a minimal projection of ancora's observations table. Only the fields vela needs for graph extraction are included.

type Reader

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

Reader opens a read-only view of the ancora SQLite database.

func Open

func Open(dbPath string) (*Reader, error)

Open opens the ancora database at dbPath in read-only WAL mode. The caller must call Close() when done.

func (*Reader) AllObservations

func (r *Reader) AllObservations(workspace, visibility string) ([]Observation, error)

AllObservations returns all non-deleted observations. workspace and visibility are optional filters ("" = all).

func (*Reader) Close

func (r *Reader) Close() error

Close releases the database connection.

func (*Reader) Count

func (r *Reader) Count() (int, error)

Count returns the total number of non-deleted observations.

Jump to

Keyboard shortcuts

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