db

package
v0.0.0-...-7eb25be Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateEnvironmentParams

type CreateEnvironmentParams struct {
	ProjectID   int64
	Name        string
	Description sql.NullString
}

type CreateProjectParams

type CreateProjectParams struct {
	Name        string
	Description sql.NullString
	CreatedBy   int64
}

type CreateUserParams

type CreateUserParams struct {
	Name     string
	Email    string
	Password string
	Role     string
}

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 Environment

type Environment struct {
	ID          int64
	ProjectID   int64
	Name        string
	Description sql.NullString
}

type GetEnvironmentByNameParams

type GetEnvironmentByNameParams struct {
	Name      string
	ProjectID int64
}

type GetProjectByNameParams

type GetProjectByNameParams struct {
	Name      string
	CreatedBy int64
}

type Project

type Project struct {
	ID          int64
	Name        string
	Description sql.NullString
	CreatedBy   int64
	CreatedAt   sql.NullTime
}

type ProjectMember

type ProjectMember struct {
	ID        int64
	ProjectID int64
	UserID    int64
	Role      string
	CreatedAt sql.NullTime
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CountUsers

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

func (*Queries) CreateEnvironment

func (q *Queries) CreateEnvironment(ctx context.Context, arg CreateEnvironmentParams) (Environment, error)

func (*Queries) CreateProject

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

func (*Queries) CreateUser

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

func (*Queries) DeleteProject

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

func (*Queries) GetEnvironmentById

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

func (*Queries) GetEnvironmentByName

func (q *Queries) GetEnvironmentByName(ctx context.Context, arg GetEnvironmentByNameParams) (Environment, error)

func (*Queries) GetEnvironmentsForProject

func (q *Queries) GetEnvironmentsForProject(ctx context.Context, projectID int64) ([]Environment, error)

func (*Queries) GetProjectByID

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

func (*Queries) GetProjectByName

func (q *Queries) GetProjectByName(ctx context.Context, arg GetProjectByNameParams) ([]Project, error)

func (*Queries) GetProjectsByUser

func (q *Queries) GetProjectsByUser(ctx context.Context, createdBy int64) ([]Project, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)

func (*Queries) GetUserByID

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

func (*Queries) UpdateEnvironment

func (q *Queries) UpdateEnvironment(ctx context.Context, arg UpdateEnvironmentParams) (Environment, error)

func (*Queries) UpdateProject

func (q *Queries) UpdateProject(ctx context.Context, arg UpdateProjectParams) (Project, error)

func (*Queries) WithTx

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

type Service

type Service struct {
	ID            int64
	Name          string
	EnvironmentID int64
	CreatedAt     sql.NullTime
}

type UpdateEnvironmentParams

type UpdateEnvironmentParams struct {
	Name        string
	Description sql.NullString
	ID          int64
}

type UpdateProjectParams

type UpdateProjectParams struct {
	Name        string
	Description sql.NullString
	ID          int64
}

type User

type User struct {
	ID        int64
	Name      string
	Email     string
	Password  string
	Role      string
	CreatedAt sql.NullTime
}

type UserInvite

type UserInvite struct {
	ID        int64
	Email     string
	Token     string
	CreatedAt sql.NullTime
}

Jump to

Keyboard shortcuts

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