migratetest

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package migratetest provides an in-Go SQLite fixture-reconstruction harness for internal/migrate tests. It materializes a real, readable SQLite .db from the committed TS DDL (testdata/golden/ts-schema.sql) and representative dump (testdata/golden/ts-schema.dump.sql) — no external sqlite3 binary, no live TS CodeGraph CLI. See RESEARCH.md §"The Real-Aged-.codegraph/ Fixture Question": no committed aged .db fixture exists, only the DDL + a determinism-stripped dump, so every downstream migrate test depends on this harness for something real to run against.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTSIndex

func BuildTSIndex(t testing.TB, v Variant) string

BuildTSIndex reconstructs a real, readable TS-shaped SQLite .db in t.TempDir() from the committed testdata/golden/ts-schema.sql (DDL) and ts-schema.dump.sql (seed rows), entirely in-Go via the modernc.org/sqlite driver. It returns the path to the built .db file. t.Cleanup closes the underlying handle.

Types

type Variant

type Variant int

Variant selects which shape of TS-index fixture BuildTSIndex produces.

const (
	// VariantHappy is the full DDL + full seed rows: exercises the happy
	// path (file:-source contains edges, unistr docstrings, nullable
	// columns).
	VariantHappy Variant = iota
	// VariantAged drops later-added columns (nodes.return_type,
	// edges.provenance) after the happy build, so the resulting DB
	// predates those columns — proves D-09.4 defensive reads downstream.
	VariantAged
	// VariantDangling adds one extra edge whose target id is present in
	// no nodes row — the D-09.2 corruption fixture.
	VariantDangling
)

Jump to

Keyboard shortcuts

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