Documentation
¶
Overview ¶
Package store opens metrics.sqlite, applies the DDL, and exposes prepared inserts for the canonical tables.
Index ¶
- type Store
- func (s *Store) Close() error
- func (s *Store) DB() *sql.DB
- func (s *Store) InsertBranch(b model.Branch) error
- func (s *Store) InsertBranchProtection(b model.BranchProtection) error
- func (s *Store) InsertBuild(b model.Build) error
- func (s *Store) InsertBuildJob(j model.BuildJob) error
- func (s *Store) InsertCodeowner(c model.Codeowner) error
- func (s *Store) InsertCommit(c model.Commit) error
- func (s *Store) InsertCommitCoauthor(c model.CommitCoauthor) error
- func (s *Store) InsertCommitFile(c model.CommitFile) error
- func (s *Store) InsertDefect(d model.Defect) error
- func (s *Store) InsertDeploy(d model.Deploy) error
- func (s *Store) InsertFileComplexityHistory(f model.FileComplexityHistory) error
- func (s *Store) InsertFileMetric(f model.FileMetric) error
- func (s *Store) InsertHarnessArtifact(h model.HarnessArtifact) error
- func (s *Store) InsertIncident(i model.Incident) error
- func (s *Store) InsertPR(p model.PR) error
- func (s *Store) InsertPRComment(c model.PRComment) error
- func (s *Store) InsertPRCommit(p model.PRCommit) error
- func (s *Store) InsertPRLabel(l model.PRLabel) error
- func (s *Store) InsertPRReviewRequest(r model.PRReviewRequest) error
- func (s *Store) InsertRelease(r model.Release) error
- func (s *Store) InsertRepo(r model.Repo) error
- func (s *Store) InsertRepoFile(f model.RepoFile) error
- func (s *Store) InsertRepoLanguage(r model.RepoLanguage) error
- func (s *Store) InsertReview(r model.Review) error
- func (s *Store) InsertTeamRepo(team, repo string) error
- func (s *Store) SquashStats() (nSquash, nMerged int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store wraps a SQLite database and implements connector.Sink with prepared insert statements. Concurrent connector workers share one Store; per-call inserts are serialised behind a mutex so the single connection writer is safe.
func Open ¶
Open opens (or creates) a SQLite database at path, applies the canonical DDL, records a _schema row capturing the schema and tool versions, and prepares one insert statement per Sink method.
func (*Store) DB ¶
DB exposes the underlying *sql.DB for cross-cutting passes (postprocess linkage) that need to issue UPDATEs against multiple tables. The store's mutex does not guard direct DB access; callers must coordinate with other writers, which in practice means using DB only after all connector extraction has finished.
func (*Store) InsertBranchProtection ¶
func (s *Store) InsertBranchProtection(b model.BranchProtection) error
func (*Store) InsertCommitCoauthor ¶
func (s *Store) InsertCommitCoauthor(c model.CommitCoauthor) error
func (*Store) InsertCommitFile ¶
func (s *Store) InsertCommitFile(c model.CommitFile) error
func (*Store) InsertFileComplexityHistory ¶
func (s *Store) InsertFileComplexityHistory(f model.FileComplexityHistory) error
func (*Store) InsertFileMetric ¶
func (s *Store) InsertFileMetric(f model.FileMetric) error
func (*Store) InsertHarnessArtifact ¶
func (s *Store) InsertHarnessArtifact(h model.HarnessArtifact) error
func (*Store) InsertPRReviewRequest ¶
func (s *Store) InsertPRReviewRequest(r model.PRReviewRequest) error
func (*Store) InsertRepoLanguage ¶
func (s *Store) InsertRepoLanguage(r model.RepoLanguage) error
func (*Store) InsertTeamRepo ¶
func (*Store) SquashStats ¶
SquashStats returns counts of merged PRs and squash-merged PRs across the entire artifact. Used by run.go after extraction to populate the manifest's `n_total_merged_prs` / `n_squash_merged_prs` / `squash_rate` fields; assay treats squash_rate > 0.5 as the Tornhill Ch 9 caveat threshold for coupling-derived metrics.
merge_method classification is per ADR 021 (parent count + PR-head reachability), already computed at extract time and stored in the prs.merge_method column — no re-derivation here.