database

package
v0.0.0-...-4ae6852 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKey

type ApiKey struct {
	ID              uuid.UUID
	OrganizationID  string
	ProjectID       uuid.NullUUID
	CreatedByUserID string
	Name            string
	KeyPrefix       string
	KeyHash         string
	Scopes          []string
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	DeletedAt       pgtype.Timestamptz
	Deleted         bool
}

type Asset

type Asset struct {
	ID            uuid.UUID
	ProjectID     uuid.UUID
	Name          string
	Url           string
	Kind          string
	ContentType   string
	ContentLength int64
	Sha256        string
	CreatedAt     pgtype.Timestamptz
	UpdatedAt     pgtype.Timestamptz
	DeletedAt     pgtype.Timestamptz
	Deleted       bool
}

type Chat

type Chat struct {
	ID             uuid.UUID
	ProjectID      uuid.UUID
	OrganizationID string
	UserID         pgtype.Text
	Title          pgtype.Text
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
	DeletedAt      pgtype.Timestamptz
	Deleted        bool
}

type ChatMessage

type ChatMessage struct {
	ID               uuid.UUID
	ChatID           uuid.UUID
	ProjectID        uuid.NullUUID
	Role             string
	Content          string
	Model            pgtype.Text
	MessageID        pgtype.Text
	ToolCallID       pgtype.Text
	UserID           pgtype.Text
	FinishReason     pgtype.Text
	ToolCalls        []byte
	PromptTokens     int64
	CompletionTokens int64
	TotalTokens      int64
	CreatedAt        pgtype.Timestamptz
}

type CustomDomain

type CustomDomain struct {
	ID             uuid.UUID
	OrganizationID string
	Domain         string
	Verified       bool
	Activated      bool
	IngressName    pgtype.Text
	CertSecretName pgtype.Text
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
	DeletedAt      pgtype.Timestamptz
	Deleted        bool
}

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 Deployment

type Deployment struct {
	ID             uuid.UUID
	Seq            int64
	UserID         string
	ProjectID      uuid.UUID
	OrganizationID string
	IdempotencyKey string
	ClonedFrom     uuid.NullUUID
	GithubRepo     pgtype.Text
	GithubPr       pgtype.Text
	GithubSha      pgtype.Text
	ExternalID     pgtype.Text
	ExternalUrl    pgtype.Text
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
}

type DeploymentLog

type DeploymentLog struct {
	ID             uuid.UUID
	Seq            int64
	Event          string
	Message        string
	DeploymentID   uuid.UUID
	ProjectID      uuid.UUID
	AttachmentID   uuid.NullUUID
	AttachmentType pgtype.Text
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
}

type DeploymentStatus

type DeploymentStatus struct {
	ID           uuid.UUID
	Seq          int64
	DeploymentID uuid.UUID
	Status       string
	CreatedAt    pgtype.Timestamptz
	UpdatedAt    pgtype.Timestamptz
}

type DeploymentsFunction

type DeploymentsFunction struct {
	ID            uuid.UUID
	DeploymentID  uuid.UUID
	AssetID       uuid.UUID
	Name          string
	Slug          string
	Runtime       string
	RunnerVersion pgtype.Text
}

type DeploymentsOpenapiv3Asset

type DeploymentsOpenapiv3Asset struct {
	ID           uuid.UUID
	DeploymentID uuid.UUID
	AssetID      uuid.UUID
	Name         string
	Slug         string
}

type DeploymentsPackage

type DeploymentsPackage struct {
	ID           uuid.UUID
	DeploymentID uuid.UUID
	PackageID    uuid.UUID
	VersionID    uuid.UUID
}

type Environment

type Environment struct {
	ID             uuid.UUID
	OrganizationID string
	ProjectID      uuid.UUID
	Name           string
	Slug           string
	Description    pgtype.Text
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
	DeletedAt      pgtype.Timestamptz
	Deleted        bool
}

type EnvironmentEntry

type EnvironmentEntry struct {
	Name          string
	Value         string
	EnvironmentID uuid.UUID
	CreatedAt     pgtype.Timestamptz
	UpdatedAt     pgtype.Timestamptz
}

type ExternalOauthServerMetadatum

type ExternalOauthServerMetadatum struct {
	ID        uuid.UUID
	ProjectID uuid.UUID
	Slug      string
	Metadata  []byte
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
	DeletedAt pgtype.Timestamptz
	Deleted   bool
}

type FlyApp

type FlyApp struct {
	ID            uuid.UUID
	Seq           int64
	ProjectID     uuid.UUID
	DeploymentID  uuid.UUID
	FunctionID    uuid.UUID
	AccessID      uuid.UUID
	FlyOrgID      string
	FlyOrgSlug    string
	AppName       string
	AppUrl        string
	RunnerVersion string
	PrimaryRegion string
	Status        string
	ReapedAt      pgtype.Timestamptz
	CreatedAt     pgtype.Timestamptz
	UpdatedAt     pgtype.Timestamptz
}

type FunctionResourceDefinition

type FunctionResourceDefinition struct {
	ID           uuid.UUID
	ResourceUrn  urn.Resource
	ProjectID    uuid.UUID
	DeploymentID uuid.UUID
	FunctionID   uuid.UUID
	Runtime      string
	Name         string
	Description  string
	Uri          string
	Title        pgtype.Text
	MimeType     pgtype.Text
	Variables    []byte
	Meta         []byte
	CreatedAt    pgtype.Timestamptz
	UpdatedAt    pgtype.Timestamptz
	DeletedAt    pgtype.Timestamptz
	Deleted      bool
}

type FunctionToolDefinition

type FunctionToolDefinition struct {
	ID           uuid.UUID
	ToolUrn      urn.Tool
	ProjectID    uuid.UUID
	DeploymentID uuid.UUID
	FunctionID   uuid.UUID
	Runtime      string
	Name         string
	Description  string
	InputSchema  []byte
	Variables    []byte
	Meta         []byte
	CreatedAt    pgtype.Timestamptz
	UpdatedAt    pgtype.Timestamptz
	DeletedAt    pgtype.Timestamptz
	Deleted      bool
}

type FunctionsAccess

type FunctionsAccess struct {
	ID            uuid.UUID
	Seq           int64
	ProjectID     uuid.UUID
	DeploymentID  uuid.UUID
	FunctionID    uuid.UUID
	EncryptionKey conv.Secret
	BearerFormat  pgtype.Text
	CreatedAt     pgtype.Timestamptz
	UpdatedAt     pgtype.Timestamptz
	DeletedAt     pgtype.Timestamptz
	Deleted       bool
}

type HttpSecurity

type HttpSecurity struct {
	ID                  uuid.UUID
	DeploymentID        uuid.UUID
	ProjectID           uuid.NullUUID
	Openapiv3DocumentID uuid.NullUUID
	Key                 string
	Type                pgtype.Text
	Name                pgtype.Text
	InPlacement         pgtype.Text
	Scheme              pgtype.Text
	BearerFormat        pgtype.Text
	OauthTypes          []string
	OauthFlows          []byte
	EnvVariables        []string
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
	DeletedAt           pgtype.Timestamptz
	Deleted             bool
}

type HttpToolDefinition

type HttpToolDefinition struct {
	ID                  uuid.UUID
	ToolUrn             urn.Tool
	ProjectID           uuid.UUID
	DeploymentID        uuid.UUID
	Openapiv3DocumentID uuid.NullUUID
	Confirm             pgtype.Text
	ConfirmPrompt       pgtype.Text
	Summarizer          pgtype.Text
	Name                string
	UntruncatedName     pgtype.Text
	Summary             string
	Description         string
	Openapiv3Operation  pgtype.Text
	Tags                []string
	XGram               pgtype.Bool
	OriginalName        pgtype.Text
	OriginalSummary     pgtype.Text
	OriginalDescription pgtype.Text
	ServerEnvVar        string
	DefaultServerUrl    pgtype.Text
	Security            []byte
	HttpMethod          string
	Path                string
	SchemaVersion       string
	Schema              []byte
	HeaderSettings      []byte
	QuerySettings       []byte
	PathSettings        []byte
	RequestContentType  pgtype.Text
	ResponseFilter      *models.ResponseFilter
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
	DeletedAt           pgtype.Timestamptz
	Deleted             bool
}

type McpMetadatum

type McpMetadatum struct {
	ID                       uuid.UUID
	ToolsetID                uuid.UUID
	ProjectID                uuid.UUID
	ExternalDocumentationUrl pgtype.Text
	LogoID                   uuid.NullUUID
	CreatedAt                pgtype.Timestamptz
	UpdatedAt                pgtype.Timestamptz
}

type OauthProxyClientInfo

type OauthProxyClientInfo struct {
	McpSlug                 string
	ClientID                string
	ClientSecret            string
	ClientSecretExpiresAt   pgtype.Timestamptz
	ClientName              string
	RedirectUris            []string
	GrantTypes              []string
	ResponseTypes           []string
	Scope                   string
	TokenEndpointAuthMethod string
	ApplicationType         string
	CreatedAt               pgtype.Timestamptz
	UpdatedAt               pgtype.Timestamptz
}

type OauthProxyProvider

type OauthProxyProvider struct {
	ID                                uuid.UUID
	ProjectID                         uuid.UUID
	OauthProxyServerID                uuid.UUID
	Slug                              string
	AuthorizationEndpoint             string
	TokenEndpoint                     string
	RegistrationEndpoint              pgtype.Text
	ScopesSupported                   []string
	ResponseTypesSupported            []string
	ResponseModesSupported            []string
	GrantTypesSupported               []string
	TokenEndpointAuthMethodsSupported []string
	SecurityKeyNames                  []string
	Secrets                           []byte
	CreatedAt                         pgtype.Timestamptz
	UpdatedAt                         pgtype.Timestamptz
	DeletedAt                         pgtype.Timestamptz
	Deleted                           bool
}

type OauthProxyServer

type OauthProxyServer struct {
	ID        uuid.UUID
	ProjectID uuid.UUID
	Slug      string
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
	DeletedAt pgtype.Timestamptz
	Deleted   bool
}

type OpenrouterApiKey

type OpenrouterApiKey struct {
	OrganizationID string
	Key            string
	KeyHash        string
	MonthlyCredits int64
	Disabled       bool
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
	DeletedAt      pgtype.Timestamptz
	Deleted        bool
}

type OrganizationMetadatum

type OrganizationMetadatum struct {
	ID              string
	Name            string
	Slug            string
	GramAccountType string
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	DisabledAt      pgtype.Timestamptz
}

type Package

type Package struct {
	ID              uuid.UUID
	Name            string
	Title           pgtype.Text
	Summary         pgtype.Text
	DescriptionRaw  pgtype.Text
	DescriptionHtml pgtype.Text
	Url             pgtype.Text
	Keywords        []string
	ImageAssetID    uuid.NullUUID
	OrganizationID  string
	ProjectID       uuid.UUID
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	DeletedAt       pgtype.Timestamptz
	Deleted         bool
}

type PackageVersion

type PackageVersion struct {
	ID           uuid.UUID
	PackageID    uuid.UUID
	DeploymentID uuid.UUID
	Visibility   string
	Major        int64
	Minor        int64
	Patch        int64
	Prerelease   pgtype.Text
	Build        pgtype.Text
	CreatedAt    pgtype.Timestamptz
	UpdatedAt    pgtype.Timestamptz
	DeletedAt    pgtype.Timestamptz
	Deleted      bool
}

type Project

type Project struct {
	ID                     uuid.UUID
	Name                   string
	Slug                   string
	OrganizationID         string
	LogoAssetID            uuid.NullUUID
	FunctionsRunnerVersion pgtype.Text
	CreatedAt              pgtype.Timestamptz
	UpdatedAt              pgtype.Timestamptz
	DeletedAt              pgtype.Timestamptz
	Deleted                bool
}

type ProjectToolVariation

type ProjectToolVariation struct {
	ID        uuid.UUID
	ProjectID uuid.UUID
	GroupID   uuid.UUID
}

type PromptTemplate

type PromptTemplate struct {
	ID            uuid.UUID
	ToolUrn       urn.Tool
	ProjectID     uuid.UUID
	HistoryID     uuid.UUID
	PredecessorID uuid.NullUUID
	Name          string
	Description   pgtype.Text
	Arguments     []byte
	Prompt        string
	Engine        pgtype.Text
	Kind          pgtype.Text
	ToolsHint     []string
	ToolUrnsHint  []string
	CreatedAt     pgtype.Timestamptz
	UpdatedAt     pgtype.Timestamptz
	DeletedAt     pgtype.Timestamptz
	Deleted       bool
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) StubQuery

func (q *Queries) StubQuery(ctx context.Context) (int32, error)

func (*Queries) WithTx

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

type SlackAppConnection

type SlackAppConnection struct {
	SlackTeamID        string
	OrganizationID     string
	ProjectID          uuid.UUID
	AccessToken        string
	SlackTeamName      string
	DefaultToolsetSlug pgtype.Text
	CreatedAt          pgtype.Timestamptz
	UpdatedAt          pgtype.Timestamptz
}

type ToolVariation

type ToolVariation struct {
	ID            uuid.UUID
	GroupID       uuid.UUID
	SrcToolUrn    urn.Tool
	SrcToolName   string
	Confirm       pgtype.Text
	ConfirmPrompt pgtype.Text
	Name          pgtype.Text
	Summary       pgtype.Text
	Description   pgtype.Text
	Tags          []string
	Summarizer    pgtype.Text
	CreatedAt     pgtype.Timestamptz
	UpdatedAt     pgtype.Timestamptz
	DeletedAt     pgtype.Timestamptz
	Deleted       bool
}

type ToolVariationsGroup

type ToolVariationsGroup struct {
	ID          uuid.UUID
	ProjectID   uuid.UUID
	Name        string
	Description pgtype.Text
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
	DeletedAt   pgtype.Timestamptz
	Deleted     bool
}

type Toolset

type Toolset struct {
	ID                     uuid.UUID
	OrganizationID         string
	ProjectID              uuid.UUID
	Name                   string
	Slug                   string
	Description            pgtype.Text
	DefaultEnvironmentSlug pgtype.Text
	McpSlug                pgtype.Text
	McpIsPublic            bool
	McpEnabled             bool
	CustomDomainID         uuid.NullUUID
	ExternalOauthServerID  uuid.NullUUID
	OauthProxyServerID     uuid.NullUUID
	CreatedAt              pgtype.Timestamptz
	UpdatedAt              pgtype.Timestamptz
	DeletedAt              pgtype.Timestamptz
	Deleted                bool
}

type ToolsetPrompt

type ToolsetPrompt struct {
	ID               uuid.UUID
	ProjectID        uuid.UUID
	ToolsetID        uuid.UUID
	PromptHistoryID  uuid.UUID
	PromptTemplateID uuid.NullUUID
	PromptName       string
}

type ToolsetVersion

type ToolsetVersion struct {
	ID            uuid.UUID
	ToolsetID     uuid.UUID
	Version       int64
	ToolUrns      []urn.Tool
	ResourceUrns  []urn.Resource
	PredecessorID uuid.NullUUID
	CreatedAt     pgtype.Timestamptz
	UpdatedAt     pgtype.Timestamptz
	DeletedAt     pgtype.Timestamptz
	Deleted       bool
}

type User

type User struct {
	ID          string
	Email       string
	DisplayName string
	PhotoUrl    pgtype.Text
	Admin       bool
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
}

Jump to

Keyboard shortcuts

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