database

package
v0.0.0-...-c40c2f6 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	ID          int64
	RunID       int64
	Hash        string
	Author      string
	AuthorEmail string
	Date        time.Time
	Message     string
}

type Database

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

func Open

func Open() (*Database, error)

Open opens or creates the SQLite database in ~/.ingest/ingest.db

func (*Database) Close

func (d *Database) Close() error

Close closes the database connection

func (*Database) CreateCmdRun

func (d *Database) CreateCmdRun(runID int64, command string, exitCode int, stdout, stderr string, durationMs int64) error

CreateCmdRun creates a new command run record

func (*Database) CreateCommit

func (d *Database) CreateCommit(runID int64, hash, author, authorEmail, committer, committerEmail string, date time.Time, message string, parentHashes []string) (int64, error)

CreateCommit creates a new commit record

func (*Database) CreateFSEntry

func (d *Database) CreateFSEntry(runID int64, path string, isDir bool, size int64, mode string, modTime time.Time, blobID *int64) error

CreateFSEntry creates a new filesystem entry record

func (*Database) CreateFile

func (d *Database) CreateFile(commitID int64, path string, size int64, mode string, blobID *int64) error

CreateFile creates a new file record

func (*Database) CreateGitHubComment

func (d *Database) CreateGitHubComment(runID int64, itemType string, itemNumber int, commentID int64, author, body string, createdAt, updatedAt time.Time) error

CreateGitHubComment creates a new GitHub comment record

func (*Database) CreateGitHubCommentReaction

func (d *Database) CreateGitHubCommentReaction(record GitHubCommentReaction) error

CreateGitHubCommentReaction stores a reaction for a GitHub comment.

func (*Database) CreateGitHubIssue

func (d *Database) CreateGitHubIssue(record GitHubIssueRecord) error

CreateGitHubIssue creates a new GitHub issue record

func (*Database) CreateGitHubPR

func (d *Database) CreateGitHubPR(runID int64, number int, title, body, state, author string, createdAt, updatedAt time.Time, closedAt, mergedAt *time.Time, merged, draft bool, baseBranch, headBranch, labels, assignees, reviewers, milestone string) error

CreateGitHubPR creates a new GitHub pull request record

func (*Database) CreateGitRef

func (d *Database) CreateGitRef(runID int64, refType, name, targetHash string) error

CreateGitRef creates a new git reference record (branch or tag)

func (*Database) CreateGitRemote

func (d *Database) CreateGitRemote(runID int64, name, url string) error

CreateGitRemote creates a new git remote record

func (*Database) CreateLinearIssue

func (d *Database) CreateLinearIssue(runID int64, issue LinearIssue) error

CreateLinearIssue stores a Linear issue for the given run.

func (*Database) CreateRun

func (d *Database) CreateRun(repoPath string, runType string) (int64, error)

CreateRun creates a new ingestion run

func (*Database) FinishRun

func (d *Database) FinishRun(runID int64, status string) error

FinishRun marks a run as completed

func (*Database) GetAllRuns

func (d *Database) GetAllRuns() ([]Run, error)

GetAllRuns retrieves all ingestion runs

func (*Database) GetOrCreateBlob

func (d *Database) GetOrCreateBlob(content []byte, sha256Hash string) (int64, error)

GetOrCreateBlob stores a blob if it doesn't exist and returns its ID

func (*Database) Query

func (d *Database) Query(query string) ([]map[string]any, error)

Query executes a SQL query and returns results as JSON-serializable data

func (*Database) UpdateRunCounts

func (d *Database) UpdateRunCounts(runID int64) error

UpdateRunCounts is deprecated, use UpdateRunItemCount instead

func (*Database) UpdateRunFileCount

func (d *Database) UpdateRunFileCount(runID int64) error

UpdateRunFileCount is deprecated, use UpdateRunItemCount instead

func (*Database) UpdateRunItemCount

func (d *Database) UpdateRunItemCount(runID int64) error

UpdateRunItemCount updates item count for a run based on run type

type File

type File struct {
	ID       int64
	CommitID int64
	Path     string
	Size     int64
	Mode     string
}

type GitHubCommentReaction

type GitHubCommentReaction struct {
	RunID      int64
	ItemType   string
	ItemNumber int
	CommentID  int64
	Reactor    string
	Content    string
}

GitHubCommentReaction represents a reaction on a GitHub comment.

type GitHubIssueRecord

type GitHubIssueRecord struct {
	RunID             int64
	Number            int
	Title             string
	Body              string
	State             string
	Author            string
	CreatedAt         time.Time
	UpdatedAt         time.Time
	ClosedAt          *time.Time
	Labels            string
	Assignees         string
	Milestone         string
	NodeID            string
	IssueID           int64
	HTMLURL           string
	APIURL            string
	CommentsURL       string
	EventsURL         string
	StateReason       string
	Locked            bool
	ActiveLockReason  string
	Draft             bool
	ClosedBy          string
	CommentCount      int
	ReactionsTotal    int
	ParticipantsCount int
}

GitHubIssueRecord represents a row in github_issues.

type LinearIssue

type LinearIssue struct {
	IssueID     string
	Identifier  string
	Title       string
	Description *string
	Priority    *int
	Status      *string
	Assignee    *string
	Team        *string
	URL         *string
	RawData     *string
}

LinearIssue represents a Linear issue record stored in the database.

type Run

type Run struct {
	ID        int64
	RepoPath  string
	RunType   string
	StartTime time.Time
	EndTime   *time.Time
	ItemCount int
	Status    string
}

Jump to

Keyboard shortcuts

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