dbsqlc

package
v0.0.0-...-b3accde Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitTestRunResultParams

type CommitTestRunResultParams struct {
	ID             uuid.UUID
	TestedByID     int32
	UpdatedAt      sql.NullTime
	ResultState    TestRunState
	IsClosed       sql.NullBool
	Notes          string
	TestedOn       time.Time
	ActualResult   sql.NullString
	ExpectedResult sql.NullString
}

type CreateNewTestRunParams

type CreateNewTestRunParams struct {
	ID           uuid.UUID
	ProjectID    int32
	TestPlanID   int32
	TestCaseID   uuid.UUID
	OwnerID      int32
	TestedByID   int32
	AssignedToID int32
	Code         string
	CreatedAt    sql.NullTime
	UpdatedAt    sql.NullTime
}

type CreateProjectParams

type CreateProjectParams struct {
	Title       string
	Description string
	Version     sql.NullString
	IsActive    sql.NullBool
	IsPublic    sql.NullBool
	WebsiteUrl  sql.NullString
	GithubUrl   sql.NullString
	TrelloUrl   sql.NullString
	JiraUrl     sql.NullString
	MondayUrl   sql.NullString
	OwnerUserID int32
	CreatedAt   time.Time
	UpdatedAt   time.Time
	DeletedAt   sql.NullTime
}

type CreateTestCaseParams

type CreateTestCaseParams struct {
	ID               uuid.UUID
	Kind             TestKind
	Code             string
	FeatureOrModule  sql.NullString
	Title            string
	Description      string
	ParentTestCaseID sql.NullInt32
	IsDraft          sql.NullBool
	Tags             []string
	CreatedByID      int32
	CreatedAt        sql.NullTime
	UpdatedAt        sql.NullTime
	ProjectID        sql.NullInt32
}

type CreateTestPlanParams

type CreateTestPlanParams struct {
	ProjectID      int32
	AssignedToID   int32
	CreatedByID    int32
	UpdatedByID    int32
	Kind           TestKind
	Description    sql.NullString
	StartAt        sql.NullTime
	ScheduledEndAt sql.NullTime
	NumTestCases   int32
	NumFailures    int32
	IsComplete     sql.NullBool
	IsLocked       sql.NullBool
	HasReport      sql.NullBool
	CreatedAt      sql.NullTime
	UpdatedAt      sql.NullTime
}

type CreateUserParams

type CreateUserParams struct {
	FirstName        string
	LastName         string
	DisplayName      sql.NullString
	Email            string
	Password         string
	Phone            string
	OrgID            sql.NullInt32
	CountryIso       string
	City             sql.NullString
	Address          string
	IsActivated      sql.NullBool
	IsReviewed       sql.NullBool
	IsSuperAdmin     sql.NullBool
	IsVerified       sql.NullBool
	LastLoginAt      sql.NullTime
	EmailConfirmedAt sql.NullTime
	CreatedAt        sql.NullTime
	UpdatedAt        sql.NullTime
	DeletedAt        sql.NullTime
}

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 FindUserLoginByEmailRow

type FindUserLoginByEmailRow struct {
	ID          int32
	DisplayName sql.NullString
	Email       string
	Password    string
	LastLoginAt sql.NullTime
}

type NullTestKind

type NullTestKind struct {
	TestKind TestKind
	Valid    bool // Valid is true if TestKind is not NULL
}

func (*NullTestKind) Scan

func (ns *NullTestKind) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTestKind) Value

func (ns NullTestKind) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTestRunState

type NullTestRunState struct {
	TestRunState TestRunState
	Valid        bool // Valid is true if TestRunState is not NULL
}

func (*NullTestRunState) Scan

func (ns *NullTestRunState) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTestRunState) Value

func (ns NullTestRunState) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Org

type Org struct {
	ID int32
	// Name of the organization
	Name string
	// Address of the org
	Address sql.NullString
	// Country of the org
	Country sql.NullString
	// Optional github url
	GithubUrl sql.NullString
	// Optional website url
	WebsiteUrl sql.NullString
	// User who created the org
	CreatedByID int32
	CreatedAt   time.Time
	UpdatedAt   sql.NullTime
}

type OrgMember

type OrgMember struct {
	ID        int32
	OrgID     int32
	UserID    int32
	Role      string
	CreatedAt time.Time
	RemovedAt sql.NullTime
}

type Project

type Project struct {
	ID int32
	// Title of the project
	Title string
	// Description of the project
	Description string
	// Version of the project
	Version sql.NullString
	// Whether project is active or not
	IsActive sql.NullBool
	// Whether project is public or not
	IsPublic sql.NullBool
	// URL to the projects website
	WebsiteUrl sql.NullString
	// URL to the GitHub Organization or Project link
	GithubUrl sql.NullString
	// URL to Trello if available
	TrelloUrl sql.NullString
	// URL to JIRA if available
	JiraUrl sql.NullString
	// URL to Monday.com if available
	MondayUrl sql.NullString
	// The ID of the owner or creator of the project
	OwnerUserID int32
	CreatedAt   time.Time
	UpdatedAt   time.Time
	DeletedAt   sql.NullTime
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CommitTestRunResult

func (q *Queries) CommitTestRunResult(ctx context.Context, arg CommitTestRunResultParams) (uuid.UUID, error)

func (*Queries) CountTestCasesNotLinkedToProject

func (q *Queries) CountTestCasesNotLinkedToProject(ctx context.Context) (int64, error)

func (*Queries) CreateNewTestRun

func (q *Queries) CreateNewTestRun(ctx context.Context, arg CreateNewTestRunParams) (uuid.UUID, error)

func (*Queries) CreateProject

func (q *Queries) CreateProject(ctx context.Context, arg CreateProjectParams) (int32, error)

func (*Queries) CreateTestCase

func (q *Queries) CreateTestCase(ctx context.Context, arg CreateTestCaseParams) (uuid.UUID, error)

func (*Queries) CreateTestPlan

func (q *Queries) CreateTestPlan(ctx context.Context, arg CreateTestPlanParams) (int64, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (int32, error)

func (*Queries) DeleteAllTestPlansInProject

func (q *Queries) DeleteAllTestPlansInProject(ctx context.Context, projectID int32) (int64, error)

func (*Queries) DeleteAllTestRunsInProject

func (q *Queries) DeleteAllTestRunsInProject(ctx context.Context, projectID int32) (int64, error)

func (*Queries) DeleteProject

func (q *Queries) DeleteProject(ctx context.Context, id int32) (int64, error)

func (*Queries) DeleteTestPlan

func (q *Queries) DeleteTestPlan(ctx context.Context, id int64) (int64, error)

func (*Queries) DeleteTestRun

func (q *Queries) DeleteTestRun(ctx context.Context, id uuid.UUID) (int64, error)

func (*Queries) FindUserLoginByEmail

func (q *Queries) FindUserLoginByEmail(ctx context.Context, email string) (FindUserLoginByEmailRow, error)

func (*Queries) GetProject

func (q *Queries) GetProject(ctx context.Context, id int32) (Project, error)

func (*Queries) GetTestCase

func (q *Queries) GetTestCase(ctx context.Context, id uuid.UUID) (TestCase, error)

func (*Queries) GetTestPlan

func (q *Queries) GetTestPlan(ctx context.Context, id int64) (TestPlan, error)

func (*Queries) GetTestRun

func (q *Queries) GetTestRun(ctx context.Context, id uuid.UUID) (TestRun, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, id int32) (User, error)

func (*Queries) IsTestCaseLinkedToProject

func (q *Queries) IsTestCaseLinkedToProject(ctx context.Context, projectID sql.NullInt32) (bool, error)

func (*Queries) ListProjects

func (q *Queries) ListProjects(ctx context.Context) ([]Project, error)

func (*Queries) ListTestCases

func (q *Queries) ListTestCases(ctx context.Context) ([]TestCase, error)

func (*Queries) ListTestCasesByCreator

func (q *Queries) ListTestCasesByCreator(ctx context.Context, createdByID int32) ([]TestCase, error)

func (*Queries) ListTestCasesByProject

func (q *Queries) ListTestCasesByProject(ctx context.Context, projectID sql.NullInt32) ([]TestCase, error)

func (*Queries) ListTestPlans

func (q *Queries) ListTestPlans(ctx context.Context) ([]TestPlan, error)

func (*Queries) ListTestPlansByProject

func (q *Queries) ListTestPlansByProject(ctx context.Context, projectID int32) ([]TestPlan, error)

func (*Queries) ListTestRuns

func (q *Queries) ListTestRuns(ctx context.Context) ([]TestRun, error)

func (*Queries) ListTestRunsAssignedToUser

func (q *Queries) ListTestRunsAssignedToUser(ctx context.Context, assignedToID int32) ([]TestRun, error)

func (*Queries) ListTestRunsByOwner

func (q *Queries) ListTestRunsByOwner(ctx context.Context, ownerID int32) ([]TestRun, error)

func (*Queries) ListTestRunsByPlan

func (q *Queries) ListTestRunsByPlan(ctx context.Context, testPlanID int32) ([]TestRun, error)

func (*Queries) ListTestRunsByProject

func (q *Queries) ListTestRunsByProject(ctx context.Context, projectID int32) ([]TestRun, error)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context) ([]User, error)

func (*Queries) UpdateUserLastLogin

func (q *Queries) UpdateUserLastLogin(ctx context.Context, arg UpdateUserLastLoginParams) (int64, error)

func (*Queries) UserExists

func (q *Queries) UserExists(ctx context.Context, id int32) (bool, error)

func (*Queries) WithTx

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

type TestCase

type TestCase struct {
	ID uuid.UUID
	// The kind of test this case represents
	Kind TestKind
	// A global or project defined code for this test cases
	Code string
	// Feature or module under test if applicable
	FeatureOrModule sql.NullString
	// The title of the test case, think of as E-mail subject
	Title string
	// Description of the test-case
	Description string
	// If applicable, the parent test-cases
	ParentTestCaseID sql.NullInt32
	// Whether test case is a draft i.e. not complete
	IsDraft sql.NullBool
	// Tags for the test case
	Tags []string
	// User who created the test case
	CreatedByID int32
	CreatedAt   sql.NullTime
	UpdatedAt   sql.NullTime
	// Project for the test cases
	ProjectID sql.NullInt32
}

type TestKind

type TestKind string
const (
	TestKindGeneral        TestKind = "general"
	TestKindAdhoc          TestKind = "adhoc"
	TestKindTriage         TestKind = "triage"
	TestKindIntegration    TestKind = "integration"
	TestKindUserAcceptance TestKind = "user_acceptance"
	TestKindRegression     TestKind = "regression"
	TestKindSecurity       TestKind = "security"
	TestKindUserInterface  TestKind = "user_interface"
	TestKindScenario       TestKind = "scenario"
)

func (*TestKind) Scan

func (e *TestKind) Scan(src interface{}) error

type TestPlan

type TestPlan struct {
	ID int64
	// Project which this test plan is under
	ProjectID int32
	// [Optional] User who is assigned to the plan
	AssignedToID int32
	// User who created the plan
	CreatedByID int32
	// User who last updated the plan
	UpdatedByID int32
	// The kind of test the plan targets
	Kind TestKind
	// Description of the test plan
	Description sql.NullString
	// When the test (should) starts
	StartAt sql.NullTime
	// When the test plan was actually closed
	ClosedAt sql.NullTime
	// [Optional] A scheduled end date for the test
	ScheduledEndAt sql.NullTime
	// Number of test cases under this plan, counter cached
	NumTestCases int32
	// Number of failed test cases under this plan, counter cached
	NumFailures int32
	// Whether test plan was completed or not
	IsComplete sql.NullBool
	// Whether test plan is locked or not
	IsLocked sql.NullBool
	// Whether the test plan has a report generated for it
	HasReport sql.NullBool
	CreatedAt sql.NullTime
	UpdatedAt sql.NullTime
}

type TestRun

type TestRun struct {
	ID                    uuid.UUID
	ProjectID             int32
	TestPlanID            int32
	TestCaseID            uuid.UUID
	OwnerID               int32
	TestedByID            int32
	AssignedToID          int32
	AssigneeCanChangeCode sql.NullBool
	Code                  string
	ExternalIssueID       sql.NullString
	ResultState           TestRunState
	IsClosed              sql.NullBool
	Notes                 string
	ActualResult          sql.NullString
	ExpectedResult        sql.NullString
	Reactions             pqtype.NullRawMessage
	TestedOn              time.Time
	CreatedAt             sql.NullTime
	UpdatedAt             sql.NullTime
}

type TestRunState

type TestRunState string
const (
	TestRunStatePending TestRunState = "pending"
	TestRunStatePassed  TestRunState = "passed"
	TestRunStateFailed  TestRunState = "failed"
)

func (*TestRunState) Scan

func (e *TestRunState) Scan(src interface{}) error

type TestRunsComment

type TestRunsComment struct {
	ID        int64
	TestRunID uuid.UUID
	AuthorID  int32
	Content   string
	MediaUrls pqtype.NullRawMessage
}

type UpdateUserLastLoginParams

type UpdateUserLastLoginParams struct {
	LastLoginAt sql.NullTime
	ID          int32
}

type User

type User struct {
	ID int32
	// Firstname of the user
	FirstName string
	// Family name or Surname of the user
	LastName string
	// Preferred display name
	DisplayName sql.NullString
	// E-mail address of the user
	Email string
	// BCrypt encryped Password of the user
	Password string
	// Primary phone number, used for OTP in the future
	Phone string
	// Organization to which this user account belongs to, 0 for system
	OrgID       sql.NullInt32
	CountryIso  string
	City        sql.NullString
	Address     string
	IsActivated sql.NullBool
	IsReviewed  sql.NullBool
	// Whether the user is a system-wide administrator. Not to be confused with admin role
	IsSuperAdmin sql.NullBool
	// Whether user account is verified
	IsVerified sql.NullBool
	// Last login time of the user account
	LastLoginAt sql.NullTime
	// When the user confirmed their account e-mail
	EmailConfirmedAt sql.NullTime
	CreatedAt        sql.NullTime
	UpdatedAt        sql.NullTime
	DeletedAt        sql.NullTime
}

Jump to

Keyboard shortcuts

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