gen

package
v0.7.13 Latest Latest
Warning

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

Go to latest
Published: May 2, 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 AppUser

type AppUser struct {
	ID          pgtype.UUID
	OrgID       pgtype.UUID
	GithubLogin string
	Role        string
	CreatedAt   pgtype.Timestamptz
	LastLoginAt pgtype.Timestamptz
}

type AuditLog

type AuditLog struct {
	ID         int64
	OrgID      pgtype.UUID
	Actor      *string
	Action     string
	TargetKind *string
	TargetID   pgtype.UUID
	Ts         pgtype.Timestamptz
	DetailJson []byte
}

type AutoPauseScheduleParams

type AutoPauseScheduleParams struct {
	ID              pgtype.UUID
	AutoPauseReason *string
}

type ClearScheduleOverridesParams

type ClearScheduleOverridesParams struct {
	ID    pgtype.UUID
	OrgID pgtype.UUID
}

type CreateUserParams

type CreateUserParams struct {
	OrgID       pgtype.UUID
	GithubLogin string
	Role        string
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DeleteMissingSkillsParams

type DeleteMissingSkillsParams struct {
	RepoID  pgtype.UUID
	Column2 []string
}

type DeleteRepoConnectionParams

type DeleteRepoConnectionParams struct {
	ID    pgtype.UUID
	OrgID pgtype.UUID
}

type DeleteSecretParams

type DeleteSecretParams struct {
	OrgID pgtype.UUID
	Name  string
}

type DeleteUserIfNotLastParams

type DeleteUserIfNotLastParams struct {
	OrgID       pgtype.UUID
	GithubLogin string
}

type DeleteUserParams

type DeleteUserParams struct {
	OrgID       pgtype.UUID
	GithubLogin string
}

type DisableMissingSchedulesParams

type DisableMissingSchedulesParams struct {
	SkillID pgtype.UUID
	Column2 []string
}

type FinalizeRunParams

type FinalizeRunParams struct {
	ID                 pgtype.UUID
	Status             string
	DurationMs         *int32
	TokensIn           *int32
	TokensOut          *int32
	CostCents          *int32
	ErrorKind          *string
	ErrorMsg           *string
	WritebackCommitSha *string
}

type GetRepoConnectionByOwnerNameParams

type GetRepoConnectionByOwnerNameParams struct {
	OrgID pgtype.UUID
	Owner string
	Name  string
}

type GetRunForAdminRow

type GetRunForAdminRow struct {
	ID                 pgtype.UUID
	OrgID              pgtype.UUID
	ScheduleID         pgtype.UUID
	SkillSha           string
	FireTime           pgtype.Timestamptz
	Status             string
	FireReason         string
	Actor              *string
	StartedAt          pgtype.Timestamptz
	FinishedAt         pgtype.Timestamptz
	DurationMs         *int32
	TokensIn           *int32
	TokensOut          *int32
	CostCents          *int32
	ErrorKind          *string
	ErrorMsg           *string
	WritebackCommitSha *string
	CreatedAt          pgtype.Timestamptz
	ScheduleName       string
	Cron               string
	SkillPath          string
	Owner              string
	RepoName           string
}

type GetRunForContextRow

type GetRunForContextRow struct {
	ID                 pgtype.UUID
	OrgID              pgtype.UUID
	ScheduleID         pgtype.UUID
	SkillSha           string
	FireTime           pgtype.Timestamptz
	Status             string
	FireReason         string
	Actor              *string
	StartedAt          pgtype.Timestamptz
	FinishedAt         pgtype.Timestamptz
	DurationMs         *int32
	TokensIn           *int32
	TokensOut          *int32
	CostCents          *int32
	ErrorKind          *string
	ErrorMsg           *string
	WritebackCommitSha *string
	RunnerPid          *int32
	RunnerTokenHash    string
	CreatedAt          pgtype.Timestamptz
	ScheduleName       string
	Cron               string
	Timezone           string
	TimeoutSec         int32
	Provider           string
	Model              string
	LlmSecretRef       *string
	LlmEndpoint        *string
	LlmDeployment      *string
	DestinationsJson   []byte
	WritebackJson      []byte
	EnvJson            []byte
	McpEnvJson         []byte
	MaxTurns           *int32
	SkillIDJoined      pgtype.UUID
	SkillPath          string
	SkillRepoID        pgtype.UUID
	FrontmatterJson    []byte
	Owner              string
	RepoName           string
	DefaultBranch      string
	GithubAppInstallID int64
}

type GetRunWritebackConfigRow

type GetRunWritebackConfigRow struct {
	WritebackJson      []byte
	GithubAppInstallID int64
	Owner              string
	RepoName           string
}

type GetScheduleAutoPauseConfigRow

type GetScheduleAutoPauseConfigRow struct {
	OrgID          pgtype.UUID
	AutoPauseAfter *int32
	LastEnabledAt  pgtype.Timestamptz
	Enabled        bool
}

type GetScheduleForTriggerRow

type GetScheduleForTriggerRow struct {
	ScheduleID pgtype.UUID
	OrgID      pgtype.UUID
	SkillID    pgtype.UUID
	SkillSha   string
}

type GetSecretByNameParams

type GetSecretByNameParams struct {
	OrgID pgtype.UUID
	Name  string
}

type GetUserRoleParams

type GetUserRoleParams struct {
	OrgID       pgtype.UUID
	GithubLogin string
}

type InsertAuditLogParams

type InsertAuditLogParams struct {
	OrgID      pgtype.UUID
	Actor      *string
	Action     string
	TargetKind *string
	TargetID   pgtype.UUID
	DetailJson []byte
}

type InsertRepoConnectionParams

type InsertRepoConnectionParams struct {
	OrgID              pgtype.UUID
	GithubAppInstallID int64
	Owner              string
	Name               string
	DefaultBranch      string
	SyncIntervalSec    int32
}

type InsertRunEventParams

type InsertRunEventParams struct {
	RunID       pgtype.UUID
	Level       string
	EventType   string
	PayloadJson []byte
}

type InsertRunParams

type InsertRunParams struct {
	OrgID           pgtype.UUID
	ScheduleID      pgtype.UUID
	SkillSha        string
	FireTime        pgtype.Timestamptz
	FireReason      string
	Actor           *string
	RunnerTokenHash string
}

type InsertRunRow

type InsertRunRow struct {
	ID                 pgtype.UUID
	OrgID              pgtype.UUID
	ScheduleID         pgtype.UUID
	SkillSha           string
	FireTime           pgtype.Timestamptz
	Status             string
	FireReason         string
	Actor              *string
	StartedAt          pgtype.Timestamptz
	FinishedAt         pgtype.Timestamptz
	DurationMs         *int32
	TokensIn           *int32
	TokensOut          *int32
	CostCents          *int32
	ErrorKind          *string
	ErrorMsg           *string
	WritebackCommitSha *string
	RunnerPid          *int32
	RunnerTokenHash    string
	CreatedAt          pgtype.Timestamptz
	Inserted           bool
}

type ListAuditLogByOrgParams

type ListAuditLogByOrgParams struct {
	OrgID  pgtype.UUID
	Limit  int32
	Offset int32
}

type ListDueSchedulesWithShaRow

type ListDueSchedulesWithShaRow struct {
	ID                   pgtype.UUID
	OrgID                pgtype.UUID
	SkillID              pgtype.UUID
	Name                 string
	Cron                 string
	Timezone             string
	OverlapPolicy        string
	TimeoutSec           int32
	Enabled              bool
	Provider             string
	Model                string
	LlmSecretRef         *string
	LlmEndpoint          *string
	LlmDeployment        *string
	DestinationsJson     []byte
	WritebackJson        []byte
	EnvJson              []byte
	AutoPauseAfter       *int32
	AutoPausedAt         pgtype.Timestamptz
	AutoPauseReason      *string
	LastEnabledAt        pgtype.Timestamptz
	McpEnvJson           []byte
	UiOverridesJson      []byte
	MaxTurns             *int32
	CopilotTokenRefsJson []byte
	NextFireAt           pgtype.Timestamptz
	CreatedAt            pgtype.Timestamptz
	UpdatedAt            pgtype.Timestamptz
	SkillSha             string
	InstallID            int64
}

type ListRecentTerminalScheduledRunsParams

type ListRecentTerminalScheduledRunsParams struct {
	ScheduleID pgtype.UUID
	CreatedAt  pgtype.Timestamptz
	Limit      int32
}

type ListRunEventsSinceParams

type ListRunEventsSinceParams struct {
	RunID pgtype.UUID
	ID    int64
}

type ListRunsForOrgParams

type ListRunsForOrgParams struct {
	OrgID pgtype.UUID
	Limit int32
}

type ListRunsForOrgRow

type ListRunsForOrgRow struct {
	ID           pgtype.UUID
	Status       string
	FireReason   string
	Actor        *string
	StartedAt    pgtype.Timestamptz
	FinishedAt   pgtype.Timestamptz
	DurationMs   *int32
	ErrorKind    *string
	ErrorMsg     *string
	CreatedAt    pgtype.Timestamptz
	ScheduleName string
	SkillPath    string
	Owner        string
	RepoName     string
}

type ListRunsForScheduleParams

type ListRunsForScheduleParams struct {
	OrgID pgtype.UUID
	Name  string
	Limit int32
}

type ListRunsForScheduleRow

type ListRunsForScheduleRow struct {
	ID           pgtype.UUID
	Status       string
	FireReason   string
	Actor        *string
	StartedAt    pgtype.Timestamptz
	FinishedAt   pgtype.Timestamptz
	DurationMs   *int32
	ErrorKind    *string
	ErrorMsg     *string
	CreatedAt    pgtype.Timestamptz
	ScheduleName string
	SkillPath    string
	Owner        string
	RepoName     string
}

type ListSchedulesByOrgRow

type ListSchedulesByOrgRow struct {
	ID                   pgtype.UUID
	OrgID                pgtype.UUID
	SkillID              pgtype.UUID
	Name                 string
	Cron                 string
	Timezone             string
	OverlapPolicy        string
	TimeoutSec           int32
	Enabled              bool
	Provider             string
	Model                string
	LlmSecretRef         *string
	LlmEndpoint          *string
	LlmDeployment        *string
	DestinationsJson     []byte
	WritebackJson        []byte
	EnvJson              []byte
	AutoPauseAfter       *int32
	AutoPausedAt         pgtype.Timestamptz
	AutoPauseReason      *string
	LastEnabledAt        pgtype.Timestamptz
	McpEnvJson           []byte
	UiOverridesJson      []byte
	MaxTurns             *int32
	CopilotTokenRefsJson []byte
	NextFireAt           pgtype.Timestamptz
	CreatedAt            pgtype.Timestamptz
	UpdatedAt            pgtype.Timestamptz
	SkillPath            string
	SkillName            string
	SkillFrontmatterJson []byte
	Owner                string
	RepoName             string
}

type ListSecretNamesRow

type ListSecretNamesRow struct {
	Name       string
	Version    int32
	CreatedAt  pgtype.Timestamptz
	UpdatedAt  pgtype.Timestamptz
	LastUsedAt pgtype.Timestamptz
}

type ListSkillsByOrgRow

type ListSkillsByOrgRow struct {
	ID              pgtype.UUID
	OrgID           pgtype.UUID
	RepoID          pgtype.UUID
	Path            string
	Name            string
	CurrentSha      string
	FrontmatterJson []byte
	UpdatedAt       pgtype.Timestamptz
	Owner           string
	RepoName        string
}

type MarkRepoSyncErrorParams

type MarkRepoSyncErrorParams struct {
	ID            pgtype.UUID
	LastSyncError *string
}

type MarkRepoSyncedOKParams

type MarkRepoSyncedOKParams struct {
	ID                pgtype.UUID
	LastSyncedHeadSha *string
}

type Organization

type Organization struct {
	ID        pgtype.UUID
	Name      string
	CreatedAt pgtype.Timestamptz
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AutoPauseSchedule

func (q *Queries) AutoPauseSchedule(ctx context.Context, arg AutoPauseScheduleParams) (int64, error)

Idempotent conditional pause. Returns the number of rows affected so the caller can distinguish "we paused it" (1) from "someone else already paused it" (0, in which case the caller must not emit duplicate audit rows).

func (*Queries) ClearScheduleOverrides

func (q *Queries) ClearScheduleOverrides(ctx context.Context, arg ClearScheduleOverridesParams) (Schedule, error)

func (*Queries) CountAdmins

func (q *Queries) CountAdmins(ctx context.Context, orgID pgtype.UUID) (int64, error)

func (*Queries) CountAuditLogByOrg

func (q *Queries) CountAuditLogByOrg(ctx context.Context, orgID pgtype.UUID) (int64, error)

func (*Queries) CountUsers

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

func (*Queries) CreateOrganization

func (q *Queries) CreateOrganization(ctx context.Context, name string) (Organization, error)

func (*Queries) CreateUser

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

func (*Queries) DeleteMissingSkills

func (q *Queries) DeleteMissingSkills(ctx context.Context, arg DeleteMissingSkillsParams) error

Removes skill rows under `repo_id` whose path is NOT in the given slice. Cascades to schedule rows.

func (*Queries) DeleteRepoConnection

func (q *Queries) DeleteRepoConnection(ctx context.Context, arg DeleteRepoConnectionParams) (int64, error)

func (*Queries) DeleteRun

func (q *Queries) DeleteRun(ctx context.Context, id pgtype.UUID) error

Used when `skip` overlap policy discards the freshly-inserted pending row.

func (*Queries) DeleteSecret

func (q *Queries) DeleteSecret(ctx context.Context, arg DeleteSecretParams) (int64, error)

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, arg DeleteUserParams) (int64, error)

func (*Queries) DeleteUserIfNotLast

func (q *Queries) DeleteUserIfNotLast(ctx context.Context, arg DeleteUserIfNotLastParams) (int64, error)

Atomic guard for the last-user invariant. The subquery evaluates within the same statement, so two concurrent admin deletes can't both observe count=2 and both succeed — at most one wins, the loser sees affected=0.

func (*Queries) DisableMissingSchedules

func (q *Queries) DisableMissingSchedules(ctx context.Context, arg DisableMissingSchedulesParams) error

Sets enabled=false on any schedule under `skill_id` whose name is NOT in the given slice. Schedules are soft-disabled (not deleted) to preserve run history.

func (*Queries) FinalizeRun

func (q *Queries) FinalizeRun(ctx context.Context, arg FinalizeRunParams) (Run, error)

Guarded against stale/duplicate finalization: the WHERE clause refuses to update a row already in a terminal state (succeeded / partial_failure / failed). A runner that crashed and restarted can't clobber the original finalization — the query returns zero rows (pgx.ErrNoRows) and the handler maps that to 409 Conflict.

func (*Queries) GetFirstOrganization

func (q *Queries) GetFirstOrganization(ctx context.Context) (Organization, error)

func (*Queries) GetRepoConnection

func (q *Queries) GetRepoConnection(ctx context.Context, id pgtype.UUID) (RepoConnection, error)

func (*Queries) GetRepoConnectionByOwnerName

func (q *Queries) GetRepoConnectionByOwnerName(ctx context.Context, arg GetRepoConnectionByOwnerNameParams) (RepoConnection, error)

func (*Queries) GetRun

func (q *Queries) GetRun(ctx context.Context, id pgtype.UUID) (Run, error)

func (*Queries) GetRunForAdmin

func (q *Queries) GetRunForAdmin(ctx context.Context, id pgtype.UUID) (GetRunForAdminRow, error)

Used by `cronfoundry admin show-run`.

func (*Queries) GetRunForContext

func (q *Queries) GetRunForContext(ctx context.Context, id pgtype.UUID) (GetRunForContextRow, error)

Returns the run + its schedule + skill + repo so the runner can assemble its full context in one query.

func (*Queries) GetRunRepoID

func (q *Queries) GetRunRepoID(ctx context.Context, id pgtype.UUID) (pgtype.UUID, error)

Returns the repo_id the given run is bound to, via its schedule → skill. Used by the clone-url handler to enforce that a run can only fetch the clone URL for its own repo.

func (*Queries) GetRunWritebackConfig

func (q *Queries) GetRunWritebackConfig(ctx context.Context, id pgtype.UUID) (GetRunWritebackConfigRow, error)

func (*Queries) GetScheduleAutoPauseConfig

func (q *Queries) GetScheduleAutoPauseConfig(ctx context.Context, id pgtype.UUID) (GetScheduleAutoPauseConfigRow, error)

Returns the fields evaluateAutoPause needs to decide whether to trigger a pause and emit audit/run_event rows: org_id (for audit), the per-schedule threshold override (nullable), and the anti-flap window boundary. `enabled` is returned for tests/debug; the pause query guards on it independently via `WHERE enabled = true`.

func (*Queries) GetScheduleByID

func (q *Queries) GetScheduleByID(ctx context.Context, id pgtype.UUID) (Schedule, error)

func (*Queries) GetScheduleForTrigger

func (q *Queries) GetScheduleForTrigger(ctx context.Context, id pgtype.UUID) (GetScheduleForTriggerRow, error)

Used by the manual trigger endpoint to assemble a new run row. Returns the schedule plus the skill's current_sha so the INSERT can be atomic (rather than two round trips).

func (*Queries) GetSecretByName

func (q *Queries) GetSecretByName(ctx context.Context, arg GetSecretByNameParams) (Secret, error)

func (*Queries) GetUserRole

func (q *Queries) GetUserRole(ctx context.Context, arg GetUserRoleParams) (string, error)

func (*Queries) InsertAuditLog

func (q *Queries) InsertAuditLog(ctx context.Context, arg InsertAuditLogParams) error

func (*Queries) InsertRepoConnection

func (q *Queries) InsertRepoConnection(ctx context.Context, arg InsertRepoConnectionParams) (RepoConnection, error)

func (*Queries) InsertRun

func (q *Queries) InsertRun(ctx context.Context, arg InsertRunParams) (InsertRunRow, error)

Idempotent for scheduled fires (ON CONFLICT on the partial unique index run_schedule_firetime_unique). Manual runs always have fire_time=NULL and pass through without collision — the index predicate (WHERE fire_time IS NOT NULL) must be repeated on ON CONFLICT so Postgres matches the partial index rather than requiring a full unique constraint.

On conflict (i.e. another concurrent tick already inserted the same (schedule_id, fire_time) row), this query returns the existing row with `inserted=false`. This lets callers distinguish a brand-new insert (`inserted=true`) from a concurrent-duplicate outcome — without falling back to a zero-UUID sentinel that's easy to misuse.

func (*Queries) InsertRunEvent

func (q *Queries) InsertRunEvent(ctx context.Context, arg InsertRunEventParams) error

func (*Queries) ListActiveRunsForSchedule

func (q *Queries) ListActiveRunsForSchedule(ctx context.Context, scheduleID pgtype.UUID) ([]Run, error)

Used for overlap-policy decisions. Returns runs in non-terminal states.

func (*Queries) ListAuditLogByOrg

func (q *Queries) ListAuditLogByOrg(ctx context.Context, arg ListAuditLogByOrgParams) ([]AuditLog, error)

func (*Queries) ListDueRepoConnections

func (q *Queries) ListDueRepoConnections(ctx context.Context) ([]RepoConnection, error)

Returns repos whose last sync is older than sync_interval_sec, or which have never been synced.

func (*Queries) ListDueSchedules

func (q *Queries) ListDueSchedules(ctx context.Context) ([]Schedule, error)

Returns schedules ready to fire: enabled AND next_fire_at <= now. Ordered by next_fire_at so we dispatch oldest-due first.

func (*Queries) ListDueSchedulesWithSha

func (q *Queries) ListDueSchedulesWithSha(ctx context.Context) ([]ListDueSchedulesWithShaRow, error)

Like ListDueSchedules but joins the skill to include current_sha so the scheduler can set it on the new run row without a second query. Also joins repo_connection for the installation ID needed at dispatch.

func (*Queries) ListRecentTerminalScheduledRuns

func (q *Queries) ListRecentTerminalScheduledRuns(ctx context.Context, arg ListRecentTerminalScheduledRunsParams) ([]string, error)

Used by evaluateAutoPause. Returns the last N terminal scheduled runs for a schedule, within the anti-flap window defined by last_enabled_at. Uses `created_at` (NOT NULL, matches the existing run_schedule_created_idx) so failed-before-dispatch runs (started_at NULL) are still counted. `id DESC` is a stable tie-breaker when two runs share created_at (tests and tight scheduler clocks can produce ties at microsecond resolution).

func (*Queries) ListRepoConnections

func (q *Queries) ListRepoConnections(ctx context.Context, orgID pgtype.UUID) ([]RepoConnection, error)

func (*Queries) ListRunEvents

func (q *Queries) ListRunEvents(ctx context.Context, runID pgtype.UUID) ([]RunEvent, error)

func (*Queries) ListRunEventsSince

func (q *Queries) ListRunEventsSince(ctx context.Context, arg ListRunEventsSinceParams) ([]RunEvent, error)

func (*Queries) ListRunsForOrg

func (q *Queries) ListRunsForOrg(ctx context.Context, arg ListRunsForOrgParams) ([]ListRunsForOrgRow, error)

Used by `cronfoundry admin list-runs`. Returns the most recent N runs, joined to schedule + skill names for display.

func (*Queries) ListRunsForSchedule

func (q *Queries) ListRunsForSchedule(ctx context.Context, arg ListRunsForScheduleParams) ([]ListRunsForScheduleRow, error)

Same shape as ListRunsForOrg but filtered to a single schedule by name.

func (*Queries) ListSchedulesByOrg

func (q *Queries) ListSchedulesByOrg(ctx context.Context, orgID pgtype.UUID) ([]ListSchedulesByOrgRow, error)

func (*Queries) ListSecretNames

func (q *Queries) ListSecretNames(ctx context.Context, orgID pgtype.UUID) ([]ListSecretNamesRow, error)

func (*Queries) ListSkillsByOrg

func (q *Queries) ListSkillsByOrg(ctx context.Context, orgID pgtype.UUID) ([]ListSkillsByOrgRow, error)

func (*Queries) ListSkillsByRepo

func (q *Queries) ListSkillsByRepo(ctx context.Context, repoID pgtype.UUID) ([]Skill, error)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context, orgID pgtype.UUID) ([]AppUser, error)

func (*Queries) MarkRepoSyncError

func (q *Queries) MarkRepoSyncError(ctx context.Context, arg MarkRepoSyncErrorParams) error

func (*Queries) MarkRepoSyncedOK

func (q *Queries) MarkRepoSyncedOK(ctx context.Context, arg MarkRepoSyncedOKParams) error

func (*Queries) OrphanSweep

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

Marks non-terminal runs as failed if they've been sitting longer than their schedule's timeout + 5-minute grace. Recovers from runner crashes and service restarts.

func (*Queries) SetRunRunning

func (q *Queries) SetRunRunning(ctx context.Context, arg SetRunRunningParams) (Run, error)

func (*Queries) SetScheduleEnabled

func (q *Queries) SetScheduleEnabled(ctx context.Context, arg SetScheduleEnabledParams) (Schedule, error)

On enable: clear any auto-pause state. last_enabled_at only advances on a real false→true transition (not on an idempotent enable-already-enabled call), so the anti-flap window isn't silently reset when, e.g., two UI tabs race to click Resume. On disable: leave the auto-pause columns untouched — a user-initiated pause doesn't touch auto-pause state.

func (*Queries) SetScheduleOverrides

func (q *Queries) SetScheduleOverrides(ctx context.Context, arg SetScheduleOverridesParams) (Schedule, error)

func (*Queries) SetUserRole

func (q *Queries) SetUserRole(ctx context.Context, arg SetUserRoleParams) error

func (*Queries) TouchSecret

func (q *Queries) TouchSecret(ctx context.Context, id pgtype.UUID) error

func (*Queries) UpdateScheduleNextFireAt

func (q *Queries) UpdateScheduleNextFireAt(ctx context.Context, arg UpdateScheduleNextFireAtParams) error

func (*Queries) UpsertSchedule

func (q *Queries) UpsertSchedule(ctx context.Context, arg UpsertScheduleParams) (Schedule, error)

func (*Queries) UpsertSecret

func (q *Queries) UpsertSecret(ctx context.Context, arg UpsertSecretParams) (Secret, error)

func (*Queries) UpsertSkill

func (q *Queries) UpsertSkill(ctx context.Context, arg UpsertSkillParams) (Skill, error)

func (*Queries) UpsertUserOnLogin

func (q *Queries) UpsertUserOnLogin(ctx context.Context, arg UpsertUserOnLoginParams) (AppUser, error)

func (*Queries) WithTx

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

type RepoConnection

type RepoConnection struct {
	ID                 pgtype.UUID
	OrgID              pgtype.UUID
	GithubAppInstallID int64
	Owner              string
	Name               string
	DefaultBranch      string
	SyncIntervalSec    int32
	LastSyncedAt       pgtype.Timestamptz
	LastSyncedHeadSha  *string
	LastSyncError      *string
	CreatedAt          pgtype.Timestamptz
}

type Run

type Run struct {
	ID                 pgtype.UUID
	OrgID              pgtype.UUID
	ScheduleID         pgtype.UUID
	SkillSha           string
	FireTime           pgtype.Timestamptz
	Status             string
	FireReason         string
	Actor              *string
	StartedAt          pgtype.Timestamptz
	FinishedAt         pgtype.Timestamptz
	DurationMs         *int32
	TokensIn           *int32
	TokensOut          *int32
	CostCents          *int32
	ErrorKind          *string
	ErrorMsg           *string
	WritebackCommitSha *string
	RunnerPid          *int32
	RunnerTokenHash    string
	CreatedAt          pgtype.Timestamptz
}

type RunEvent

type RunEvent struct {
	ID          int64
	RunID       pgtype.UUID
	Ts          pgtype.Timestamptz
	Level       string
	EventType   string
	PayloadJson []byte
}

type Schedule

type Schedule struct {
	ID                   pgtype.UUID
	OrgID                pgtype.UUID
	SkillID              pgtype.UUID
	Name                 string
	Cron                 string
	Timezone             string
	OverlapPolicy        string
	TimeoutSec           int32
	Enabled              bool
	Provider             string
	Model                string
	LlmSecretRef         *string
	LlmEndpoint          *string
	LlmDeployment        *string
	DestinationsJson     []byte
	WritebackJson        []byte
	EnvJson              []byte
	AutoPauseAfter       *int32
	AutoPausedAt         pgtype.Timestamptz
	AutoPauseReason      *string
	LastEnabledAt        pgtype.Timestamptz
	McpEnvJson           []byte
	UiOverridesJson      []byte
	MaxTurns             *int32
	CopilotTokenRefsJson []byte
	NextFireAt           pgtype.Timestamptz
	CreatedAt            pgtype.Timestamptz
	UpdatedAt            pgtype.Timestamptz
}

type Secret

type Secret struct {
	ID         pgtype.UUID
	OrgID      pgtype.UUID
	Name       string
	DekWrapped []byte
	Ciphertext []byte
	Nonce      []byte
	Version    int32
	CreatedAt  pgtype.Timestamptz
	UpdatedAt  pgtype.Timestamptz
	LastUsedAt pgtype.Timestamptz
}

type SetRunRunningParams

type SetRunRunningParams struct {
	ID        pgtype.UUID
	RunnerPid *int32
}

type SetScheduleEnabledParams

type SetScheduleEnabledParams struct {
	ID      pgtype.UUID
	Enabled bool
	OrgID   pgtype.UUID
}

type SetScheduleOverridesParams

type SetScheduleOverridesParams struct {
	ID      pgtype.UUID
	Column2 []byte
	OrgID   pgtype.UUID
}

type SetUserRoleParams

type SetUserRoleParams struct {
	OrgID       pgtype.UUID
	GithubLogin string
	Role        string
}

type Skill

type Skill struct {
	ID              pgtype.UUID
	OrgID           pgtype.UUID
	RepoID          pgtype.UUID
	Path            string
	Name            string
	CurrentSha      string
	FrontmatterJson []byte
	UpdatedAt       pgtype.Timestamptz
}

type UpdateScheduleNextFireAtParams

type UpdateScheduleNextFireAtParams struct {
	ID         pgtype.UUID
	NextFireAt pgtype.Timestamptz
}

type UpsertScheduleParams

type UpsertScheduleParams struct {
	OrgID                pgtype.UUID
	SkillID              pgtype.UUID
	Name                 string
	Cron                 string
	Timezone             string
	OverlapPolicy        string
	TimeoutSec           int32
	Enabled              bool
	Provider             string
	Model                string
	LlmSecretRef         *string
	LlmEndpoint          *string
	LlmDeployment        *string
	DestinationsJson     []byte
	WritebackJson        []byte
	EnvJson              []byte
	AutoPauseAfter       *int32
	McpEnvJson           []byte
	MaxTurns             *int32
	CopilotTokenRefsJson []byte
}

type UpsertSecretParams

type UpsertSecretParams struct {
	OrgID      pgtype.UUID
	Name       string
	DekWrapped []byte
	Ciphertext []byte
	Nonce      []byte
}

type UpsertSkillParams

type UpsertSkillParams struct {
	OrgID           pgtype.UUID
	RepoID          pgtype.UUID
	Path            string
	Name            string
	CurrentSha      string
	FrontmatterJson []byte
}

type UpsertUserOnLoginParams

type UpsertUserOnLoginParams struct {
	OrgID       pgtype.UUID
	GithubLogin string
	Role        string
}

Jump to

Keyboard shortcuts

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