database

package
v0.0.0-...-2b115c7 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *sql.DB) error

Types

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 Event

type Event struct {
	EventID     int32
	Uuid        uuid.UUID
	Name        string
	Description string
	Tags        []string
	StartsAt    time.Time
	EndsAt      time.Time
	CreatedAt   time.Time
	Website     nulls.String
	UserID      int32
}

type EventsByAscOffsetLimitParams

type EventsByAscOffsetLimitParams struct {
	Offset int32
	Limit  int32
}

type EventsByDescOffsetLimitParams

type EventsByDescOffsetLimitParams struct {
	Offset int32
	Limit  int32
}

type EventsByTagsAscOffsetLimitParams

type EventsByTagsAscOffsetLimitParams struct {
	Tags   []string
	Offset int32
	Limit  int32
}

type EventsByTagsDescOffsetLimitParams

type EventsByTagsDescOffsetLimitParams struct {
	Tags   []string
	Offset int32
	Limit  int32
}

type InsertEventParams

type InsertEventParams struct {
	Name        string
	Description string
	Tags        []string
	Website     nulls.String
	StartsAt    time.Time
	EndsAt      time.Time
	UserID      int32
}

type InsertProjectParams

type InsertProjectParams struct {
	Name        string
	Description string
	Tags        []string
	Repository  nulls.String
	Website     nulls.String
	UserID      int32
}

type Project

type Project struct {
	ProjectID   int32
	Uuid        uuid.UUID
	Name        string
	Description string
	Tags        []string
	UserID      int32
	CreatedAt   time.Time
	Repository  nulls.String
	Website     nulls.String
}

type ProjectsByAscOffsetLimitParams

type ProjectsByAscOffsetLimitParams struct {
	Offset int32
	Limit  int32
}

type ProjectsByDescOffsetLimitParams

type ProjectsByDescOffsetLimitParams struct {
	Offset int32
	Limit  int32
}

type ProjectsByTagsAscOffsetLimitParams

type ProjectsByTagsAscOffsetLimitParams struct {
	Tags   []string
	Offset int32
	Limit  int32
}

type ProjectsByTagsDescOffsetLimitParams

type ProjectsByTagsDescOffsetLimitParams struct {
	Tags   []string
	Offset int32
	Limit  int32
}

type Queries

type Queries struct {
}

func New

func New() *Queries

func (*Queries) CountEvents

func (q *Queries) CountEvents(ctx context.Context, db DBTX) (int64, error)

func (*Queries) CountEventsByTags

func (q *Queries) CountEventsByTags(ctx context.Context, db DBTX, tags []string) (int64, error)

func (*Queries) CountProjects

func (q *Queries) CountProjects(ctx context.Context, db DBTX) (int64, error)

func (*Queries) CountProjectsByTags

func (q *Queries) CountProjectsByTags(ctx context.Context, db DBTX, tags []string) (int64, error)

func (*Queries) CountUserEvents

func (q *Queries) CountUserEvents(ctx context.Context, db DBTX, userID int32) (int64, error)

func (*Queries) CountUserProjects

func (q *Queries) CountUserProjects(ctx context.Context, db DBTX, userID int32) (int64, error)

func (*Queries) DeleteEvent

func (q *Queries) DeleteEvent(ctx context.Context, db DBTX, eventID int32) error

func (*Queries) DeleteProject

func (q *Queries) DeleteProject(ctx context.Context, db DBTX, projectID int32) error

func (*Queries) EventByUUID

func (q *Queries) EventByUUID(ctx context.Context, db DBTX, argUuid uuid.UUID) (Event, error)

func (*Queries) EventsByAscOffsetLimit

func (q *Queries) EventsByAscOffsetLimit(ctx context.Context, db DBTX, arg EventsByAscOffsetLimitParams) ([]Event, error)

func (*Queries) EventsByDescOffsetLimit

func (q *Queries) EventsByDescOffsetLimit(ctx context.Context, db DBTX, arg EventsByDescOffsetLimitParams) ([]Event, error)

func (*Queries) EventsByTagsAscOffsetLimit

func (q *Queries) EventsByTagsAscOffsetLimit(ctx context.Context, db DBTX, arg EventsByTagsAscOffsetLimitParams) ([]Event, error)

func (*Queries) EventsByTagsDescOffsetLimit

func (q *Queries) EventsByTagsDescOffsetLimit(ctx context.Context, db DBTX, arg EventsByTagsDescOffsetLimitParams) ([]Event, error)

func (*Queries) InsertEvent

func (q *Queries) InsertEvent(ctx context.Context, db DBTX, arg InsertEventParams) (Event, error)

func (*Queries) InsertProject

func (q *Queries) InsertProject(ctx context.Context, db DBTX, arg InsertProjectParams) (Project, error)

func (*Queries) InsertUser

func (q *Queries) InsertUser(ctx context.Context, db DBTX, githubEmail string) (User, error)

func (*Queries) ProjectByUUID

func (q *Queries) ProjectByUUID(ctx context.Context, db DBTX, argUuid uuid.UUID) (Project, error)

func (*Queries) ProjectsByAscOffsetLimit

func (q *Queries) ProjectsByAscOffsetLimit(ctx context.Context, db DBTX, arg ProjectsByAscOffsetLimitParams) ([]Project, error)

func (*Queries) ProjectsByDescOffsetLimit

func (q *Queries) ProjectsByDescOffsetLimit(ctx context.Context, db DBTX, arg ProjectsByDescOffsetLimitParams) ([]Project, error)

func (*Queries) ProjectsByTagsAscOffsetLimit

func (q *Queries) ProjectsByTagsAscOffsetLimit(ctx context.Context, db DBTX, arg ProjectsByTagsAscOffsetLimitParams) ([]Project, error)

func (*Queries) ProjectsByTagsDescOffsetLimit

func (q *Queries) ProjectsByTagsDescOffsetLimit(ctx context.Context, db DBTX, arg ProjectsByTagsDescOffsetLimitParams) ([]Project, error)

func (*Queries) UpdateEvent

func (q *Queries) UpdateEvent(ctx context.Context, db DBTX, arg UpdateEventParams) (Event, error)

func (*Queries) UpdateProject

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

func (*Queries) UserByGithubEmail

func (q *Queries) UserByGithubEmail(ctx context.Context, db DBTX, githubEmail string) (User, error)

func (*Queries) UserByUUID

func (q *Queries) UserByUUID(ctx context.Context, db DBTX, argUuid uuid.UUID) (User, error)

func (*Queries) UserEventsByAscOffsetLimit

func (q *Queries) UserEventsByAscOffsetLimit(ctx context.Context, db DBTX, arg UserEventsByAscOffsetLimitParams) ([]Event, error)

func (*Queries) UserEventsByDescOffsetLimit

func (q *Queries) UserEventsByDescOffsetLimit(ctx context.Context, db DBTX, arg UserEventsByDescOffsetLimitParams) ([]Event, error)

func (*Queries) UserProjectsByAscOffsetLimit

func (q *Queries) UserProjectsByAscOffsetLimit(ctx context.Context, db DBTX, arg UserProjectsByAscOffsetLimitParams) ([]Project, error)

func (*Queries) UserProjectsByDescOffsetLimit

func (q *Queries) UserProjectsByDescOffsetLimit(ctx context.Context, db DBTX, arg UserProjectsByDescOffsetLimitParams) ([]Project, error)

type UpdateEventParams

type UpdateEventParams struct {
	Name        string
	Description string
	Tags        []string
	Website     nulls.String
	StartsAt    time.Time
	EndsAt      time.Time
	EventID     int32
}

type UpdateProjectParams

type UpdateProjectParams struct {
	Name        string
	Description string
	Tags        []string
	Repository  nulls.String
	Website     nulls.String
	ProjectID   int32
}

type User

type User struct {
	UserID      int32
	Uuid        uuid.UUID
	GithubEmail string
	CreatedAt   time.Time
}

type UserEventsByAscOffsetLimitParams

type UserEventsByAscOffsetLimitParams struct {
	UserID int32
	Offset int32
	Limit  int32
}

type UserEventsByDescOffsetLimitParams

type UserEventsByDescOffsetLimitParams struct {
	UserID int32
	Offset int32
	Limit  int32
}

type UserProjectsByAscOffsetLimitParams

type UserProjectsByAscOffsetLimitParams struct {
	UserID int32
	Offset int32
	Limit  int32
}

type UserProjectsByDescOffsetLimitParams

type UserProjectsByDescOffsetLimitParams struct {
	UserID int32
	Offset int32
	Limit  int32
}

Jump to

Keyboard shortcuts

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