database

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnection

func NewConnection(config Config) (*sql.DB, error)

NewConnection creates a new PostgreSQL connection

Types

type Config

type Config struct {
	Host     string
	Port     string
	User     string
	Password string
	DBName   string
	SSLMode  string
}

Config holds database configuration

type Ticket

type Ticket struct {
	ID          string
	Title       string
	Description sql.NullString
	Status      string
	Priority    string
	AssigneeID  sql.NullString
	Tags        []string
	CreatedAt   time.Time
	UpdatedAt   time.Time
	ReporterID  string
}

Ticket represents a ticket in the database

type TicketRepository

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

TicketRepository handles ticket database operations

func NewTicketRepository

func NewTicketRepository(db *sql.DB) *TicketRepository

NewTicketRepository creates a new ticket repository

func (*TicketRepository) Create

func (r *TicketRepository) Create(ctx context.Context, ticket *Ticket) (*Ticket, error)

Create creates a new ticket

func (*TicketRepository) Delete

func (r *TicketRepository) Delete(ctx context.Context, id string) error

Delete deletes a ticket by ID

func (*TicketRepository) GetByID

func (r *TicketRepository) GetByID(ctx context.Context, id string) (*Ticket, error)

GetByID retrieves a ticket by ID

func (*TicketRepository) List

func (r *TicketRepository) List(ctx context.Context, limit, offset int) ([]*Ticket, error)

List retrieves all tickets with pagination

func (*TicketRepository) Update

func (r *TicketRepository) Update(ctx context.Context, id string, updates map[string]interface{}) (*Ticket, error)

Update updates an existing ticket

Jump to

Keyboard shortcuts

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