db

package
v0.0.0-...-8d0f278 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CreateTablesQuery string

Functions

func Open

func Open(path string) (*sql.DB, error)

func ParseIssueComment

func ParseIssueComment(owner string, repo string, number int, comment *github.IssueComment) (InsertCommentParams, InsertUserParams, []error)

func ParsePullRequestComment

func ParsePullRequestComment(owner string, repo string, number int, comment *github.PullRequestComment) (InsertCommentParams, InsertUserParams, []error)

func ParsePullRequestReview

func ParsePullRequestReview(owner string, repo string, number int, review *github.PullRequestReview) (InsertReviewParams, InsertUserParams, []error)

Types

type Comment

type Comment struct {
	ID        int64
	Owner     string
	Repo      string
	PullID    int64
	CreatedAt string
	AuthorID  int64
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type InsertCommentParams

type InsertCommentParams struct {
	ID        int64
	Owner     string
	Repo      string
	PullID    int64
	CreatedAt string
	AuthorID  int64
}

type InsertPullParams

type InsertPullParams struct {
	ID           int64
	Owner        string
	Repo         string
	Title        string
	Url          string
	Additions    int64
	Deletions    int64
	ChangedFiles int64
	AuthorID     int64
	CreatedAt    string
	ClosedAt     sql.NullString
	IsMerged     int64
}

func ParsePullRequest

func ParsePullRequest(owner string, repo string, number int, pr *github.PullRequest) (InsertPullParams, []error)

type InsertReviewParams

type InsertReviewParams struct {
	ID                int64
	Owner             string
	Repo              string
	PullID            int64
	State             string
	CreatedAt         string
	AuthorID          int64
	AuthorAssociation string
}

type InsertTimelineParams

type InsertTimelineParams struct {
	Event     string
	CreatedAt string
	Owner     string
	Repo      string
	PullID    int64
}

func ParseTimelineEvent

func ParseTimelineEvent(owner string, repo string, number int, timelineEvent *github.Timeline) (*InsertTimelineParams, []error)

type InsertUserParams

type InsertUserParams struct {
	ID          int64
	Login       string
	DisplayName sql.NullString
}

func ParseUser

func ParseUser(user *github.User) (*InsertUserParams, []error)

type Pull

type Pull struct {
	ID           int64
	Owner        string
	Repo         string
	Title        string
	Url          string
	Additions    int64
	Deletions    int64
	ChangedFiles int64
	AuthorID     int64
	CreatedAt    string
	ClosedAt     sql.NullString
	IsMerged     int64
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) InsertComment

func (q *Queries) InsertComment(ctx context.Context, arg InsertCommentParams) error

func (*Queries) InsertPull

func (q *Queries) InsertPull(ctx context.Context, arg InsertPullParams) error

func (*Queries) InsertReview

func (q *Queries) InsertReview(ctx context.Context, arg InsertReviewParams) error

func (*Queries) InsertTimeline

func (q *Queries) InsertTimeline(ctx context.Context, arg InsertTimelineParams) error

func (*Queries) InsertUser

func (q *Queries) InsertUser(ctx context.Context, arg InsertUserParams) error

func (*Queries) ReportCycleTime

func (q *Queries) ReportCycleTime(ctx context.Context) ([]ReportCycleTimeRow, error)

func (*Queries) RetrieveDistinctUsers

func (q *Queries) RetrieveDistinctUsers(ctx context.Context) ([]RetrieveDistinctUsersRow, error)

func (*Queries) RetrieveFirstCommenter

func (q *Queries) RetrieveFirstCommenter(ctx context.Context, userids []int64) ([]RetrieveFirstCommenterRow, error)

func (*Queries) RetrieveFirstReviewer

func (q *Queries) RetrieveFirstReviewer(ctx context.Context, userids []int64) ([]RetrieveFirstReviewerRow, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type ReportCycleTimeRow

type ReportCycleTimeRow struct {
	Owner        string
	Repo         string
	ID           int64
	Title        string
	NumReviews   interface{}
	NumComments  interface{}
	InitialState interface{}
	Changed      sql.NullString
	CreatedAt    string
	ClosedAt     sql.NullString
	IsMerged     int64
	Url          string
}

type RetrieveDistinctUsersRow

type RetrieveDistinctUsersRow struct {
	ID    int64
	Login string
}

type RetrieveFirstCommenterRow

type RetrieveFirstCommenterRow struct {
	PullID      int64
	Owner       string
	Repo        string
	PullID_2    int64
	CreatedAt   string
	AuthorID    int64
	Login       string
	DisplayName sql.NullString
}

type RetrieveFirstReviewerRow

type RetrieveFirstReviewerRow struct {
	PullID            int64
	Owner             string
	Repo              string
	PullID_2          int64
	State             string
	CreatedAt         string
	AuthorID          int64
	Login             string
	DisplayName       sql.NullString
	AuthorAssociation string
}

type Review

type Review struct {
	ID                int64
	Owner             string
	Repo              string
	PullID            int64
	State             string
	CreatedAt         string
	AuthorID          int64
	AuthorAssociation string
}

type Timeline

type Timeline struct {
	Event     string
	CreatedAt string
	Owner     string
	Repo      string
	PullID    int64
}

type User

type User struct {
	ID          int64
	Login       string
	DisplayName sql.NullString
}

func (User) GetName

func (u User) GetName() string

Jump to

Keyboard shortcuts

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