litesqlc

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cycle

type Cycle struct {
	ID             int64      `json:"id"`
	UserID         int64      `json:"user_id"`
	CreatedAt      time.Time  `json:"created_at"`
	UpdatedAt      time.Time  `json:"updated_at"`
	Start          time.Time  `json:"start"`
	End            *time.Time `json:"end"`
	TimezoneOffset string     `json:"timezone_offset"`
	ScoreState     string     `json:"score_state"`
	ScoreJson      *string    `json:"score_json"`
	FetchedAt      time.Time  `json:"fetched_at"`
}

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 GetCycleByDateParams

type GetCycleByDateParams struct {
	DayStart time.Time `json:"day_start"`
	DayEnd   time.Time `json:"day_end"`
}

type GetCyclesByDateRangeCursorParams

type GetCyclesByDateRangeCursorParams struct {
	RangeStart time.Time `json:"range_start"`
	RangeEnd   time.Time `json:"range_end"`
	Cursor     time.Time `json:"cursor"`
	Limit      int64     `json:"limit"`
}

type GetCyclesByDateRangeParams

type GetCyclesByDateRangeParams struct {
	RangeStart time.Time `json:"range_start"`
	RangeEnd   time.Time `json:"range_end"`
	Limit      int64     `json:"limit"`
}

type GetSleepsByDateRangeCursorParams

type GetSleepsByDateRangeCursorParams struct {
	RangeStart time.Time `json:"range_start"`
	RangeEnd   time.Time `json:"range_end"`
	Cursor     time.Time `json:"cursor"`
	Limit      int64     `json:"limit"`
}

type GetSleepsByDateRangeParams

type GetSleepsByDateRangeParams struct {
	RangeStart time.Time `json:"range_start"`
	RangeEnd   time.Time `json:"range_end"`
	Limit      int64     `json:"limit"`
}

type GetWorkoutsByDateRangeCursorParams

type GetWorkoutsByDateRangeCursorParams struct {
	RangeStart time.Time `json:"range_start"`
	RangeEnd   time.Time `json:"range_end"`
	Cursor     time.Time `json:"cursor"`
	Limit      int64     `json:"limit"`
}

type GetWorkoutsByDateRangeParams

type GetWorkoutsByDateRangeParams struct {
	RangeStart time.Time `json:"range_start"`
	RangeEnd   time.Time `json:"range_end"`
	Limit      int64     `json:"limit"`
}

type Querier

type Querier interface {
	DeleteCycle(ctx context.Context, id int64) error
	DeleteRecovery(ctx context.Context, cycleID int64) error
	DeleteSleep(ctx context.Context, id string) error
	DeleteTokenMetadata(ctx context.Context) error
	DeleteWorkout(ctx context.Context, id string) error
	GetCycle(ctx context.Context, id int64) (Cycle, error)
	GetCycleByDate(ctx context.Context, arg GetCycleByDateParams) (Cycle, error)
	GetCyclesByDateRange(ctx context.Context, arg GetCyclesByDateRangeParams) ([]Cycle, error)
	GetCyclesByDateRangeCursor(ctx context.Context, arg GetCyclesByDateRangeCursorParams) ([]Cycle, error)
	GetLastNotificationPoll(ctx context.Context) (*time.Time, error)
	GetLatestCycles(ctx context.Context, limit int64) ([]Cycle, error)
	GetNapsByCycleID(ctx context.Context, cycleID int64) ([]Sleep, error)
	GetPendingCycles(ctx context.Context) ([]Cycle, error)
	GetRecoveriesByCycleIDs(ctx context.Context, cycleIds []int64) ([]Recovery, error)
	GetRecovery(ctx context.Context, cycleID int64) (Recovery, error)
	GetSleep(ctx context.Context, id string) (Sleep, error)
	GetSleepByCycleID(ctx context.Context, cycleID int64) (Sleep, error)
	GetSleepsByDateRange(ctx context.Context, arg GetSleepsByDateRangeParams) ([]Sleep, error)
	GetSleepsByDateRangeCursor(ctx context.Context, arg GetSleepsByDateRangeCursorParams) ([]Sleep, error)
	GetSyncState(ctx context.Context) (SyncState, error)
	GetTokenMetadata(ctx context.Context) (Token, error)
	GetWorkout(ctx context.Context, id string) (Workout, error)
	GetWorkoutsByCycleID(ctx context.Context, cycleID int64) ([]Workout, error)
	GetWorkoutsByDateRange(ctx context.Context, arg GetWorkoutsByDateRangeParams) ([]Workout, error)
	GetWorkoutsByDateRangeCursor(ctx context.Context, arg GetWorkoutsByDateRangeCursorParams) ([]Workout, error)
	MarkBackfillComplete(ctx context.Context) error
	UpdateBackfillWatermark(ctx context.Context, backfillWatermark *time.Time) error
	UpdateLastFullSync(ctx context.Context, lastFullSync *time.Time) error
	UpdateLastNotificationPoll(ctx context.Context, lastNotificationPoll *time.Time) error
	UpsertCycle(ctx context.Context, arg UpsertCycleParams) error
	UpsertRecovery(ctx context.Context, arg UpsertRecoveryParams) error
	UpsertSleep(ctx context.Context, arg UpsertSleepParams) error
	UpsertSyncState(ctx context.Context, arg UpsertSyncStateParams) error
	UpsertTokenMetadata(ctx context.Context, arg UpsertTokenMetadataParams) error
	UpsertWorkout(ctx context.Context, arg UpsertWorkoutParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) DeleteCycle

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

func (*Queries) DeleteRecovery

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

func (*Queries) DeleteSleep

func (q *Queries) DeleteSleep(ctx context.Context, id string) error

func (*Queries) DeleteTokenMetadata

func (q *Queries) DeleteTokenMetadata(ctx context.Context) error

func (*Queries) DeleteWorkout

func (q *Queries) DeleteWorkout(ctx context.Context, id string) error

func (*Queries) GetCycle

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

func (*Queries) GetCycleByDate

func (q *Queries) GetCycleByDate(ctx context.Context, arg GetCycleByDateParams) (Cycle, error)

func (*Queries) GetCyclesByDateRange

func (q *Queries) GetCyclesByDateRange(ctx context.Context, arg GetCyclesByDateRangeParams) ([]Cycle, error)

func (*Queries) GetCyclesByDateRangeCursor

func (q *Queries) GetCyclesByDateRangeCursor(ctx context.Context, arg GetCyclesByDateRangeCursorParams) ([]Cycle, error)

func (*Queries) GetLastNotificationPoll

func (q *Queries) GetLastNotificationPoll(ctx context.Context) (*time.Time, error)

func (*Queries) GetLatestCycles

func (q *Queries) GetLatestCycles(ctx context.Context, limit int64) ([]Cycle, error)

func (*Queries) GetNapsByCycleID

func (q *Queries) GetNapsByCycleID(ctx context.Context, cycleID int64) ([]Sleep, error)

func (*Queries) GetPendingCycles

func (q *Queries) GetPendingCycles(ctx context.Context) ([]Cycle, error)

func (*Queries) GetRecoveriesByCycleIDs

func (q *Queries) GetRecoveriesByCycleIDs(ctx context.Context, cycleIds []int64) ([]Recovery, error)

func (*Queries) GetRecovery

func (q *Queries) GetRecovery(ctx context.Context, cycleID int64) (Recovery, error)

func (*Queries) GetSleep

func (q *Queries) GetSleep(ctx context.Context, id string) (Sleep, error)

func (*Queries) GetSleepByCycleID

func (q *Queries) GetSleepByCycleID(ctx context.Context, cycleID int64) (Sleep, error)

func (*Queries) GetSleepsByDateRange

func (q *Queries) GetSleepsByDateRange(ctx context.Context, arg GetSleepsByDateRangeParams) ([]Sleep, error)

func (*Queries) GetSleepsByDateRangeCursor

func (q *Queries) GetSleepsByDateRangeCursor(ctx context.Context, arg GetSleepsByDateRangeCursorParams) ([]Sleep, error)

func (*Queries) GetSyncState

func (q *Queries) GetSyncState(ctx context.Context) (SyncState, error)

func (*Queries) GetTokenMetadata

func (q *Queries) GetTokenMetadata(ctx context.Context) (Token, error)

func (*Queries) GetWorkout

func (q *Queries) GetWorkout(ctx context.Context, id string) (Workout, error)

func (*Queries) GetWorkoutsByCycleID

func (q *Queries) GetWorkoutsByCycleID(ctx context.Context, cycleID int64) ([]Workout, error)

func (*Queries) GetWorkoutsByDateRange

func (q *Queries) GetWorkoutsByDateRange(ctx context.Context, arg GetWorkoutsByDateRangeParams) ([]Workout, error)

func (*Queries) GetWorkoutsByDateRangeCursor

func (q *Queries) GetWorkoutsByDateRangeCursor(ctx context.Context, arg GetWorkoutsByDateRangeCursorParams) ([]Workout, error)

func (*Queries) MarkBackfillComplete

func (q *Queries) MarkBackfillComplete(ctx context.Context) error

func (*Queries) UpdateBackfillWatermark

func (q *Queries) UpdateBackfillWatermark(ctx context.Context, backfillWatermark *time.Time) error

func (*Queries) UpdateLastFullSync

func (q *Queries) UpdateLastFullSync(ctx context.Context, lastFullSync *time.Time) error

func (*Queries) UpdateLastNotificationPoll

func (q *Queries) UpdateLastNotificationPoll(ctx context.Context, lastNotificationPoll *time.Time) error

func (*Queries) UpsertCycle

func (q *Queries) UpsertCycle(ctx context.Context, arg UpsertCycleParams) error

func (*Queries) UpsertRecovery

func (q *Queries) UpsertRecovery(ctx context.Context, arg UpsertRecoveryParams) error

func (*Queries) UpsertSleep

func (q *Queries) UpsertSleep(ctx context.Context, arg UpsertSleepParams) error

func (*Queries) UpsertSyncState

func (q *Queries) UpsertSyncState(ctx context.Context, arg UpsertSyncStateParams) error

func (*Queries) UpsertTokenMetadata

func (q *Queries) UpsertTokenMetadata(ctx context.Context, arg UpsertTokenMetadataParams) error

func (*Queries) UpsertWorkout

func (q *Queries) UpsertWorkout(ctx context.Context, arg UpsertWorkoutParams) error

func (*Queries) WithTx

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

type Recovery

type Recovery struct {
	CycleID    int64     `json:"cycle_id"`
	SleepID    string    `json:"sleep_id"`
	UserID     int64     `json:"user_id"`
	CreatedAt  time.Time `json:"created_at"`
	UpdatedAt  time.Time `json:"updated_at"`
	ScoreState string    `json:"score_state"`
	ScoreJson  *string   `json:"score_json"`
	FetchedAt  time.Time `json:"fetched_at"`
}

type Sleep

type Sleep struct {
	ID             string    `json:"id"`
	CycleID        int64     `json:"cycle_id"`
	V1ID           *int64    `json:"v1_id"`
	UserID         int64     `json:"user_id"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
	Start          time.Time `json:"start"`
	End            time.Time `json:"end"`
	TimezoneOffset string    `json:"timezone_offset"`
	Nap            int64     `json:"nap"`
	ScoreState     string    `json:"score_state"`
	ScoreJson      *string   `json:"score_json"`
	FetchedAt      time.Time `json:"fetched_at"`
}

type SyncState

type SyncState struct {
	ID                   int64      `json:"id"`
	BackfillComplete     int64      `json:"backfill_complete"`
	BackfillWatermark    *time.Time `json:"backfill_watermark"`
	LastFullSync         *time.Time `json:"last_full_sync"`
	CreatedAt            *time.Time `json:"created_at"`
	UpdatedAt            *time.Time `json:"updated_at"`
	LastNotificationPoll *time.Time `json:"last_notification_poll"`
}

type Token

type Token struct {
	ID        int64     `json:"id"`
	TokenType string    `json:"token_type"`
	Expiry    time.Time `json:"expiry"`
}

type UpsertCycleParams

type UpsertCycleParams struct {
	ID             int64      `json:"id"`
	UserID         int64      `json:"user_id"`
	CreatedAt      time.Time  `json:"created_at"`
	UpdatedAt      time.Time  `json:"updated_at"`
	Start          time.Time  `json:"start"`
	End            *time.Time `json:"end"`
	TimezoneOffset string     `json:"timezone_offset"`
	ScoreState     string     `json:"score_state"`
	ScoreJson      *string    `json:"score_json"`
}

type UpsertRecoveryParams

type UpsertRecoveryParams struct {
	CycleID    int64     `json:"cycle_id"`
	SleepID    string    `json:"sleep_id"`
	UserID     int64     `json:"user_id"`
	CreatedAt  time.Time `json:"created_at"`
	UpdatedAt  time.Time `json:"updated_at"`
	ScoreState string    `json:"score_state"`
	ScoreJson  *string   `json:"score_json"`
}

type UpsertSleepParams

type UpsertSleepParams struct {
	ID             string    `json:"id"`
	CycleID        int64     `json:"cycle_id"`
	V1ID           *int64    `json:"v1_id"`
	UserID         int64     `json:"user_id"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
	Start          time.Time `json:"start"`
	End            time.Time `json:"end"`
	TimezoneOffset string    `json:"timezone_offset"`
	Nap            int64     `json:"nap"`
	ScoreState     string    `json:"score_state"`
	ScoreJson      *string   `json:"score_json"`
}

type UpsertSyncStateParams

type UpsertSyncStateParams struct {
	BackfillComplete  int64      `json:"backfill_complete"`
	BackfillWatermark *time.Time `json:"backfill_watermark"`
	LastFullSync      *time.Time `json:"last_full_sync"`
}

type UpsertTokenMetadataParams

type UpsertTokenMetadataParams struct {
	TokenType string    `json:"token_type"`
	Expiry    time.Time `json:"expiry"`
}

type UpsertWorkoutParams

type UpsertWorkoutParams struct {
	ID             string    `json:"id"`
	V1ID           *int64    `json:"v1_id"`
	UserID         int64     `json:"user_id"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
	Start          time.Time `json:"start"`
	End            time.Time `json:"end"`
	TimezoneOffset string    `json:"timezone_offset"`
	SportName      string    `json:"sport_name"`
	ScoreState     string    `json:"score_state"`
	ScoreJson      *string   `json:"score_json"`
}

type Workout

type Workout struct {
	ID             string    `json:"id"`
	V1ID           *int64    `json:"v1_id"`
	UserID         int64     `json:"user_id"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
	Start          time.Time `json:"start"`
	End            time.Time `json:"end"`
	TimezoneOffset string    `json:"timezone_offset"`
	SportName      string    `json:"sport_name"`
	ScoreState     string    `json:"score_state"`
	ScoreJson      *string   `json:"score_json"`
	FetchedAt      time.Time `json:"fetched_at"`
}

Jump to

Keyboard shortcuts

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