database
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package database connects to external services for stateful storage.
Query functions are generated using sqlc.
To modify the database schema:1. Add a new migration using "create_migration.sh" in database/migrations/ and run "make gen" to generate models.2. Add/Edit queries in "query.sql" and run "make gen" to create Go code.
Code generated by scripts/dbgen/main.go. DO NOT EDIT.
Code generated by scripts/dbgen/main.go. DO NOT EDIT.
Index¶
- Constants
- func ExpectOne[T any](ret []T, err error) (T, error)
- func GenLockID(name string) int64
- func IncrementExecutionCount(opts *TxOptions)
- func IsForeignKeyViolation(err error, foreignKeyConstraints ...ForeignKeyConstraint) bool
- func IsQueryCanceledError(err error) bool
- func IsSerializedError(err error) bool
- func IsUniqueViolation(err error, uniqueConstraints ...UniqueConstraint) bool
- func IsWorkspaceAgentLogsLimitError(err error) bool
- func ReadModifyUpdate(db Store, f func(tx Store) error) error
- func WithSerialRetryCount(count int) func(*sqlQuerier)
- type APIKey
- type APIKeyScope
- type AcquireNotificationMessagesParams
- type AcquireNotificationMessagesRow
- type AcquireProvisionerJobParams
- type Actions
- type ActivityBumpWorkspaceParams
- type AgentIDNamePair
- type AgentKeyScopeEnum
- type AppSharingLevel
- type ArchiveUnusedTemplateVersionsParams
- type AuditAction
- type AuditLog
- type AuditOAuthConvertState
- type AuditableGroup
- type AuditableOrganizationMember
- type AutomaticUpdates
- type BatchUpdateWorkspaceLastUsedAtParams
- type BatchUpdateWorkspaceNextStartAtParams
- type BuildReason
- type BulkMarkNotificationMessagesFailedParams
- type BulkMarkNotificationMessagesSentParams
- type Chat
- type ChatMessage
- type ClaimPrebuiltWorkspaceParams
- type ClaimPrebuiltWorkspaceRow
- type ConnectorCreator
- type CountInProgressPrebuildsRow
- type CryptoKey
- type CryptoKeyFeature
- type CustomRole
- type CustomRolePermission
- type CustomRolePermissions
- type CustomRolesParams
- type DBCryptKey
- type DBTX
- type DeleteAllTailnetClientSubscriptionsParams
- type DeleteAllTailnetTunnelsParams
- type DeleteCryptoKeyParams
- type DeleteCustomRoleParams
- type DeleteExternalAuthLinkParams
- type DeleteGroupMemberFromGroupParams
- type DeleteOAuth2ProviderAppCodesByAppAndUserIDParams
- type DeleteOAuth2ProviderAppTokensByAppAndUserIDParams
- type DeleteOrganizationMemberParams
- type DeleteTailnetAgentParams
- type DeleteTailnetAgentRow
- type DeleteTailnetClientParams
- type DeleteTailnetClientRow
- type DeleteTailnetClientSubscriptionParams
- type DeleteTailnetPeerParams
- type DeleteTailnetPeerRow
- type DeleteTailnetTunnelParams
- type DeleteTailnetTunnelRow
- type DeleteWebpushSubscriptionByUserIDAndEndpointParams
- type DeleteWorkspaceAgentPortShareParams
- type DialerConnector
- type DisplayApp
- type EnqueueNotificationMessageParams
- type ExternalAuthLink
- type ExternalAuthProvider
- type FetchNewMessageMetadataParams
- type FetchNewMessageMetadataRow
- type File
- type ForeignKeyConstraint
- type GetAPIKeyByNameParams
- type GetAPIKeysByUserIDParams
- type GetAuditLogsOffsetParams
- type GetAuditLogsOffsetRow
- type GetAuthorizationUserRolesRow
- type GetCryptoKeyByFeatureAndSequenceParams
- type GetDefaultProxyConfigRow
- type GetDeploymentDAUsRow
- type GetDeploymentWorkspaceAgentStatsRow
- type GetDeploymentWorkspaceAgentUsageStatsRow
- type GetDeploymentWorkspaceStatsRow
- type GetEligibleProvisionerDaemonsByProvisionerJobIDsRow
- type GetExternalAuthLinkParams
- type GetFailedWorkspaceBuildsByTemplateIDParams
- type GetFailedWorkspaceBuildsByTemplateIDRow
- type GetFileByHashAndCreatorParams
- type GetFileTemplatesRow
- type GetFilteredInboxNotificationsByUserIDParams
- type GetGroupByOrgAndNameParams
- type GetGroupMembersByGroupIDParams
- type GetGroupMembersCountByGroupIDParams
- type GetGroupsParams
- type GetGroupsRow
- type GetInboxNotificationsByUserIDParams
- type GetNotificationMessagesByStatusParams
- type GetOAuth2ProviderAppsByUserIDRow
- type GetOrganizationByNameParams
- type GetOrganizationIDsByMemberIDsRow
- type GetOrganizationResourceCountByIDRow
- type GetOrganizationsByUserIDParams
- type GetOrganizationsParams
- type GetPrebuildMetricsRow
- type GetPresetByIDRow
- type GetPresetsAtFailureLimitRow
- type GetPresetsBackoffRow
- type GetPreviousTemplateVersionParams
- type GetProvisionerDaemonsByOrganizationParams
- type GetProvisionerDaemonsWithStatusByOrganizationParams
- type GetProvisionerDaemonsWithStatusByOrganizationRow
- type GetProvisionerJobsByIDsWithQueuePositionRow
- type GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerParams
- type GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow
- type GetProvisionerJobsToBeReapedParams
- type GetProvisionerKeyByNameParams
- type GetProvisionerLogsAfterIDParams
- type GetQuotaAllowanceForUserParams
- type GetQuotaConsumedForUserParams
- type GetRunningPrebuiltWorkspacesRow
- type GetTailnetTunnelPeerBindingsRow
- type GetTailnetTunnelPeerIDsRow
- type GetTemplateAppInsightsByTemplateParams
- type GetTemplateAppInsightsByTemplateRow
- type GetTemplateAppInsightsParams
- type GetTemplateAppInsightsRow
- type GetTemplateAverageBuildTimeParams
- type GetTemplateAverageBuildTimeRow
- type GetTemplateByOrganizationAndNameParams
- type GetTemplateDAUsParams
- type GetTemplateDAUsRow
- type GetTemplateInsightsByIntervalParams
- type GetTemplateInsightsByIntervalRow
- type GetTemplateInsightsByTemplateParams
- type GetTemplateInsightsByTemplateRow
- type GetTemplateInsightsParams
- type GetTemplateInsightsRow
- type GetTemplateParameterInsightsParams
- type GetTemplateParameterInsightsRow
- type GetTemplatePresetsWithPrebuildsRow
- type GetTemplateUsageStatsParams
- type GetTemplateVersionByTemplateIDAndNameParams
- type GetTemplateVersionsByTemplateIDParams
- type GetTemplatesWithFilterParams
- type GetUserActivityInsightsParams
- type GetUserActivityInsightsRow
- type GetUserByEmailOrUsernameParams
- type GetUserLatencyInsightsParams
- type GetUserLatencyInsightsRow
- type GetUserLinkByUserIDLoginTypeParams
- type GetUserStatusCountsParams
- type GetUserStatusCountsRow
- type GetUserWorkspaceBuildParametersParams
- type GetUserWorkspaceBuildParametersRow
- type GetUsersParams
- type GetUsersRow
- type GetWebpushVAPIDKeysRow
- type GetWorkspaceAgentAndLatestBuildByAuthTokenRow
- type GetWorkspaceAgentLifecycleStateByIDRow
- type GetWorkspaceAgentLogsAfterParams
- type GetWorkspaceAgentMetadataParams
- type GetWorkspaceAgentPortShareParams
- type GetWorkspaceAgentScriptTimingsByBuildIDRow
- type GetWorkspaceAgentStatsAndLabelsRow
- type GetWorkspaceAgentStatsRow
- type GetWorkspaceAgentUsageStatsAndLabelsRow
- type GetWorkspaceAgentUsageStatsRow
- type GetWorkspaceAgentsByWorkspaceAndBuildNumberParams
- type GetWorkspaceAppByAgentIDAndSlugParams
- type GetWorkspaceBuildByWorkspaceIDAndBuildNumberParams
- type GetWorkspaceBuildStatsByTemplatesRow
- type GetWorkspaceBuildsByWorkspaceIDParams
- type GetWorkspaceByOwnerIDAndNameParams
- type GetWorkspaceProxyByHostnameParams
- type GetWorkspaceUniqueOwnerCountByTemplateIDsRow
- type GetWorkspacesAndAgentsByOwnerIDRow
- type GetWorkspacesEligibleForTransitionRow
- type GetWorkspacesParams
- type GetWorkspacesRow
- type GitSSHKey
- type Group
- type GroupMember
- type GroupMemberTable
- type GroupSource
- type HealthSettings
- type InboxNotification
- type InboxNotificationReadStatus
- type InsertAPIKeyParams
- type InsertAuditLogParams
- type InsertChatMessagesParams
- type InsertChatParams
- type InsertCryptoKeyParams
- type InsertCustomRoleParams
- type InsertDBCryptKeyParams
- type InsertExternalAuthLinkParams
- type InsertFileParams
- type InsertGitSSHKeyParams
- type InsertGroupMemberParams
- type InsertGroupParams
- type InsertInboxNotificationParams
- type InsertLicenseParams
- type InsertMemoryResourceMonitorParams
- type InsertMissingGroupsParams
- type InsertOAuth2ProviderAppCodeParams
- type InsertOAuth2ProviderAppParams
- type InsertOAuth2ProviderAppSecretParams
- type InsertOAuth2ProviderAppTokenParams
- type InsertOrganizationMemberParams
- type InsertOrganizationParams
- type InsertPresetParametersParams
- type InsertPresetParams
- type InsertProvisionerJobLogsParams
- type InsertProvisionerJobParams
- type InsertProvisionerJobTimingsParams
- type InsertProvisionerKeyParams
- type InsertReplicaParams
- type InsertTelemetryItemIfNotExistsParams
- type InsertTemplateParams
- type InsertTemplateVersionParameterParams
- type InsertTemplateVersionParams
- type InsertTemplateVersionTerraformValuesByJobIDParams
- type InsertTemplateVersionVariableParams
- type InsertTemplateVersionWorkspaceTagParams
- type InsertUserGroupsByIDParams
- type InsertUserGroupsByNameParams
- type InsertUserLinkParams
- type InsertUserParams
- type InsertVolumeResourceMonitorParams
- type InsertWebpushSubscriptionParams
- type InsertWorkspaceAgentDevcontainersParams
- type InsertWorkspaceAgentLogSourcesParams
- type InsertWorkspaceAgentLogsParams
- type InsertWorkspaceAgentMetadataParams
- type InsertWorkspaceAgentParams
- type InsertWorkspaceAgentScriptTimingsParams
- type InsertWorkspaceAgentScriptsParams
- type InsertWorkspaceAgentStatsParams
- type InsertWorkspaceAppParams
- type InsertWorkspaceAppStatsParams
- type InsertWorkspaceAppStatusParams
- type InsertWorkspaceBuildParametersParams
- type InsertWorkspaceBuildParams
- type InsertWorkspaceModuleParams
- type InsertWorkspaceParams
- type InsertWorkspaceProxyParams
- type InsertWorkspaceResourceMetadataParams
- type InsertWorkspaceResourceParams
- type JfrogXrayScan
- type License
- type LogLevel
- type LogSource
- type LoginType
- type MarkAllInboxNotificationsAsReadParams
- type NameOrganizationPair
- type NotificationMessage
- type NotificationMessageStatus
- type NotificationMethod
- type NotificationPreference
- type NotificationReportGeneratorLog
- type NotificationTemplate
- type NotificationTemplateKind
- type NotificationsSettings
- type NullAPIKeyScope
- type NullAgentKeyScopeEnum
- type NullAppSharingLevel
- type NullAuditAction
- type NullAutomaticUpdates
- type NullBuildReason
- type NullCryptoKeyFeature
- type NullDisplayApp
- type NullGroupSource
- type NullInboxNotificationReadStatus
- type NullLogLevel
- type NullLogSource
- type NullLoginType
- type NullNotificationMessageStatus
- type NullNotificationMethod
- type NullNotificationTemplateKind
- type NullParameterDestinationScheme
- type NullParameterScope
- type NullParameterSourceScheme
- type NullParameterTypeSystem
- type NullPortShareProtocol
- type NullPrebuildStatus
- type NullProvisionerDaemonStatus
- type NullProvisionerJobStatus
- type NullProvisionerJobTimingStage
- type NullProvisionerJobType
- type NullProvisionerStorageMethod
- type NullProvisionerType
- type NullResourceType
- type NullStartupScriptBehavior
- type NullTailnetStatus
- type NullUserStatus
- type NullWorkspaceAgentLifecycleState
- type NullWorkspaceAgentMonitorState
- type NullWorkspaceAgentScriptTimingStage
- type NullWorkspaceAgentScriptTimingStatus
- type NullWorkspaceAgentSubsystem
- type NullWorkspaceAppHealth
- type NullWorkspaceAppOpenIn
- type NullWorkspaceAppStatusState
- type NullWorkspaceTransition
- type OAuth2ProviderApp
- type OAuth2ProviderAppCode
- type OAuth2ProviderAppSecret
- type OAuth2ProviderAppToken
- type OIDCClaimFieldValuesParams
- type Organization
- type OrganizationMember
- type OrganizationMembersParams
- type OrganizationMembersRow
- type PGLock
- type PGLocks
- type PaginatedOrganizationMembersParams
- type PaginatedOrganizationMembersRow
- type ParameterDestinationScheme
- type ParameterSchema
- type ParameterScope
- type ParameterSourceScheme
- type ParameterTypeSystem
- type ParameterValue
- type PortShareProtocol
- type PrebuildStatus
- type ProvisionerDaemon
- type ProvisionerDaemonStatus
- type ProvisionerJob
- type ProvisionerJobLog
- type ProvisionerJobStat
- type ProvisionerJobStatus
- type ProvisionerJobTiming
- type ProvisionerJobTimingStage
- type ProvisionerJobType
- type ProvisionerKey
- type ProvisionerStorageMethod
- type ProvisionerType
- type RegisterWorkspaceProxyParams
- type RemoveUserFromGroupsParams
- type Replica
- type ResourceType
- type SiteConfig
- type StartupScriptBehavior
- type Store
- type StringMap
- type StringMapOfInt
- type TailnetAgent
- type TailnetClient
- type TailnetClientSubscription
- type TailnetCoordinator
- type TailnetPeer
- type TailnetStatus
- type TailnetTunnel
- type TelemetryItem
- type Template
- type TemplateACL
- type TemplateGroup
- type TemplateTable
- type TemplateUsageStat
- type TemplateUser
- type TemplateVersion
- type TemplateVersionParameter
- type TemplateVersionPreset
- type TemplateVersionPresetParameter
- type TemplateVersionTable
- type TemplateVersionTerraformValue
- type TemplateVersionVariable
- type TemplateVersionWorkspaceTag
- type TxOptions
- type UnarchiveTemplateVersionParams
- type UniqueConstraint
- type UpdateAPIKeyByIDParams
- type UpdateChatByIDParams
- type UpdateCryptoKeyDeletesAtParams
- type UpdateCustomRoleParams
- type UpdateExternalAuthLinkParams
- type UpdateExternalAuthLinkRefreshTokenParams
- type UpdateGitSSHKeyParams
- type UpdateGroupByIDParams
- type UpdateInactiveUsersToDormantParams
- type UpdateInactiveUsersToDormantRow
- type UpdateInboxNotificationReadStatusParams
- type UpdateMemberRolesParams
- type UpdateMemoryResourceMonitorParams
- type UpdateNotificationTemplateMethodByIDParams
- type UpdateOAuth2ProviderAppByIDParams
- type UpdateOAuth2ProviderAppSecretByIDParams
- type UpdateOrganizationDeletedByIDParams
- type UpdateOrganizationParams
- type UpdatePresetPrebuildStatusParams
- type UpdateProvisionerDaemonLastSeenAtParams
- type UpdateProvisionerJobByIDParams
- type UpdateProvisionerJobWithCancelByIDParams
- type UpdateProvisionerJobWithCompleteByIDParams
- type UpdateProvisionerJobWithCompleteWithStartedAtByIDParams
- type UpdateReplicaParams
- type UpdateTailnetPeerStatusByCoordinatorParams
- type UpdateTemplateACLByIDParams
- type UpdateTemplateAccessControlByIDParams
- type UpdateTemplateActiveVersionByIDParams
- type UpdateTemplateDeletedByIDParams
- type UpdateTemplateMetaByIDParams
- type UpdateTemplateScheduleByIDParams
- type UpdateTemplateVersionByIDParams
- type UpdateTemplateVersionDescriptionByJobIDParams
- type UpdateTemplateVersionExternalAuthProvidersByJobIDParams
- type UpdateTemplateWorkspacesLastUsedAtParams
- type UpdateUserGithubComUserIDParams
- type UpdateUserHashedOneTimePasscodeParams
- type UpdateUserHashedPasswordParams
- type UpdateUserLastSeenAtParams
- type UpdateUserLinkParams
- type UpdateUserLinkedIDParams
- type UpdateUserLoginTypeParams
- type UpdateUserNotificationPreferencesParams
- type UpdateUserProfileParams
- type UpdateUserQuietHoursScheduleParams
- type UpdateUserRolesParams
- type UpdateUserStatusParams
- type UpdateUserTerminalFontParams
- type UpdateUserThemePreferenceParams
- type UpdateVolumeResourceMonitorParams
- type UpdateWorkspaceAgentConnectionByIDParams
- type UpdateWorkspaceAgentLifecycleStateByIDParams
- type UpdateWorkspaceAgentLogOverflowByIDParams
- type UpdateWorkspaceAgentMetadataParams
- type UpdateWorkspaceAgentStartupByIDParams
- type UpdateWorkspaceAppHealthByIDParams
- type UpdateWorkspaceAutomaticUpdatesParams
- type UpdateWorkspaceAutostartParams
- type UpdateWorkspaceBuildCostByIDParams
- type UpdateWorkspaceBuildDeadlineByIDParams
- type UpdateWorkspaceBuildProvisionerStateByIDParams
- type UpdateWorkspaceDeletedByIDParams
- type UpdateWorkspaceDormantDeletingAtParams
- type UpdateWorkspaceLastUsedAtParams
- type UpdateWorkspaceNextStartAtParams
- type UpdateWorkspaceParams
- type UpdateWorkspaceProxyDeletedParams
- type UpdateWorkspaceProxyParams
- type UpdateWorkspaceTTLParams
- type UpdateWorkspacesDormantDeletingAtByTemplateIDParams
- type UpdateWorkspacesTTLByTemplateIDParams
- type UpsertDefaultProxyParams
- type UpsertNotificationReportGeneratorLogParams
- type UpsertProvisionerDaemonParams
- type UpsertRuntimeConfigParams
- type UpsertTailnetAgentParams
- type UpsertTailnetClientParams
- type UpsertTailnetClientSubscriptionParams
- type UpsertTailnetPeerParams
- type UpsertTailnetTunnelParams
- type UpsertTelemetryItemParams
- type UpsertWebpushVAPIDKeysParams
- type UpsertWorkspaceAgentPortShareParams
- type UpsertWorkspaceAppAuditSessionParams
- type User
- type UserConfig
- type UserDeleted
- type UserLink
- type UserLinkClaims
- type UserStatus
- type UserStatusChange
- type VisibleUser
- type WebpushSubscription
- type Workspace
- type WorkspaceAgent
- type WorkspaceAgentConnectionStatus
- type WorkspaceAgentDevcontainer
- type WorkspaceAgentLifecycleState
- type WorkspaceAgentLog
- type WorkspaceAgentLogSource
- type WorkspaceAgentMemoryResourceMonitor
- type WorkspaceAgentMetadatum
- type WorkspaceAgentMonitorState
- type WorkspaceAgentPortShare
- type WorkspaceAgentScript
- type WorkspaceAgentScriptTiming
- type WorkspaceAgentScriptTimingStage
- type WorkspaceAgentScriptTimingStatus
- type WorkspaceAgentStat
- type WorkspaceAgentStatus
- type WorkspaceAgentSubsystem
- type WorkspaceAgentVolumeResourceMonitor
- type WorkspaceApp
- type WorkspaceAppAuditSession
- type WorkspaceAppHealth
- type WorkspaceAppOpenIn
- type WorkspaceAppStat
- type WorkspaceAppStatus
- type WorkspaceAppStatusState
- type WorkspaceBuild
- type WorkspaceBuildParameter
- type WorkspaceBuildTable
- type WorkspaceLatestBuild
- type WorkspaceModule
- type WorkspacePrebuild
- type WorkspacePrebuildBuild
- type WorkspaceProxy
- type WorkspaceResource
- type WorkspaceResourceMetadatum
- type WorkspaceStatus
- type WorkspaceTable
- type WorkspaceTransition
Constants¶
const (LockIDDeploymentSetup =iota + 1LockIDEnterpriseDeploymentSetupLockIDDBRollupLockIDDBPurgeLockIDNotificationsReportGeneratorLockIDCryptoKeyRotationLockIDReconcilePrebuilds)
Well-known lock IDs for lock functions in the database. These should notchange. If locks are deprecated, they should be kept in this list to avoidreusing the same ID.
const EveryoneGroup = "Everyone"
Variables¶
This section is empty.
Functions¶
funcExpectOne¶added inv2.13.0
ExpectOne can be used to convert a ':many:' query into a ':one'query. To reduce the quantity of SQL queries, a :many with a filter is used.These filters sometimes are expected to return just 1 row.
A :many query will never return a sql.ErrNoRows, but a :one does.This function will correct the error for the empty set.
funcIncrementExecutionCount¶added inv2.17.0
func IncrementExecutionCount(opts *TxOptions)
IncrementExecutionCount is a helper function for external packagesto increment the unexported count.Mainly for `dbmem`.
funcIsForeignKeyViolation¶added inv2.2.0
func IsForeignKeyViolation(errerror, foreignKeyConstraints ...ForeignKeyConstraint)bool
IsForeignKeyViolation checks if the error is due to a foreign key violation.If one or more specific foreign key constraints are given as arguments,the error must be caused by one of them. If no constraints are given,this function returns true for any foreign key violation.
funcIsQueryCanceledError¶
IsQueryCanceledError checks if the error is due to a query being canceled.
funcIsUniqueViolation¶
func IsUniqueViolation(errerror, uniqueConstraints ...UniqueConstraint)bool
IsUniqueViolation checks if the error is due to a unique violation.If one or more specific unique constraints are given as arguments,the error must be caused by one of them. If no constraints are given,this function returns true for any unique violation.
funcReadModifyUpdate¶
ReadModifyUpdate is a helper function to run a db transaction that reads someobject(s), modifies some of the data, and writes the modified object(s) backto the database. It is run in a transaction at RepeatableRead isolation sothat if another database client also modifies the data we are writing andcommits, then the transaction is rolled back and restarted.
This is needed because we typically read all object columns, modify somesubset, and then write all columns. Consider an object with columns A, B andinitial values A=1, B=1. Two database clients work simultaneously, with oneclient attempting to set A=2, and another attempting to set B=2. They bothinitially read A=1, B=1, and then one writes A=2, B=1, and the other writesA=1, B=2. With default PostgreSQL isolation of ReadCommitted, both of thesetransactions would succeed and we end up with either A=2, B=1 or A=1, B=2.One or other client gets their transaction wiped out even though the datathey wanted to change didn't conflict.
If we run at RepeatableRead isolation, then one or other transaction willfail. Let's say the transaction that sets A=2 succeeds. Then the first B=2transaction fails, but here we retry. The second attempt we read A=2, B=1,then write A=2, B=2 as desired, and this succeeds.
funcWithSerialRetryCount¶added inv2.17.0
func WithSerialRetryCount(countint) func(*sqlQuerier)
Types¶
typeAPIKey¶
type APIKey struct {IDstring `db:"id" json:"id"`// hashed_secret contains a SHA256 hash of the key secret. This is considered a secret and MUST NOT be returned from the API as it is used for API key encryption in app proxying code.HashedSecret []byte `db:"hashed_secret" json:"hashed_secret"`UserIDuuid.UUID `db:"user_id" json:"user_id"`LastUsedtime.Time `db:"last_used" json:"last_used"`ExpiresAttime.Time `db:"expires_at" json:"expires_at"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`LoginTypeLoginType `db:"login_type" json:"login_type"`LifetimeSecondsint64 `db:"lifetime_seconds" json:"lifetime_seconds"`IPAddresspqtype.Inet `db:"ip_address" json:"ip_address"`ScopeAPIKeyScope `db:"scope" json:"scope"`TokenNamestring `db:"token_name" json:"token_name"`}
func (APIKey)RBACObject¶
typeAPIKeyScope¶
type APIKeyScopestring
const (APIKeyScopeAllAPIKeyScope = "all"APIKeyScopeApplicationConnectAPIKeyScope = "application_connect")
funcAllAPIKeyScopeValues¶
func AllAPIKeyScopeValues() []APIKeyScope
func (*APIKeyScope)Scan¶
func (e *APIKeyScope) Scan(src interface{})error
func (APIKeyScope)ToRBAC¶
func (sAPIKeyScope) ToRBAC()rbac.ScopeName
func (APIKeyScope)Valid¶
func (eAPIKeyScope) Valid()bool
typeAcquireNotificationMessagesParams¶added inv2.13.0
typeAcquireNotificationMessagesRow¶added inv2.13.0
type AcquireNotificationMessagesRow struct {IDuuid.UUID `db:"id" json:"id"`Payloadjson.RawMessage `db:"payload" json:"payload"`MethodNotificationMethod `db:"method" json:"method"`AttemptCountint32 `db:"attempt_count" json:"attempt_count"`QueuedSecondsfloat64 `db:"queued_seconds" json:"queued_seconds"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`TitleTemplatestring `db:"title_template" json:"title_template"`BodyTemplatestring `db:"body_template" json:"body_template"`Disabledbool `db:"disabled" json:"disabled"`}
typeAcquireProvisionerJobParams¶
type AcquireProvisionerJobParams struct {StartedAtsql.NullTime `db:"started_at" json:"started_at"`WorkerIDuuid.NullUUID `db:"worker_id" json:"worker_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`Types []ProvisionerType `db:"types" json:"types"`ProvisionerTagsjson.RawMessage `db:"provisioner_tags" json:"provisioner_tags"`}
typeActivityBumpWorkspaceParams¶added inv2.4.0
typeAgentIDNamePair¶added inv2.18.0
AgentIDNamePair is used as a result tuple for workspace and agent rows.
func (*AgentIDNamePair)Scan¶added inv2.18.0
func (p *AgentIDNamePair) Scan(src interface{})error
typeAgentKeyScopeEnum¶added inv2.22.0
type AgentKeyScopeEnumstring
const (AgentKeyScopeEnumAllAgentKeyScopeEnum = "all"AgentKeyScopeEnumNoUserDataAgentKeyScopeEnum = "no_user_data")
funcAllAgentKeyScopeEnumValues¶added inv2.22.0
func AllAgentKeyScopeEnumValues() []AgentKeyScopeEnum
func (*AgentKeyScopeEnum)Scan¶added inv2.22.0
func (e *AgentKeyScopeEnum) Scan(src interface{})error
func (AgentKeyScopeEnum)Valid¶added inv2.22.0
func (eAgentKeyScopeEnum) Valid()bool
typeAppSharingLevel¶
type AppSharingLevelstring
const (AppSharingLevelOwnerAppSharingLevel = "owner"AppSharingLevelAuthenticatedAppSharingLevel = "authenticated"AppSharingLevelPublicAppSharingLevel = "public")
funcAllAppSharingLevelValues¶
func AllAppSharingLevelValues() []AppSharingLevel
func (*AppSharingLevel)Scan¶
func (e *AppSharingLevel) Scan(src interface{})error
func (AppSharingLevel)Valid¶
func (eAppSharingLevel) Valid()bool
typeArchiveUnusedTemplateVersionsParams¶added inv2.3.0
type ArchiveUnusedTemplateVersionsParams struct {UpdatedAttime.Time `db:"updated_at" json:"updated_at"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`JobStatusNullProvisionerJobStatus `db:"job_status" json:"job_status"`}
typeAuditAction¶
type AuditActionstring
const (AuditActionCreateAuditAction = "create"AuditActionWriteAuditAction = "write"AuditActionDeleteAuditAction = "delete"AuditActionStartAuditAction = "start"AuditActionStopAuditAction = "stop"AuditActionLoginAuditAction = "login"AuditActionLogoutAuditAction = "logout"AuditActionRegisterAuditAction = "register"AuditActionRequestPasswordResetAuditAction = "request_password_reset"AuditActionConnectAuditAction = "connect"AuditActionDisconnectAuditAction = "disconnect"AuditActionOpenAuditAction = "open"AuditActionCloseAuditAction = "close")
funcAllAuditActionValues¶
func AllAuditActionValues() []AuditAction
func (*AuditAction)Scan¶
func (e *AuditAction) Scan(src interface{})error
func (AuditAction)Valid¶
func (eAuditAction) Valid()bool
typeAuditLog¶
type AuditLog struct {IDuuid.UUID `db:"id" json:"id"`Timetime.Time `db:"time" json:"time"`UserIDuuid.UUID `db:"user_id" json:"user_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`Ippqtype.Inet `db:"ip" json:"ip"`UserAgentsql.NullString `db:"user_agent" json:"user_agent"`ResourceTypeResourceType `db:"resource_type" json:"resource_type"`ResourceIDuuid.UUID `db:"resource_id" json:"resource_id"`ResourceTargetstring `db:"resource_target" json:"resource_target"`ActionAuditAction `db:"action" json:"action"`Diffjson.RawMessage `db:"diff" json:"diff"`StatusCodeint32 `db:"status_code" json:"status_code"`AdditionalFieldsjson.RawMessage `db:"additional_fields" json:"additional_fields"`RequestIDuuid.UUID `db:"request_id" json:"request_id"`ResourceIconstring `db:"resource_icon" json:"resource_icon"`}
func (AuditLog)RBACObject¶added inv2.14.0
typeAuditOAuthConvertState¶
type AuditOAuthConvertState struct {CreatedAttime.Time `db:"created_at" json:"created_at"`// The time at which the state string expires, a merge request times out if the user does not perform it quick enough.ExpiresAttime.Time `db:"expires_at" json:"expires_at"`FromLoginTypeLoginType `db:"from_login_type" json:"from_login_type"`// The login type the user is converting to. Should be github or oidc.ToLoginTypeLoginType `db:"to_login_type" json:"to_login_type"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}
AuditOAuthConvertState is never stored in the database. It is stored in a cookieclientside as a JWT. This type is provided for audit logging purposes.
typeAuditableGroup¶
type AuditableGroup struct {GroupMembers []GroupMemberTable `json:"members"`}
typeAuditableOrganizationMember¶added inv2.13.0
type AuditableOrganizationMember struct {OrganizationMemberUsernamestring `json:"username"`}
typeAutomaticUpdates¶added inv2.3.0
type AutomaticUpdatesstring
const (AutomaticUpdatesAlwaysAutomaticUpdates = "always"AutomaticUpdatesNeverAutomaticUpdates = "never")
funcAllAutomaticUpdatesValues¶added inv2.3.0
func AllAutomaticUpdatesValues() []AutomaticUpdates
func (*AutomaticUpdates)Scan¶added inv2.3.0
func (e *AutomaticUpdates) Scan(src interface{})error
func (AutomaticUpdates)Valid¶added inv2.3.0
func (eAutomaticUpdates) Valid()bool
typeBatchUpdateWorkspaceLastUsedAtParams¶added inv2.7.0
typeBatchUpdateWorkspaceNextStartAtParams¶added inv2.19.0
typeBuildReason¶
type BuildReasonstring
const (BuildReasonInitiatorBuildReason = "initiator"BuildReasonAutostartBuildReason = "autostart"BuildReasonAutostopBuildReason = "autostop"BuildReasonDormancyBuildReason = "dormancy"BuildReasonFailedstopBuildReason = "failedstop"BuildReasonAutodeleteBuildReason = "autodelete")
funcAllBuildReasonValues¶
func AllBuildReasonValues() []BuildReason
func (*BuildReason)Scan¶
func (e *BuildReason) Scan(src interface{})error
func (BuildReason)Valid¶
func (eBuildReason) Valid()bool
typeBulkMarkNotificationMessagesFailedParams¶added inv2.13.0
type BulkMarkNotificationMessagesFailedParams struct {MaxAttemptsint32 `db:"max_attempts" json:"max_attempts"`RetryIntervalint32 `db:"retry_interval" json:"retry_interval"`IDs []uuid.UUID `db:"ids" json:"ids"`FailedAts []time.Time `db:"failed_ats" json:"failed_ats"`Statuses []NotificationMessageStatus `db:"statuses" json:"statuses"`StatusReasons []string `db:"status_reasons" json:"status_reasons"`}
typeBulkMarkNotificationMessagesSentParams¶added inv2.13.0
typeChat¶added inv2.22.1
type Chat struct {IDuuid.UUID `db:"id" json:"id"`OwnerIDuuid.UUID `db:"owner_id" json:"owner_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Titlestring `db:"title" json:"title"`}
func (Chat)RBACObject¶added inv2.23.0
typeChatMessage¶added inv2.22.1
typeClaimPrebuiltWorkspaceParams¶added inv2.22.0
typeClaimPrebuiltWorkspaceRow¶added inv2.22.0
typeConnectorCreator¶added inv2.15.0
ConnectorCreator is a driver.Driver that can create a driver.Connector.
typeCountInProgressPrebuildsRow¶added inv2.22.0
type CountInProgressPrebuildsRow struct {TemplateIDuuid.UUID `db:"template_id" json:"template_id"`TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`TransitionWorkspaceTransition `db:"transition" json:"transition"`Countint32 `db:"count" json:"count"`PresetIDuuid.NullUUID `db:"preset_id" json:"preset_id"`}
typeCryptoKey¶added inv2.16.0
type CryptoKey struct {FeatureCryptoKeyFeature `db:"feature" json:"feature"`Sequenceint32 `db:"sequence" json:"sequence"`Secretsql.NullString `db:"secret" json:"secret"`SecretKeyIDsql.NullString `db:"secret_key_id" json:"secret_key_id"`StartsAttime.Time `db:"starts_at" json:"starts_at"`DeletesAtsql.NullTime `db:"deletes_at" json:"deletes_at"`}
func (CryptoKey)DecodeString¶added inv2.17.0
typeCryptoKeyFeature¶added inv2.16.0
type CryptoKeyFeaturestring
const (CryptoKeyFeatureWorkspaceAppsTokenCryptoKeyFeature = "workspace_apps_token"CryptoKeyFeatureWorkspaceAppsAPIKeyCryptoKeyFeature = "workspace_apps_api_key"CryptoKeyFeatureOIDCConvertCryptoKeyFeature = "oidc_convert"CryptoKeyFeatureTailnetResumeCryptoKeyFeature = "tailnet_resume")
funcAllCryptoKeyFeatureValues¶added inv2.16.0
func AllCryptoKeyFeatureValues() []CryptoKeyFeature
func (*CryptoKeyFeature)Scan¶added inv2.16.0
func (e *CryptoKeyFeature) Scan(src interface{})error
func (CryptoKeyFeature)Valid¶added inv2.16.0
func (eCryptoKeyFeature) Valid()bool
typeCustomRole¶added inv2.12.0
type CustomRole struct {Namestring `db:"name" json:"name"`DisplayNamestring `db:"display_name" json:"display_name"`SitePermissionsCustomRolePermissions `db:"site_permissions" json:"site_permissions"`OrgPermissionsCustomRolePermissions `db:"org_permissions" json:"org_permissions"`UserPermissionsCustomRolePermissions `db:"user_permissions" json:"user_permissions"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`// Roles can optionally be scoped to an organizationOrganizationIDuuid.NullUUID `db:"organization_id" json:"organization_id"`// Custom roles ID is used purely for auditing purposes. Name is a better unique identifier.IDuuid.UUID `db:"id" json:"id"`}
Custom roles allow dynamic roles expanded at runtime
func (CustomRole)RoleIdentifier¶added inv2.13.0
func (rCustomRole) RoleIdentifier()rbac.RoleIdentifier
typeCustomRolePermission¶added inv2.13.0
type CustomRolePermission struct {Negatebool `json:"negate"`ResourceTypestring `json:"resource_type"`Actionpolicy.Action `json:"action"`}
func (CustomRolePermission)String¶added inv2.13.0
func (aCustomRolePermission) String()string
typeCustomRolePermissions¶added inv2.13.0
type CustomRolePermissions []CustomRolePermission
func (*CustomRolePermissions)Scan¶added inv2.13.0
func (a *CustomRolePermissions) Scan(src interface{})error
typeCustomRolesParams¶added inv2.12.0
type CustomRolesParams struct {LookupRoles []NameOrganizationPair `db:"lookup_roles" json:"lookup_roles"`ExcludeOrgRolesbool `db:"exclude_org_roles" json:"exclude_org_roles"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`}
typeDBCryptKey¶added inv2.2.0
type DBCryptKey struct {// An integer used to identify the key.Numberint32 `db:"number" json:"number"`// If the key is active, the digest of the active key.ActiveKeyDigestsql.NullString `db:"active_key_digest" json:"active_key_digest"`// If the key has been revoked, the digest of the revoked key.RevokedKeyDigestsql.NullString `db:"revoked_key_digest" json:"revoked_key_digest"`// The time at which the key was created.CreatedAtsql.NullTime `db:"created_at" json:"created_at"`// The time at which the key was revoked.RevokedAtsql.NullTime `db:"revoked_at" json:"revoked_at"`// A column used to test the encryption.Teststring `db:"test" json:"test"`}
A table used to store the keys used to encrypt the database.
typeDBTX¶
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.RowSelectContext(ctxcontext.Context, dest interface{}, querystring, args ...interface{})errorGetContext(ctxcontext.Context, dest interface{}, querystring, args ...interface{})error}
DBTX represents a database connection or transaction.
typeDeleteAllTailnetClientSubscriptionsParams¶added inv2.2.0
typeDeleteAllTailnetTunnelsParams¶added inv2.4.0
typeDeleteCryptoKeyParams¶added inv2.16.0
type DeleteCryptoKeyParams struct {FeatureCryptoKeyFeature `db:"feature" json:"feature"`Sequenceint32 `db:"sequence" json:"sequence"`}
typeDeleteCustomRoleParams¶added inv2.15.0
typeDeleteExternalAuthLinkParams¶added inv2.5.0
typeDeleteOAuth2ProviderAppCodesByAppAndUserIDParams¶added inv2.9.0
typeDeleteOAuth2ProviderAppTokensByAppAndUserIDParams¶added inv2.9.0
typeDeleteOrganizationMemberParams¶added inv2.13.0
typeDeleteTailnetClientSubscriptionParams¶added inv2.2.0
typeDeleteTailnetPeerParams¶added inv2.4.0
typeDeleteTailnetPeerRow¶added inv2.4.0
typeDeleteTailnetTunnelParams¶added inv2.4.0
typeDeleteTailnetTunnelRow¶added inv2.4.0
typeDeleteWebpushSubscriptionByUserIDAndEndpointParams¶added inv2.21.0
typeDeleteWorkspaceAgentPortShareParams¶added inv2.9.0
typeDialerConnector¶added inv2.15.0
DialerConnector is a driver.Connector that can set a pq.Dialer.
typeDisplayApp¶added inv2.1.5
type DisplayAppstring
const (DisplayAppVscodeDisplayApp = "vscode"DisplayAppVscodeInsidersDisplayApp = "vscode_insiders"DisplayAppWebTerminalDisplayApp = "web_terminal"DisplayAppSSHHelperDisplayApp = "ssh_helper"DisplayAppPortForwardingHelperDisplayApp = "port_forwarding_helper")
funcAllDisplayAppValues¶added inv2.1.5
func AllDisplayAppValues() []DisplayApp
func (*DisplayApp)Scan¶added inv2.1.5
func (e *DisplayApp) Scan(src interface{})error
func (DisplayApp)Valid¶added inv2.1.5
func (eDisplayApp) Valid()bool
typeEnqueueNotificationMessageParams¶added inv2.13.0
type EnqueueNotificationMessageParams struct {IDuuid.UUID `db:"id" json:"id"`NotificationTemplateIDuuid.UUID `db:"notification_template_id" json:"notification_template_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`MethodNotificationMethod `db:"method" json:"method"`Payloadjson.RawMessage `db:"payload" json:"payload"`Targets []uuid.UUID `db:"targets" json:"targets"`CreatedBystring `db:"created_by" json:"created_by"`CreatedAttime.Time `db:"created_at" json:"created_at"`}
typeExternalAuthLink¶added inv2.2.1
type ExternalAuthLink struct {ProviderIDstring `db:"provider_id" json:"provider_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`OAuthAccessTokenstring `db:"oauth_access_token" json:"oauth_access_token"`OAuthRefreshTokenstring `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthExpirytime.Time `db:"oauth_expiry" json:"oauth_expiry"`// The ID of the key used to encrypt the OAuth access token. If this is NULL, the access token is not encryptedOAuthAccessTokenKeyIDsql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"`// The ID of the key used to encrypt the OAuth refresh token. If this is NULL, the refresh token is not encryptedOAuthRefreshTokenKeyIDsql.NullString `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"`OAuthExtrapqtype.NullRawMessage `db:"oauth_extra" json:"oauth_extra"`}
func (ExternalAuthLink)OAuthToken¶added inv2.8.0
func (uExternalAuthLink) OAuthToken() *oauth2.Token
func (ExternalAuthLink)RBACObject¶added inv2.2.1
func (uExternalAuthLink) RBACObject()rbac.Object
typeExternalAuthProvider¶added inv2.9.0
typeFetchNewMessageMetadataParams¶added inv2.13.0
typeFetchNewMessageMetadataRow¶added inv2.13.0
type FetchNewMessageMetadataRow struct {NotificationNamestring `db:"notification_name" json:"notification_name"`NotificationTemplateIDuuid.UUID `db:"notification_template_id" json:"notification_template_id"`Actions []byte `db:"actions" json:"actions"`CustomMethodNullNotificationMethod `db:"custom_method" json:"custom_method"`UserIDuuid.UUID `db:"user_id" json:"user_id"`UserEmailstring `db:"user_email" json:"user_email"`UserNamestring `db:"user_name" json:"user_name"`UserUsernamestring `db:"user_username" json:"user_username"`}
typeFile¶
type File struct {Hashstring `db:"hash" json:"hash"`CreatedAttime.Time `db:"created_at" json:"created_at"`CreatedByuuid.UUID `db:"created_by" json:"created_by"`Mimetypestring `db:"mimetype" json:"mimetype"`Data []byte `db:"data" json:"data"`IDuuid.UUID `db:"id" json:"id"`}
func (File)RBACObject¶
typeForeignKeyConstraint¶added inv2.2.0
type ForeignKeyConstraintstring
ForeignKeyConstraint represents a named foreign key constraint on a table.
const (ForeignKeyAPIKeysUserIDUUIDForeignKeyConstraint = "api_keys_user_id_uuid_fkey"// ALTER TABLE ONLY api_keys ADD CONSTRAINT api_keys_user_id_uuid_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyChatMessagesChatIDForeignKeyConstraint = "chat_messages_chat_id_fkey"// ALTER TABLE ONLY chat_messages ADD CONSTRAINT chat_messages_chat_id_fkey FOREIGN KEY (chat_id) REFERENCES chats(id) ON DELETE CASCADE;ForeignKeyChatsOwnerIDForeignKeyConstraint = "chats_owner_id_fkey"// ALTER TABLE ONLY chats ADD CONSTRAINT chats_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyCryptoKeysSecretKeyIDForeignKeyConstraint = "crypto_keys_secret_key_id_fkey"// ALTER TABLE ONLY crypto_keys ADD CONSTRAINT crypto_keys_secret_key_id_fkey FOREIGN KEY (secret_key_id) REFERENCES dbcrypt_keys(active_key_digest);ForeignKeyGitAuthLinksOauthAccessTokenKeyIDForeignKeyConstraint = "git_auth_links_oauth_access_token_key_id_fkey"// ALTER TABLE ONLY external_auth_links ADD CONSTRAINT git_auth_links_oauth_access_token_key_id_fkey FOREIGN KEY (oauth_access_token_key_id) REFERENCES dbcrypt_keys(active_key_digest);ForeignKeyGitAuthLinksOauthRefreshTokenKeyIDForeignKeyConstraint = "git_auth_links_oauth_refresh_token_key_id_fkey"// ALTER TABLE ONLY external_auth_links ADD CONSTRAINT git_auth_links_oauth_refresh_token_key_id_fkey FOREIGN KEY (oauth_refresh_token_key_id) REFERENCES dbcrypt_keys(active_key_digest);ForeignKeyGitSSHKeysUserIDForeignKeyConstraint = "gitsshkeys_user_id_fkey"// ALTER TABLE ONLY gitsshkeys ADD CONSTRAINT gitsshkeys_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);ForeignKeyGroupMembersGroupIDForeignKeyConstraint = "group_members_group_id_fkey"// ALTER TABLE ONLY group_members ADD CONSTRAINT group_members_group_id_fkey FOREIGN KEY (group_id) REFERENCES groups(id) ON DELETE CASCADE;ForeignKeyGroupMembersUserIDForeignKeyConstraint = "group_members_user_id_fkey"// ALTER TABLE ONLY group_members ADD CONSTRAINT group_members_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyGroupsOrganizationIDForeignKeyConstraint = "groups_organization_id_fkey"// ALTER TABLE ONLY groups ADD CONSTRAINT groups_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;ForeignKeyInboxNotificationsTemplateIDForeignKeyConstraint = "inbox_notifications_template_id_fkey"// ALTER TABLE ONLY inbox_notifications ADD CONSTRAINT inbox_notifications_template_id_fkey FOREIGN KEY (template_id) REFERENCES notification_templates(id) ON DELETE CASCADE;ForeignKeyInboxNotificationsUserIDForeignKeyConstraint = "inbox_notifications_user_id_fkey"// ALTER TABLE ONLY inbox_notifications ADD CONSTRAINT inbox_notifications_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyJfrogXrayScansAgentIDForeignKeyConstraint = "jfrog_xray_scans_agent_id_fkey"// ALTER TABLE ONLY jfrog_xray_scans ADD CONSTRAINT jfrog_xray_scans_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyJfrogXrayScansWorkspaceIDForeignKeyConstraint = "jfrog_xray_scans_workspace_id_fkey"// ALTER TABLE ONLY jfrog_xray_scans ADD CONSTRAINT jfrog_xray_scans_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspaces(id) ON DELETE CASCADE;ForeignKeyNotificationMessagesNotificationTemplateIDForeignKeyConstraint = "notification_messages_notification_template_id_fkey"// ALTER TABLE ONLY notification_messages ADD CONSTRAINT notification_messages_notification_template_id_fkey FOREIGN KEY (notification_template_id) REFERENCES notification_templates(id) ON DELETE CASCADE;ForeignKeyNotificationMessagesUserIDForeignKeyConstraint = "notification_messages_user_id_fkey"// ALTER TABLE ONLY notification_messages ADD CONSTRAINT notification_messages_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyNotificationPreferencesNotificationTemplateIDForeignKeyConstraint = "notification_preferences_notification_template_id_fkey"// ALTER TABLE ONLY notification_preferences ADD CONSTRAINT notification_preferences_notification_template_id_fkey FOREIGN KEY (notification_template_id) REFERENCES notification_templates(id) ON DELETE CASCADE;ForeignKeyNotificationPreferencesUserIDForeignKeyConstraint = "notification_preferences_user_id_fkey"// ALTER TABLE ONLY notification_preferences ADD CONSTRAINT notification_preferences_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyOauth2ProviderAppCodesAppIDForeignKeyConstraint = "oauth2_provider_app_codes_app_id_fkey"// ALTER TABLE ONLY oauth2_provider_app_codes ADD CONSTRAINT oauth2_provider_app_codes_app_id_fkey FOREIGN KEY (app_id) REFERENCES oauth2_provider_apps(id) ON DELETE CASCADE;ForeignKeyOauth2ProviderAppCodesUserIDForeignKeyConstraint = "oauth2_provider_app_codes_user_id_fkey"// ALTER TABLE ONLY oauth2_provider_app_codes ADD CONSTRAINT oauth2_provider_app_codes_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyOauth2ProviderAppSecretsAppIDForeignKeyConstraint = "oauth2_provider_app_secrets_app_id_fkey"// ALTER TABLE ONLY oauth2_provider_app_secrets ADD CONSTRAINT oauth2_provider_app_secrets_app_id_fkey FOREIGN KEY (app_id) REFERENCES oauth2_provider_apps(id) ON DELETE CASCADE;ForeignKeyOauth2ProviderAppTokensAPIKeyIDForeignKeyConstraint = "oauth2_provider_app_tokens_api_key_id_fkey"// ALTER TABLE ONLY oauth2_provider_app_tokens ADD CONSTRAINT oauth2_provider_app_tokens_api_key_id_fkey FOREIGN KEY (api_key_id) REFERENCES api_keys(id) ON DELETE CASCADE;ForeignKeyOauth2ProviderAppTokensAppSecretIDForeignKeyConstraint = "oauth2_provider_app_tokens_app_secret_id_fkey"// ALTER TABLE ONLY oauth2_provider_app_tokens ADD CONSTRAINT oauth2_provider_app_tokens_app_secret_id_fkey FOREIGN KEY (app_secret_id) REFERENCES oauth2_provider_app_secrets(id) ON DELETE CASCADE;ForeignKeyOrganizationMembersOrganizationIDUUIDForeignKeyConstraint = "organization_members_organization_id_uuid_fkey"// ALTER TABLE ONLY organization_members ADD CONSTRAINT organization_members_organization_id_uuid_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;ForeignKeyOrganizationMembersUserIDUUIDForeignKeyConstraint = "organization_members_user_id_uuid_fkey"// ALTER TABLE ONLY organization_members ADD CONSTRAINT organization_members_user_id_uuid_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyParameterSchemasJobIDForeignKeyConstraint = "parameter_schemas_job_id_fkey"// ALTER TABLE ONLY parameter_schemas ADD CONSTRAINT parameter_schemas_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE;ForeignKeyProvisionerDaemonsKeyIDForeignKeyConstraint = "provisioner_daemons_key_id_fkey"// ALTER TABLE ONLY provisioner_daemons ADD CONSTRAINT provisioner_daemons_key_id_fkey FOREIGN KEY (key_id) REFERENCES provisioner_keys(id) ON DELETE CASCADE;ForeignKeyProvisionerDaemonsOrganizationIDForeignKeyConstraint = "provisioner_daemons_organization_id_fkey"// ALTER TABLE ONLY provisioner_daemons ADD CONSTRAINT provisioner_daemons_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;ForeignKeyProvisionerJobLogsJobIDForeignKeyConstraint = "provisioner_job_logs_job_id_fkey"// ALTER TABLE ONLY provisioner_job_logs ADD CONSTRAINT provisioner_job_logs_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE;ForeignKeyProvisionerJobTimingsJobIDForeignKeyConstraint = "provisioner_job_timings_job_id_fkey"// ALTER TABLE ONLY provisioner_job_timings ADD CONSTRAINT provisioner_job_timings_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE;ForeignKeyProvisionerJobsOrganizationIDForeignKeyConstraint = "provisioner_jobs_organization_id_fkey"// ALTER TABLE ONLY provisioner_jobs ADD CONSTRAINT provisioner_jobs_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;ForeignKeyProvisionerKeysOrganizationIDForeignKeyConstraint = "provisioner_keys_organization_id_fkey"// ALTER TABLE ONLY provisioner_keys ADD CONSTRAINT provisioner_keys_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;ForeignKeyTailnetAgentsCoordinatorIDForeignKeyConstraint = "tailnet_agents_coordinator_id_fkey"// ALTER TABLE ONLY tailnet_agents ADD CONSTRAINT tailnet_agents_coordinator_id_fkey FOREIGN KEY (coordinator_id) REFERENCES tailnet_coordinators(id) ON DELETE CASCADE;ForeignKeyTailnetClientSubscriptionsCoordinatorIDForeignKeyConstraint = "tailnet_client_subscriptions_coordinator_id_fkey"// ALTER TABLE ONLY tailnet_client_subscriptions ADD CONSTRAINT tailnet_client_subscriptions_coordinator_id_fkey FOREIGN KEY (coordinator_id) REFERENCES tailnet_coordinators(id) ON DELETE CASCADE;ForeignKeyTailnetClientsCoordinatorIDForeignKeyConstraint = "tailnet_clients_coordinator_id_fkey"// ALTER TABLE ONLY tailnet_clients ADD CONSTRAINT tailnet_clients_coordinator_id_fkey FOREIGN KEY (coordinator_id) REFERENCES tailnet_coordinators(id) ON DELETE CASCADE;ForeignKeyTailnetPeersCoordinatorIDForeignKeyConstraint = "tailnet_peers_coordinator_id_fkey"// ALTER TABLE ONLY tailnet_peers ADD CONSTRAINT tailnet_peers_coordinator_id_fkey FOREIGN KEY (coordinator_id) REFERENCES tailnet_coordinators(id) ON DELETE CASCADE;ForeignKeyTailnetTunnelsCoordinatorIDForeignKeyConstraint = "tailnet_tunnels_coordinator_id_fkey"// ALTER TABLE ONLY tailnet_tunnels ADD CONSTRAINT tailnet_tunnels_coordinator_id_fkey FOREIGN KEY (coordinator_id) REFERENCES tailnet_coordinators(id) ON DELETE CASCADE;ForeignKeyTemplateVersionParametersTemplateVersionIDForeignKeyConstraint = "template_version_parameters_template_version_id_fkey"// ALTER TABLE ONLY template_version_parameters ADD CONSTRAINT template_version_parameters_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE;ForeignKeyTemplateVersionPresetParametTemplateVersionPresetIDForeignKeyConstraint = "template_version_preset_paramet_template_version_preset_id_fkey"// ALTER TABLE ONLY template_version_preset_parameters ADD CONSTRAINT template_version_preset_paramet_template_version_preset_id_fkey FOREIGN KEY (template_version_preset_id) REFERENCES template_version_presets(id) ON DELETE CASCADE;ForeignKeyTemplateVersionPresetsTemplateVersionIDForeignKeyConstraint = "template_version_presets_template_version_id_fkey"// ALTER TABLE ONLY template_version_presets ADD CONSTRAINT template_version_presets_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE;ForeignKeyTemplateVersionTerraformValuesCachedModuleFilesForeignKeyConstraint = "template_version_terraform_values_cached_module_files_fkey"// ALTER TABLE ONLY template_version_terraform_values ADD CONSTRAINT template_version_terraform_values_cached_module_files_fkey FOREIGN KEY (cached_module_files) REFERENCES files(id);ForeignKeyTemplateVersionTerraformValuesTemplateVersionIDForeignKeyConstraint = "template_version_terraform_values_template_version_id_fkey"// ALTER TABLE ONLY template_version_terraform_values ADD CONSTRAINT template_version_terraform_values_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE;ForeignKeyTemplateVersionVariablesTemplateVersionIDForeignKeyConstraint = "template_version_variables_template_version_id_fkey"// ALTER TABLE ONLY template_version_variables ADD CONSTRAINT template_version_variables_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE;ForeignKeyTemplateVersionWorkspaceTagsTemplateVersionIDForeignKeyConstraint = "template_version_workspace_tags_template_version_id_fkey"// ALTER TABLE ONLY template_version_workspace_tags ADD CONSTRAINT template_version_workspace_tags_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE;ForeignKeyTemplateVersionsCreatedByForeignKeyConstraint = "template_versions_created_by_fkey"// ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_created_by_fkey FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE RESTRICT;ForeignKeyTemplateVersionsOrganizationIDForeignKeyConstraint = "template_versions_organization_id_fkey"// ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;ForeignKeyTemplateVersionsTemplateIDForeignKeyConstraint = "template_versions_template_id_fkey"// ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_template_id_fkey FOREIGN KEY (template_id) REFERENCES templates(id) ON DELETE CASCADE;ForeignKeyTemplatesCreatedByForeignKeyConstraint = "templates_created_by_fkey"// ALTER TABLE ONLY templates ADD CONSTRAINT templates_created_by_fkey FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE RESTRICT;ForeignKeyTemplatesOrganizationIDForeignKeyConstraint = "templates_organization_id_fkey"// ALTER TABLE ONLY templates ADD CONSTRAINT templates_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;ForeignKeyUserConfigsUserIDForeignKeyConstraint = "user_configs_user_id_fkey"// ALTER TABLE ONLY user_configs ADD CONSTRAINT user_configs_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyUserDeletedUserIDForeignKeyConstraint = "user_deleted_user_id_fkey"// ALTER TABLE ONLY user_deleted ADD CONSTRAINT user_deleted_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);ForeignKeyUserLinksOauthAccessTokenKeyIDForeignKeyConstraint = "user_links_oauth_access_token_key_id_fkey"// ALTER TABLE ONLY user_links ADD CONSTRAINT user_links_oauth_access_token_key_id_fkey FOREIGN KEY (oauth_access_token_key_id) REFERENCES dbcrypt_keys(active_key_digest);ForeignKeyUserLinksOauthRefreshTokenKeyIDForeignKeyConstraint = "user_links_oauth_refresh_token_key_id_fkey"// ALTER TABLE ONLY user_links ADD CONSTRAINT user_links_oauth_refresh_token_key_id_fkey FOREIGN KEY (oauth_refresh_token_key_id) REFERENCES dbcrypt_keys(active_key_digest);ForeignKeyUserLinksUserIDForeignKeyConstraint = "user_links_user_id_fkey"// ALTER TABLE ONLY user_links ADD CONSTRAINT user_links_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyUserStatusChangesUserIDForeignKeyConstraint = "user_status_changes_user_id_fkey"// ALTER TABLE ONLY user_status_changes ADD CONSTRAINT user_status_changes_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);ForeignKeyWebpushSubscriptionsUserIDForeignKeyConstraint = "webpush_subscriptions_user_id_fkey"// ALTER TABLE ONLY webpush_subscriptions ADD CONSTRAINT webpush_subscriptions_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentDevcontainersWorkspaceAgentIDForeignKeyConstraint = "workspace_agent_devcontainers_workspace_agent_id_fkey"// ALTER TABLE ONLY workspace_agent_devcontainers ADD CONSTRAINT workspace_agent_devcontainers_workspace_agent_id_fkey FOREIGN KEY (workspace_agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentLogSourcesWorkspaceAgentIDForeignKeyConstraint = "workspace_agent_log_sources_workspace_agent_id_fkey"// ALTER TABLE ONLY workspace_agent_log_sources ADD CONSTRAINT workspace_agent_log_sources_workspace_agent_id_fkey FOREIGN KEY (workspace_agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentMemoryResourceMonitorsAgentIDForeignKeyConstraint = "workspace_agent_memory_resource_monitors_agent_id_fkey"// ALTER TABLE ONLY workspace_agent_memory_resource_monitors ADD CONSTRAINT workspace_agent_memory_resource_monitors_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentMetadataWorkspaceAgentIDForeignKeyConstraint = "workspace_agent_metadata_workspace_agent_id_fkey"// ALTER TABLE ONLY workspace_agent_metadata ADD CONSTRAINT workspace_agent_metadata_workspace_agent_id_fkey FOREIGN KEY (workspace_agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentPortShareWorkspaceIDForeignKeyConstraint = "workspace_agent_port_share_workspace_id_fkey"// ALTER TABLE ONLY workspace_agent_port_share ADD CONSTRAINT workspace_agent_port_share_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspaces(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentScriptTimingsScriptIDForeignKeyConstraint = "workspace_agent_script_timings_script_id_fkey"// ALTER TABLE ONLY workspace_agent_script_timings ADD CONSTRAINT workspace_agent_script_timings_script_id_fkey FOREIGN KEY (script_id) REFERENCES workspace_agent_scripts(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentScriptsWorkspaceAgentIDForeignKeyConstraint = "workspace_agent_scripts_workspace_agent_id_fkey"// ALTER TABLE ONLY workspace_agent_scripts ADD CONSTRAINT workspace_agent_scripts_workspace_agent_id_fkey FOREIGN KEY (workspace_agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentStartupLogsAgentIDForeignKeyConstraint = "workspace_agent_startup_logs_agent_id_fkey"// ALTER TABLE ONLY workspace_agent_logs ADD CONSTRAINT workspace_agent_startup_logs_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentVolumeResourceMonitorsAgentIDForeignKeyConstraint = "workspace_agent_volume_resource_monitors_agent_id_fkey"// ALTER TABLE ONLY workspace_agent_volume_resource_monitors ADD CONSTRAINT workspace_agent_volume_resource_monitors_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentsParentIDForeignKeyConstraint = "workspace_agents_parent_id_fkey"// ALTER TABLE ONLY workspace_agents ADD CONSTRAINT workspace_agents_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAgentsResourceIDForeignKeyConstraint = "workspace_agents_resource_id_fkey"// ALTER TABLE ONLY workspace_agents ADD CONSTRAINT workspace_agents_resource_id_fkey FOREIGN KEY (resource_id) REFERENCES workspace_resources(id) ON DELETE CASCADE;ForeignKeyWorkspaceAppAuditSessionsAgentIDForeignKeyConstraint = "workspace_app_audit_sessions_agent_id_fkey"// ALTER TABLE ONLY workspace_app_audit_sessions ADD CONSTRAINT workspace_app_audit_sessions_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceAppStatsAgentIDForeignKeyConstraint = "workspace_app_stats_agent_id_fkey"// ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id);ForeignKeyWorkspaceAppStatsUserIDForeignKeyConstraint = "workspace_app_stats_user_id_fkey"// ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id);ForeignKeyWorkspaceAppStatsWorkspaceIDForeignKeyConstraint = "workspace_app_stats_workspace_id_fkey"// ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspaces(id);ForeignKeyWorkspaceAppStatusesAgentIDForeignKeyConstraint = "workspace_app_statuses_agent_id_fkey"// ALTER TABLE ONLY workspace_app_statuses ADD CONSTRAINT workspace_app_statuses_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id);ForeignKeyWorkspaceAppStatusesAppIDForeignKeyConstraint = "workspace_app_statuses_app_id_fkey"// ALTER TABLE ONLY workspace_app_statuses ADD CONSTRAINT workspace_app_statuses_app_id_fkey FOREIGN KEY (app_id) REFERENCES workspace_apps(id);ForeignKeyWorkspaceAppStatusesWorkspaceIDForeignKeyConstraint = "workspace_app_statuses_workspace_id_fkey"// ALTER TABLE ONLY workspace_app_statuses ADD CONSTRAINT workspace_app_statuses_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspaces(id);ForeignKeyWorkspaceAppsAgentIDForeignKeyConstraint = "workspace_apps_agent_id_fkey"// ALTER TABLE ONLY workspace_apps ADD CONSTRAINT workspace_apps_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE;ForeignKeyWorkspaceBuildParametersWorkspaceBuildIDForeignKeyConstraint = "workspace_build_parameters_workspace_build_id_fkey"// ALTER TABLE ONLY workspace_build_parameters ADD CONSTRAINT workspace_build_parameters_workspace_build_id_fkey FOREIGN KEY (workspace_build_id) REFERENCES workspace_builds(id) ON DELETE CASCADE;ForeignKeyWorkspaceBuildsJobIDForeignKeyConstraint = "workspace_builds_job_id_fkey"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE;ForeignKeyWorkspaceBuildsTemplateVersionIDForeignKeyConstraint = "workspace_builds_template_version_id_fkey"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE;ForeignKeyWorkspaceBuildsTemplateVersionPresetIDForeignKeyConstraint = "workspace_builds_template_version_preset_id_fkey"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_template_version_preset_id_fkey FOREIGN KEY (template_version_preset_id) REFERENCES template_version_presets(id) ON DELETE SET NULL;ForeignKeyWorkspaceBuildsWorkspaceIDForeignKeyConstraint = "workspace_builds_workspace_id_fkey"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspaces(id) ON DELETE CASCADE;ForeignKeyWorkspaceModulesJobIDForeignKeyConstraint = "workspace_modules_job_id_fkey"// ALTER TABLE ONLY workspace_modules ADD CONSTRAINT workspace_modules_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE;ForeignKeyWorkspaceResourceMetadataWorkspaceResourceIDForeignKeyConstraint = "workspace_resource_metadata_workspace_resource_id_fkey"// ALTER TABLE ONLY workspace_resource_metadata ADD CONSTRAINT workspace_resource_metadata_workspace_resource_id_fkey FOREIGN KEY (workspace_resource_id) REFERENCES workspace_resources(id) ON DELETE CASCADE;ForeignKeyWorkspaceResourcesJobIDForeignKeyConstraint = "workspace_resources_job_id_fkey"// ALTER TABLE ONLY workspace_resources ADD CONSTRAINT workspace_resources_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE;ForeignKeyWorkspacesOrganizationIDForeignKeyConstraint = "workspaces_organization_id_fkey"// ALTER TABLE ONLY workspaces ADD CONSTRAINT workspaces_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE RESTRICT;ForeignKeyWorkspacesOwnerIDForeignKeyConstraint = "workspaces_owner_id_fkey"// ALTER TABLE ONLY workspaces ADD CONSTRAINT workspaces_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE RESTRICT;ForeignKeyWorkspacesTemplateIDForeignKeyConstraint = "workspaces_template_id_fkey"// ALTER TABLE ONLY workspaces ADD CONSTRAINT workspaces_template_id_fkey FOREIGN KEY (template_id) REFERENCES templates(id) ON DELETE RESTRICT;)
ForeignKeyConstraint enums.
typeGetAuditLogsOffsetParams¶
type GetAuditLogsOffsetParams struct {ResourceTypestring `db:"resource_type" json:"resource_type"`ResourceIDuuid.UUID `db:"resource_id" json:"resource_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`ResourceTargetstring `db:"resource_target" json:"resource_target"`Actionstring `db:"action" json:"action"`UserIDuuid.UUID `db:"user_id" json:"user_id"`Usernamestring `db:"username" json:"username"`Emailstring `db:"email" json:"email"`DateFromtime.Time `db:"date_from" json:"date_from"`DateTotime.Time `db:"date_to" json:"date_to"`BuildReasonstring `db:"build_reason" json:"build_reason"`RequestIDuuid.UUID `db:"request_id" json:"request_id"`OffsetOptint32 `db:"offset_opt" json:"offset_opt"`LimitOptint32 `db:"limit_opt" json:"limit_opt"`}
typeGetAuditLogsOffsetRow¶
type GetAuditLogsOffsetRow struct {AuditLogAuditLog `db:"audit_log" json:"audit_log"`UserUsernamesql.NullString `db:"user_username" json:"user_username"`UserNamesql.NullString `db:"user_name" json:"user_name"`UserEmailsql.NullString `db:"user_email" json:"user_email"`UserCreatedAtsql.NullTime `db:"user_created_at" json:"user_created_at"`UserUpdatedAtsql.NullTime `db:"user_updated_at" json:"user_updated_at"`UserLastSeenAtsql.NullTime `db:"user_last_seen_at" json:"user_last_seen_at"`UserStatusNullUserStatus `db:"user_status" json:"user_status"`UserLoginTypeNullLoginType `db:"user_login_type" json:"user_login_type"`UserRolespq.StringArray `db:"user_roles" json:"user_roles"`UserAvatarUrlsql.NullString `db:"user_avatar_url" json:"user_avatar_url"`UserDeletedsql.NullBool `db:"user_deleted" json:"user_deleted"`UserQuietHoursSchedulesql.NullString `db:"user_quiet_hours_schedule" json:"user_quiet_hours_schedule"`OrganizationNamestring `db:"organization_name" json:"organization_name"`OrganizationDisplayNamestring `db:"organization_display_name" json:"organization_display_name"`OrganizationIconstring `db:"organization_icon" json:"organization_icon"`Countint64 `db:"count" json:"count"`}
func (GetAuditLogsOffsetRow)RBACObject¶added inv2.14.0
func (wGetAuditLogsOffsetRow) RBACObject()rbac.Object
typeGetAuthorizationUserRolesRow¶
type GetAuthorizationUserRolesRow struct {IDuuid.UUID `db:"id" json:"id"`Usernamestring `db:"username" json:"username"`StatusUserStatus `db:"status" json:"status"`Emailstring `db:"email" json:"email"`Roles []string `db:"roles" json:"roles"`Groups []string `db:"groups" json:"groups"`}
func (GetAuthorizationUserRolesRow)RoleNames¶added inv2.13.0
func (rGetAuthorizationUserRolesRow) RoleNames() ([]rbac.RoleIdentifier,error)
typeGetCryptoKeyByFeatureAndSequenceParams¶added inv2.16.0
type GetCryptoKeyByFeatureAndSequenceParams struct {FeatureCryptoKeyFeature `db:"feature" json:"feature"`Sequenceint32 `db:"sequence" json:"sequence"`}
typeGetDeploymentWorkspaceAgentStatsRow¶
type GetDeploymentWorkspaceAgentStatsRow struct {WorkspaceRxBytesint64 `db:"workspace_rx_bytes" json:"workspace_rx_bytes"`WorkspaceTxBytesint64 `db:"workspace_tx_bytes" json:"workspace_tx_bytes"`WorkspaceConnectionLatency50float64 `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"`WorkspaceConnectionLatency95float64 `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"`SessionCountVSCodeint64 `db:"session_count_vscode" json:"session_count_vscode"`SessionCountSSHint64 `db:"session_count_ssh" json:"session_count_ssh"`SessionCountJetBrainsint64 `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`}
typeGetDeploymentWorkspaceAgentUsageStatsRow¶added inv2.16.0
type GetDeploymentWorkspaceAgentUsageStatsRow struct {WorkspaceRxBytesint64 `db:"workspace_rx_bytes" json:"workspace_rx_bytes"`WorkspaceTxBytesint64 `db:"workspace_tx_bytes" json:"workspace_tx_bytes"`WorkspaceConnectionLatency50float64 `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"`WorkspaceConnectionLatency95float64 `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"`SessionCountVSCodeint64 `db:"session_count_vscode" json:"session_count_vscode"`SessionCountSSHint64 `db:"session_count_ssh" json:"session_count_ssh"`SessionCountJetBrainsint64 `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`}
typeGetDeploymentWorkspaceStatsRow¶
type GetDeploymentWorkspaceStatsRow struct {PendingWorkspacesint64 `db:"pending_workspaces" json:"pending_workspaces"`BuildingWorkspacesint64 `db:"building_workspaces" json:"building_workspaces"`RunningWorkspacesint64 `db:"running_workspaces" json:"running_workspaces"`FailedWorkspacesint64 `db:"failed_workspaces" json:"failed_workspaces"`StoppedWorkspacesint64 `db:"stopped_workspaces" json:"stopped_workspaces"`}
typeGetEligibleProvisionerDaemonsByProvisionerJobIDsRow¶added inv2.18.1
type GetEligibleProvisionerDaemonsByProvisionerJobIDsRow struct {JobIDuuid.UUID `db:"job_id" json:"job_id"`ProvisionerDaemonProvisionerDaemon `db:"provisioner_daemon" json:"provisioner_daemon"`}
func (GetEligibleProvisionerDaemonsByProvisionerJobIDsRow)RBACObject¶added inv2.18.1
func (pGetEligibleProvisionerDaemonsByProvisionerJobIDsRow) RBACObject()rbac.Object
typeGetExternalAuthLinkParams¶added inv2.2.1
typeGetFailedWorkspaceBuildsByTemplateIDParams¶added inv2.16.0
typeGetFailedWorkspaceBuildsByTemplateIDRow¶added inv2.16.0
type GetFailedWorkspaceBuildsByTemplateIDRow struct {TemplateVersionNamestring `db:"template_version_name" json:"template_version_name"`WorkspaceOwnerUsernamestring `db:"workspace_owner_username" json:"workspace_owner_username"`WorkspaceNamestring `db:"workspace_name" json:"workspace_name"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`WorkspaceBuildNumberint32 `db:"workspace_build_number" json:"workspace_build_number"`}
typeGetFileTemplatesRow¶
type GetFileTemplatesRow struct {FileIDuuid.UUID `db:"file_id" json:"file_id"`FileCreatedByuuid.UUID `db:"file_created_by" json:"file_created_by"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`TemplateOrganizationIDuuid.UUID `db:"template_organization_id" json:"template_organization_id"`TemplateCreatedByuuid.UUID `db:"template_created_by" json:"template_created_by"`UserACLTemplateACL `db:"user_acl" json:"user_acl"`GroupACLTemplateACL `db:"group_acl" json:"group_acl"`}
func (GetFileTemplatesRow)RBACObject¶
func (tGetFileTemplatesRow) RBACObject()rbac.Object
typeGetFilteredInboxNotificationsByUserIDParams¶added inv2.21.0
type GetFilteredInboxNotificationsByUserIDParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`Templates []uuid.UUID `db:"templates" json:"templates"`Targets []uuid.UUID `db:"targets" json:"targets"`ReadStatusInboxNotificationReadStatus `db:"read_status" json:"read_status"`CreatedAtOpttime.Time `db:"created_at_opt" json:"created_at_opt"`LimitOptint32 `db:"limit_opt" json:"limit_opt"`}
typeGetGroupMembersByGroupIDParams¶added inv2.21.0
typeGetGroupMembersCountByGroupIDParams¶added inv2.21.0
typeGetGroupsParams¶added inv2.15.0
typeGetGroupsRow¶added inv2.15.0
type GetGroupsRow struct {GroupGroup `db:"group" json:"group"`OrganizationNamestring `db:"organization_name" json:"organization_name"`OrganizationDisplayNamestring `db:"organization_display_name" json:"organization_display_name"`}
func (GetGroupsRow)RBACObject¶added inv2.15.0
func (gGetGroupsRow) RBACObject()rbac.Object
typeGetInboxNotificationsByUserIDParams¶added inv2.21.0
typeGetNotificationMessagesByStatusParams¶added inv2.14.0
type GetNotificationMessagesByStatusParams struct {StatusNotificationMessageStatus `db:"status" json:"status"`Limitint32 `db:"limit" json:"limit"`}
typeGetOAuth2ProviderAppsByUserIDRow¶added inv2.9.0
type GetOAuth2ProviderAppsByUserIDRow struct {TokenCountint64 `db:"token_count" json:"token_count"`OAuth2ProviderAppOAuth2ProviderApp `db:"oauth2_provider_app" json:"oauth2_provider_app"`}
func (GetOAuth2ProviderAppsByUserIDRow)RBACObject¶added inv2.9.0
func (aGetOAuth2ProviderAppsByUserIDRow) RBACObject()rbac.Object
typeGetOrganizationByNameParams¶added inv2.20.0
typeGetOrganizationIDsByMemberIDsRow¶
type GetOrganizationIDsByMemberIDsRow struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`OrganizationIDs []uuid.UUID `db:"organization_IDs" json:"organization_IDs"`}
func (GetOrganizationIDsByMemberIDsRow)RBACObject¶
func (mGetOrganizationIDsByMemberIDsRow) RBACObject()rbac.Object
typeGetOrganizationResourceCountByIDRow¶added inv2.21.0
type GetOrganizationResourceCountByIDRow struct {WorkspaceCountint64 `db:"workspace_count" json:"workspace_count"`GroupCountint64 `db:"group_count" json:"group_count"`TemplateCountint64 `db:"template_count" json:"template_count"`MemberCountint64 `db:"member_count" json:"member_count"`ProvisionerKeyCountint64 `db:"provisioner_key_count" json:"provisioner_key_count"`}
typeGetOrganizationsByUserIDParams¶added inv2.20.0
typeGetOrganizationsParams¶added inv2.15.0
typeGetPrebuildMetricsRow¶added inv2.22.0
type GetPrebuildMetricsRow struct {TemplateNamestring `db:"template_name" json:"template_name"`PresetNamestring `db:"preset_name" json:"preset_name"`OrganizationNamestring `db:"organization_name" json:"organization_name"`CreatedCountint64 `db:"created_count" json:"created_count"`FailedCountint64 `db:"failed_count" json:"failed_count"`ClaimedCountint64 `db:"claimed_count" json:"claimed_count"`}
typeGetPresetByIDRow¶added inv2.22.0
type GetPresetByIDRow struct {IDuuid.UUID `db:"id" json:"id"`TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`Namestring `db:"name" json:"name"`CreatedAttime.Time `db:"created_at" json:"created_at"`DesiredInstancessql.NullInt32 `db:"desired_instances" json:"desired_instances"`InvalidateAfterSecssql.NullInt32 `db:"invalidate_after_secs" json:"invalidate_after_secs"`PrebuildStatusPrebuildStatus `db:"prebuild_status" json:"prebuild_status"`TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`}
typeGetPresetsAtFailureLimitRow¶added inv2.23.0
typeGetPresetsBackoffRow¶added inv2.22.0
typeGetProvisionerDaemonsByOrganizationParams¶added inv2.18.0
typeGetProvisionerDaemonsWithStatusByOrganizationParams¶added inv2.19.0
type GetProvisionerDaemonsWithStatusByOrganizationParams struct {StaleIntervalMSint64 `db:"stale_interval_ms" json:"stale_interval_ms"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`IDs []uuid.UUID `db:"ids" json:"ids"`TagsStringMap `db:"tags" json:"tags"`Limitsql.NullInt32 `db:"limit" json:"limit"`}
typeGetProvisionerDaemonsWithStatusByOrganizationRow¶added inv2.19.0
type GetProvisionerDaemonsWithStatusByOrganizationRow struct {ProvisionerDaemonProvisionerDaemon `db:"provisioner_daemon" json:"provisioner_daemon"`StatusProvisionerDaemonStatus `db:"status" json:"status"`KeyNamestring `db:"key_name" json:"key_name"`CurrentJobIDuuid.NullUUID `db:"current_job_id" json:"current_job_id"`CurrentJobStatusNullProvisionerJobStatus `db:"current_job_status" json:"current_job_status"`PreviousJobIDuuid.NullUUID `db:"previous_job_id" json:"previous_job_id"`PreviousJobStatusNullProvisionerJobStatus `db:"previous_job_status" json:"previous_job_status"`CurrentJobTemplateNamestring `db:"current_job_template_name" json:"current_job_template_name"`CurrentJobTemplateDisplayNamestring `db:"current_job_template_display_name" json:"current_job_template_display_name"`CurrentJobTemplateIconstring `db:"current_job_template_icon" json:"current_job_template_icon"`PreviousJobTemplateNamestring `db:"previous_job_template_name" json:"previous_job_template_name"`PreviousJobTemplateDisplayNamestring `db:"previous_job_template_display_name" json:"previous_job_template_display_name"`PreviousJobTemplateIconstring `db:"previous_job_template_icon" json:"previous_job_template_icon"`}
func (GetProvisionerDaemonsWithStatusByOrganizationRow)RBACObject¶added inv2.19.0
func (pGetProvisionerDaemonsWithStatusByOrganizationRow) RBACObject()rbac.Object
typeGetProvisionerJobsByIDsWithQueuePositionRow¶
type GetProvisionerJobsByIDsWithQueuePositionRow struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`ProvisionerJobProvisionerJob `db:"provisioner_job" json:"provisioner_job"`QueuePositionint64 `db:"queue_position" json:"queue_position"`QueueSizeint64 `db:"queue_size" json:"queue_size"`}
typeGetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerParams¶added inv2.19.0
type GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerParams struct {OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`IDs []uuid.UUID `db:"ids" json:"ids"`Status []ProvisionerJobStatus `db:"status" json:"status"`TagsStringMap `db:"tags" json:"tags"`Limitsql.NullInt32 `db:"limit" json:"limit"`}
typeGetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow¶added inv2.19.0
type GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow struct {ProvisionerJobProvisionerJob `db:"provisioner_job" json:"provisioner_job"`QueuePositionint64 `db:"queue_position" json:"queue_position"`QueueSizeint64 `db:"queue_size" json:"queue_size"`AvailableWorkers []uuid.UUID `db:"available_workers" json:"available_workers"`TemplateVersionNamestring `db:"template_version_name" json:"template_version_name"`TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`TemplateNamestring `db:"template_name" json:"template_name"`TemplateDisplayNamestring `db:"template_display_name" json:"template_display_name"`TemplateIconstring `db:"template_icon" json:"template_icon"`WorkspaceIDuuid.NullUUID `db:"workspace_id" json:"workspace_id"`WorkspaceNamestring `db:"workspace_name" json:"workspace_name"`WorkerNamestring `db:"worker_name" json:"worker_name"`}
func (GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow)RBACObject¶added inv2.19.0
func (rGetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow) RBACObject()rbac.Object
typeGetProvisionerJobsToBeReapedParams¶added inv2.23.0
typeGetProvisionerKeyByNameParams¶added inv2.14.0
typeGetQuotaAllowanceForUserParams¶added inv2.15.0
typeGetQuotaConsumedForUserParams¶added inv2.15.0
typeGetRunningPrebuiltWorkspacesRow¶added inv2.22.0
type GetRunningPrebuiltWorkspacesRow struct {IDuuid.UUID `db:"id" json:"id"`Namestring `db:"name" json:"name"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`CurrentPresetIDuuid.NullUUID `db:"current_preset_id" json:"current_preset_id"`Readybool `db:"ready" json:"ready"`CreatedAttime.Time `db:"created_at" json:"created_at"`}
typeGetTailnetTunnelPeerBindingsRow¶added inv2.4.0
typeGetTailnetTunnelPeerIDsRow¶added inv2.4.0
typeGetTemplateAppInsightsByTemplateParams¶added inv2.4.0
typeGetTemplateAppInsightsByTemplateRow¶added inv2.4.0
type GetTemplateAppInsightsByTemplateRow struct {TemplateIDuuid.UUID `db:"template_id" json:"template_id"`SlugOrPortstring `db:"slug_or_port" json:"slug_or_port"`DisplayNamestring `db:"display_name" json:"display_name"`ActiveUsersint64 `db:"active_users" json:"active_users"`UsageSecondsint64 `db:"usage_seconds" json:"usage_seconds"`}
typeGetTemplateAppInsightsRow¶
type GetTemplateAppInsightsRow struct {TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`ActiveUsersint64 `db:"active_users" json:"active_users"`Slugstring `db:"slug" json:"slug"`DisplayNamestring `db:"display_name" json:"display_name"`Iconstring `db:"icon" json:"icon"`UsageSecondsint64 `db:"usage_seconds" json:"usage_seconds"`TimesUsedint64 `db:"times_used" json:"times_used"`}
typeGetTemplateAverageBuildTimeRow¶
type GetTemplateAverageBuildTimeRow struct {Start50float64 `db:"start_50" json:"start_50"`Stop50float64 `db:"stop_50" json:"stop_50"`Delete50float64 `db:"delete_50" json:"delete_50"`Start95float64 `db:"start_95" json:"start_95"`Stop95float64 `db:"stop_95" json:"stop_95"`Delete95float64 `db:"delete_95" json:"delete_95"`}
typeGetTemplateInsightsByIntervalParams¶added inv2.2.0
typeGetTemplateInsightsByIntervalRow¶added inv2.2.0
typeGetTemplateInsightsByTemplateParams¶added inv2.3.2
typeGetTemplateInsightsByTemplateRow¶added inv2.3.2
type GetTemplateInsightsByTemplateRow struct {TemplateIDuuid.UUID `db:"template_id" json:"template_id"`ActiveUsersint64 `db:"active_users" json:"active_users"`UsageVscodeSecondsint64 `db:"usage_vscode_seconds" json:"usage_vscode_seconds"`UsageJetbrainsSecondsint64 `db:"usage_jetbrains_seconds" json:"usage_jetbrains_seconds"`UsageReconnectingPtySecondsint64 `db:"usage_reconnecting_pty_seconds" json:"usage_reconnecting_pty_seconds"`UsageSshSecondsint64 `db:"usage_ssh_seconds" json:"usage_ssh_seconds"`}
typeGetTemplateInsightsRow¶
type GetTemplateInsightsRow struct {TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`SshTemplateIds []uuid.UUID `db:"ssh_template_ids" json:"ssh_template_ids"`SftpTemplateIds []uuid.UUID `db:"sftp_template_ids" json:"sftp_template_ids"`ReconnectingPtyTemplateIds []uuid.UUID `db:"reconnecting_pty_template_ids" json:"reconnecting_pty_template_ids"`VscodeTemplateIds []uuid.UUID `db:"vscode_template_ids" json:"vscode_template_ids"`JetbrainsTemplateIds []uuid.UUID `db:"jetbrains_template_ids" json:"jetbrains_template_ids"`ActiveUsersint64 `db:"active_users" json:"active_users"`UsageTotalSecondsint64 `db:"usage_total_seconds" json:"usage_total_seconds"`UsageSshSecondsint64 `db:"usage_ssh_seconds" json:"usage_ssh_seconds"`UsageSftpSecondsint64 `db:"usage_sftp_seconds" json:"usage_sftp_seconds"`UsageReconnectingPtySecondsint64 `db:"usage_reconnecting_pty_seconds" json:"usage_reconnecting_pty_seconds"`UsageVscodeSecondsint64 `db:"usage_vscode_seconds" json:"usage_vscode_seconds"`UsageJetbrainsSecondsint64 `db:"usage_jetbrains_seconds" json:"usage_jetbrains_seconds"`}
typeGetTemplateParameterInsightsRow¶
type GetTemplateParameterInsightsRow struct {Numint64 `db:"num" json:"num"`TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`Namestring `db:"name" json:"name"`Typestring `db:"type" json:"type"`DisplayNamestring `db:"display_name" json:"display_name"`Descriptionstring `db:"description" json:"description"`Optionsjson.RawMessage `db:"options" json:"options"`Valuestring `db:"value" json:"value"`Countint64 `db:"count" json:"count"`}
typeGetTemplatePresetsWithPrebuildsRow¶added inv2.22.0
type GetTemplatePresetsWithPrebuildsRow struct {TemplateIDuuid.UUID `db:"template_id" json:"template_id"`TemplateNamestring `db:"template_name" json:"template_name"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`OrganizationNamestring `db:"organization_name" json:"organization_name"`TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`TemplateVersionNamestring `db:"template_version_name" json:"template_version_name"`UsingActiveVersionbool `db:"using_active_version" json:"using_active_version"`IDuuid.UUID `db:"id" json:"id"`Namestring `db:"name" json:"name"`DesiredInstancessql.NullInt32 `db:"desired_instances" json:"desired_instances"`Ttlsql.NullInt32 `db:"ttl" json:"ttl"`PrebuildStatusPrebuildStatus `db:"prebuild_status" json:"prebuild_status"`Deletedbool `db:"deleted" json:"deleted"`Deprecatedbool `db:"deprecated" json:"deprecated"`}
typeGetTemplateUsageStatsParams¶added inv2.10.0
typeGetTemplateVersionsByTemplateIDParams¶
type GetTemplateVersionsByTemplateIDParams struct {TemplateIDuuid.UUID `db:"template_id" json:"template_id"`Archivedsql.NullBool `db:"archived" json:"archived"`AfterIDuuid.UUID `db:"after_id" json:"after_id"`OffsetOptint32 `db:"offset_opt" json:"offset_opt"`LimitOptint32 `db:"limit_opt" json:"limit_opt"`}
typeGetTemplatesWithFilterParams¶
type GetTemplatesWithFilterParams struct {Deletedbool `db:"deleted" json:"deleted"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`ExactNamestring `db:"exact_name" json:"exact_name"`FuzzyNamestring `db:"fuzzy_name" json:"fuzzy_name"`IDs []uuid.UUID `db:"ids" json:"ids"`Deprecatedsql.NullBool `db:"deprecated" json:"deprecated"`}
typeGetUserActivityInsightsParams¶added inv2.2.0
typeGetUserActivityInsightsRow¶added inv2.2.0
type GetUserActivityInsightsRow struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`Usernamestring `db:"username" json:"username"`AvatarURLstring `db:"avatar_url" json:"avatar_url"`TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`UsageSecondsint64 `db:"usage_seconds" json:"usage_seconds"`}
typeGetUserLatencyInsightsRow¶
type GetUserLatencyInsightsRow struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`Usernamestring `db:"username" json:"username"`AvatarURLstring `db:"avatar_url" json:"avatar_url"`TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`WorkspaceConnectionLatency50float64 `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"`WorkspaceConnectionLatency95float64 `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"`}
typeGetUserStatusCountsParams¶added inv2.19.0
typeGetUserStatusCountsRow¶added inv2.19.0
type GetUserStatusCountsRow struct {Datetime.Time `db:"date" json:"date"`StatusUserStatus `db:"status" json:"status"`Countint64 `db:"count" json:"count"`}
typeGetUserWorkspaceBuildParametersParams¶added inv2.8.0
typeGetUserWorkspaceBuildParametersRow¶added inv2.8.0
typeGetUsersParams¶
type GetUsersParams struct {AfterIDuuid.UUID `db:"after_id" json:"after_id"`Searchstring `db:"search" json:"search"`Status []UserStatus `db:"status" json:"status"`RbacRole []string `db:"rbac_role" json:"rbac_role"`LastSeenBeforetime.Time `db:"last_seen_before" json:"last_seen_before"`LastSeenAftertime.Time `db:"last_seen_after" json:"last_seen_after"`CreatedBeforetime.Time `db:"created_before" json:"created_before"`CreatedAftertime.Time `db:"created_after" json:"created_after"`IncludeSystembool `db:"include_system" json:"include_system"`GithubComUserIDint64 `db:"github_com_user_id" json:"github_com_user_id"`LoginType []LoginType `db:"login_type" json:"login_type"`OffsetOptint32 `db:"offset_opt" json:"offset_opt"`LimitOptint32 `db:"limit_opt" json:"limit_opt"`}
typeGetUsersRow¶
type GetUsersRow struct {IDuuid.UUID `db:"id" json:"id"`Emailstring `db:"email" json:"email"`Usernamestring `db:"username" json:"username"`HashedPassword []byte `db:"hashed_password" json:"hashed_password"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`StatusUserStatus `db:"status" json:"status"`RBACRolespq.StringArray `db:"rbac_roles" json:"rbac_roles"`LoginTypeLoginType `db:"login_type" json:"login_type"`AvatarURLstring `db:"avatar_url" json:"avatar_url"`Deletedbool `db:"deleted" json:"deleted"`LastSeenAttime.Time `db:"last_seen_at" json:"last_seen_at"`QuietHoursSchedulestring `db:"quiet_hours_schedule" json:"quiet_hours_schedule"`Namestring `db:"name" json:"name"`GithubComUserIDsql.NullInt64 `db:"github_com_user_id" json:"github_com_user_id"`HashedOneTimePasscode []byte `db:"hashed_one_time_passcode" json:"hashed_one_time_passcode"`OneTimePasscodeExpiresAtsql.NullTime `db:"one_time_passcode_expires_at" json:"one_time_passcode_expires_at"`IsSystembool `db:"is_system" json:"is_system"`Countint64 `db:"count" json:"count"`}
func (GetUsersRow)RBACObject¶
func (uGetUsersRow) RBACObject()rbac.Object
typeGetWebpushVAPIDKeysRow¶added inv2.21.0
typeGetWorkspaceAgentAndLatestBuildByAuthTokenRow¶added inv2.10.0
type GetWorkspaceAgentAndLatestBuildByAuthTokenRow struct {WorkspaceTableWorkspaceTable `db:"workspace_table" json:"workspace_table"`WorkspaceAgentWorkspaceAgent `db:"workspace_agent" json:"workspace_agent"`WorkspaceBuildWorkspaceBuild `db:"workspace_build" json:"workspace_build"`}
typeGetWorkspaceAgentLifecycleStateByIDRow¶
type GetWorkspaceAgentLifecycleStateByIDRow struct {LifecycleStateWorkspaceAgentLifecycleState `db:"lifecycle_state" json:"lifecycle_state"`StartedAtsql.NullTime `db:"started_at" json:"started_at"`ReadyAtsql.NullTime `db:"ready_at" json:"ready_at"`}
typeGetWorkspaceAgentMetadataParams¶added inv2.3.1
typeGetWorkspaceAgentPortShareParams¶added inv2.9.0
typeGetWorkspaceAgentScriptTimingsByBuildIDRow¶added inv2.17.0
type GetWorkspaceAgentScriptTimingsByBuildIDRow struct {ScriptIDuuid.UUID `db:"script_id" json:"script_id"`StartedAttime.Time `db:"started_at" json:"started_at"`EndedAttime.Time `db:"ended_at" json:"ended_at"`ExitCodeint32 `db:"exit_code" json:"exit_code"`StageWorkspaceAgentScriptTimingStage `db:"stage" json:"stage"`StatusWorkspaceAgentScriptTimingStatus `db:"status" json:"status"`DisplayNamestring `db:"display_name" json:"display_name"`WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`WorkspaceAgentNamestring `db:"workspace_agent_name" json:"workspace_agent_name"`}
typeGetWorkspaceAgentStatsAndLabelsRow¶
type GetWorkspaceAgentStatsAndLabelsRow struct {Usernamestring `db:"username" json:"username"`AgentNamestring `db:"agent_name" json:"agent_name"`WorkspaceNamestring `db:"workspace_name" json:"workspace_name"`RxBytesint64 `db:"rx_bytes" json:"rx_bytes"`TxBytesint64 `db:"tx_bytes" json:"tx_bytes"`SessionCountVSCodeint64 `db:"session_count_vscode" json:"session_count_vscode"`SessionCountSSHint64 `db:"session_count_ssh" json:"session_count_ssh"`SessionCountJetBrainsint64 `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`ConnectionCountint64 `db:"connection_count" json:"connection_count"`ConnectionMedianLatencyMSfloat64 `db:"connection_median_latency_ms" json:"connection_median_latency_ms"`}
typeGetWorkspaceAgentStatsRow¶
type GetWorkspaceAgentStatsRow struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`AggregatedFromtime.Time `db:"aggregated_from" json:"aggregated_from"`WorkspaceRxBytesint64 `db:"workspace_rx_bytes" json:"workspace_rx_bytes"`WorkspaceTxBytesint64 `db:"workspace_tx_bytes" json:"workspace_tx_bytes"`WorkspaceConnectionLatency50float64 `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"`WorkspaceConnectionLatency95float64 `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"`AgentID_2uuid.UUID `db:"agent_id_2" json:"agent_id_2"`SessionCountVSCodeint64 `db:"session_count_vscode" json:"session_count_vscode"`SessionCountSSHint64 `db:"session_count_ssh" json:"session_count_ssh"`SessionCountJetBrainsint64 `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`}
typeGetWorkspaceAgentUsageStatsAndLabelsRow¶added inv2.16.0
type GetWorkspaceAgentUsageStatsAndLabelsRow struct {Usernamestring `db:"username" json:"username"`AgentNamestring `db:"agent_name" json:"agent_name"`WorkspaceNamestring `db:"workspace_name" json:"workspace_name"`RxBytesint64 `db:"rx_bytes" json:"rx_bytes"`TxBytesint64 `db:"tx_bytes" json:"tx_bytes"`SessionCountVSCodeint64 `db:"session_count_vscode" json:"session_count_vscode"`SessionCountSSHint64 `db:"session_count_ssh" json:"session_count_ssh"`SessionCountJetBrainsint64 `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`ConnectionCountint64 `db:"connection_count" json:"connection_count"`ConnectionMedianLatencyMSfloat64 `db:"connection_median_latency_ms" json:"connection_median_latency_ms"`}
typeGetWorkspaceAgentUsageStatsRow¶added inv2.16.0
type GetWorkspaceAgentUsageStatsRow struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`AggregatedFromtime.Time `db:"aggregated_from" json:"aggregated_from"`WorkspaceRxBytesint64 `db:"workspace_rx_bytes" json:"workspace_rx_bytes"`WorkspaceTxBytesint64 `db:"workspace_tx_bytes" json:"workspace_tx_bytes"`WorkspaceConnectionLatency50float64 `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"`WorkspaceConnectionLatency95float64 `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"`AgentID_2uuid.UUID `db:"agent_id_2" json:"agent_id_2"`SessionCountVSCodeint64 `db:"session_count_vscode" json:"session_count_vscode"`SessionCountSSHint64 `db:"session_count_ssh" json:"session_count_ssh"`SessionCountJetBrainsint64 `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`}
typeGetWorkspaceAgentsByWorkspaceAndBuildNumberParams¶added inv2.22.0
typeGetWorkspaceBuildStatsByTemplatesRow¶added inv2.16.0
type GetWorkspaceBuildStatsByTemplatesRow struct {TemplateIDuuid.UUID `db:"template_id" json:"template_id"`TemplateNamestring `db:"template_name" json:"template_name"`TemplateDisplayNamestring `db:"template_display_name" json:"template_display_name"`TemplateOrganizationIDuuid.UUID `db:"template_organization_id" json:"template_organization_id"`TotalBuildsint64 `db:"total_builds" json:"total_builds"`FailedBuildsint64 `db:"failed_builds" json:"failed_builds"`}
typeGetWorkspaceUniqueOwnerCountByTemplateIDsRow¶added inv2.5.0
typeGetWorkspacesAndAgentsByOwnerIDRow¶added inv2.18.0
type GetWorkspacesAndAgentsByOwnerIDRow struct {IDuuid.UUID `db:"id" json:"id"`Namestring `db:"name" json:"name"`JobStatusProvisionerJobStatus `db:"job_status" json:"job_status"`TransitionWorkspaceTransition `db:"transition" json:"transition"`Agents []AgentIDNamePair `db:"agents" json:"agents"`}
typeGetWorkspacesEligibleForTransitionRow¶added inv2.18.0
typeGetWorkspacesParams¶
type GetWorkspacesParams struct {ParamNames []string `db:"param_names" json:"param_names"`ParamValues []string `db:"param_values" json:"param_values"`Deletedbool `db:"deleted" json:"deleted"`Statusstring `db:"status" json:"status"`OwnerIDuuid.UUID `db:"owner_id" json:"owner_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`HasParam []string `db:"has_param" json:"has_param"`OwnerUsernamestring `db:"owner_username" json:"owner_username"`TemplateNamestring `db:"template_name" json:"template_name"`TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`WorkspaceIds []uuid.UUID `db:"workspace_ids" json:"workspace_ids"`Namestring `db:"name" json:"name"`HasAgentstring `db:"has_agent" json:"has_agent"`AgentInactiveDisconnectTimeoutSecondsint64 `db:"agent_inactive_disconnect_timeout_seconds" json:"agent_inactive_disconnect_timeout_seconds"`Dormantbool `db:"dormant" json:"dormant"`LastUsedBeforetime.Time `db:"last_used_before" json:"last_used_before"`LastUsedAftertime.Time `db:"last_used_after" json:"last_used_after"`UsingActivesql.NullBool `db:"using_active" json:"using_active"`RequesterIDuuid.UUID `db:"requester_id" json:"requester_id"`Offsetint32 `db:"offset_" json:"offset_"`Limitint32 `db:"limit_" json:"limit_"`WithSummarybool `db:"with_summary" json:"with_summary"`}
typeGetWorkspacesRow¶
type GetWorkspacesRow struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`OwnerIDuuid.UUID `db:"owner_id" json:"owner_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`Deletedbool `db:"deleted" json:"deleted"`Namestring `db:"name" json:"name"`AutostartSchedulesql.NullString `db:"autostart_schedule" json:"autostart_schedule"`Ttlsql.NullInt64 `db:"ttl" json:"ttl"`LastUsedAttime.Time `db:"last_used_at" json:"last_used_at"`DormantAtsql.NullTime `db:"dormant_at" json:"dormant_at"`DeletingAtsql.NullTime `db:"deleting_at" json:"deleting_at"`AutomaticUpdatesAutomaticUpdates `db:"automatic_updates" json:"automatic_updates"`Favoritebool `db:"favorite" json:"favorite"`NextStartAtsql.NullTime `db:"next_start_at" json:"next_start_at"`OwnerAvatarUrlstring `db:"owner_avatar_url" json:"owner_avatar_url"`OwnerUsernamestring `db:"owner_username" json:"owner_username"`OwnerNamestring `db:"owner_name" json:"owner_name"`OrganizationNamestring `db:"organization_name" json:"organization_name"`OrganizationDisplayNamestring `db:"organization_display_name" json:"organization_display_name"`OrganizationIconstring `db:"organization_icon" json:"organization_icon"`OrganizationDescriptionstring `db:"organization_description" json:"organization_description"`TemplateNamestring `db:"template_name" json:"template_name"`TemplateDisplayNamestring `db:"template_display_name" json:"template_display_name"`TemplateIconstring `db:"template_icon" json:"template_icon"`TemplateDescriptionstring `db:"template_description" json:"template_description"`TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`TemplateVersionNamesql.NullString `db:"template_version_name" json:"template_version_name"`LatestBuildCompletedAtsql.NullTime `db:"latest_build_completed_at" json:"latest_build_completed_at"`LatestBuildCanceledAtsql.NullTime `db:"latest_build_canceled_at" json:"latest_build_canceled_at"`LatestBuildErrorsql.NullString `db:"latest_build_error" json:"latest_build_error"`LatestBuildTransitionWorkspaceTransition `db:"latest_build_transition" json:"latest_build_transition"`LatestBuildStatusProvisionerJobStatus `db:"latest_build_status" json:"latest_build_status"`Countint64 `db:"count" json:"count"`}
typeGitSSHKey¶
type GitSSHKey struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`PrivateKeystring `db:"private_key" json:"private_key"`PublicKeystring `db:"public_key" json:"public_key"`}
func (GitSSHKey)RBACObject¶
typeGroup¶
type Group struct {IDuuid.UUID `db:"id" json:"id"`Namestring `db:"name" json:"name"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`AvatarURLstring `db:"avatar_url" json:"avatar_url"`QuotaAllowanceint32 `db:"quota_allowance" json:"quota_allowance"`// Display name is a custom, human-friendly group name that user can set. This is not required to be unique and can be the empty string.DisplayNamestring `db:"display_name" json:"display_name"`// Source indicates how the group was created. It can be created by a user manually, or through some system process like OIDC group sync.SourceGroupSource `db:"source" json:"source"`}
func (Group)Auditable¶
func (gGroup) Auditable(members []GroupMember)AuditableGroup
Auditable returns an object that can be used in audit logs.Covers both group and group member changes.
func (Group)IsEveryone¶
func (Group)RBACObject¶
typeGroupMember¶
type GroupMember struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`UserEmailstring `db:"user_email" json:"user_email"`UserUsernamestring `db:"user_username" json:"user_username"`UserHashedPassword []byte `db:"user_hashed_password" json:"user_hashed_password"`UserCreatedAttime.Time `db:"user_created_at" json:"user_created_at"`UserUpdatedAttime.Time `db:"user_updated_at" json:"user_updated_at"`UserStatusUserStatus `db:"user_status" json:"user_status"`UserRbacRoles []string `db:"user_rbac_roles" json:"user_rbac_roles"`UserLoginTypeLoginType `db:"user_login_type" json:"user_login_type"`UserAvatarUrlstring `db:"user_avatar_url" json:"user_avatar_url"`UserDeletedbool `db:"user_deleted" json:"user_deleted"`UserLastSeenAttime.Time `db:"user_last_seen_at" json:"user_last_seen_at"`UserQuietHoursSchedulestring `db:"user_quiet_hours_schedule" json:"user_quiet_hours_schedule"`UserNamestring `db:"user_name" json:"user_name"`UserGithubComUserIDsql.NullInt64 `db:"user_github_com_user_id" json:"user_github_com_user_id"`UserIsSystembool `db:"user_is_system" json:"user_is_system"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`GroupNamestring `db:"group_name" json:"group_name"`GroupIDuuid.UUID `db:"group_id" json:"group_id"`}
Joins group members with user information, organization ID, group name. Includes both regular group members and organization members (as part of the "Everyone" group).
func (GroupMember)RBACObject¶added inv2.15.0
func (gmGroupMember) RBACObject()rbac.Object
typeGroupMemberTable¶added inv2.15.0
typeGroupSource¶
type GroupSourcestring
const (GroupSourceUserGroupSource = "user"GroupSourceOidcGroupSource = "oidc")
funcAllGroupSourceValues¶
func AllGroupSourceValues() []GroupSource
func (*GroupSource)Scan¶
func (e *GroupSource) Scan(src interface{})error
func (GroupSource)Valid¶
func (eGroupSource) Valid()bool
typeHealthSettings¶added inv2.5.0
typeInboxNotification¶added inv2.21.0
type InboxNotification struct {IDuuid.UUID `db:"id" json:"id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`Targets []uuid.UUID `db:"targets" json:"targets"`Titlestring `db:"title" json:"title"`Contentstring `db:"content" json:"content"`Iconstring `db:"icon" json:"icon"`Actionsjson.RawMessage `db:"actions" json:"actions"`ReadAtsql.NullTime `db:"read_at" json:"read_at"`CreatedAttime.Time `db:"created_at" json:"created_at"`}
func (InboxNotification)RBACObject¶added inv2.21.0
func (iInboxNotification) RBACObject()rbac.Object
typeInboxNotificationReadStatus¶added inv2.21.0
type InboxNotificationReadStatusstring
const (InboxNotificationReadStatusAllInboxNotificationReadStatus = "all"InboxNotificationReadStatusUnreadInboxNotificationReadStatus = "unread"InboxNotificationReadStatusReadInboxNotificationReadStatus = "read")
funcAllInboxNotificationReadStatusValues¶added inv2.21.0
func AllInboxNotificationReadStatusValues() []InboxNotificationReadStatus
func (*InboxNotificationReadStatus)Scan¶added inv2.21.0
func (e *InboxNotificationReadStatus) Scan(src interface{})error
func (InboxNotificationReadStatus)Valid¶added inv2.21.0
func (eInboxNotificationReadStatus) Valid()bool
typeInsertAPIKeyParams¶
type InsertAPIKeyParams struct {IDstring `db:"id" json:"id"`LifetimeSecondsint64 `db:"lifetime_seconds" json:"lifetime_seconds"`HashedSecret []byte `db:"hashed_secret" json:"hashed_secret"`IPAddresspqtype.Inet `db:"ip_address" json:"ip_address"`UserIDuuid.UUID `db:"user_id" json:"user_id"`LastUsedtime.Time `db:"last_used" json:"last_used"`ExpiresAttime.Time `db:"expires_at" json:"expires_at"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`LoginTypeLoginType `db:"login_type" json:"login_type"`ScopeAPIKeyScope `db:"scope" json:"scope"`TokenNamestring `db:"token_name" json:"token_name"`}
typeInsertAuditLogParams¶
type InsertAuditLogParams struct {IDuuid.UUID `db:"id" json:"id"`Timetime.Time `db:"time" json:"time"`UserIDuuid.UUID `db:"user_id" json:"user_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`Ippqtype.Inet `db:"ip" json:"ip"`UserAgentsql.NullString `db:"user_agent" json:"user_agent"`ResourceTypeResourceType `db:"resource_type" json:"resource_type"`ResourceIDuuid.UUID `db:"resource_id" json:"resource_id"`ResourceTargetstring `db:"resource_target" json:"resource_target"`ActionAuditAction `db:"action" json:"action"`Diffjson.RawMessage `db:"diff" json:"diff"`StatusCodeint32 `db:"status_code" json:"status_code"`AdditionalFieldsjson.RawMessage `db:"additional_fields" json:"additional_fields"`RequestIDuuid.UUID `db:"request_id" json:"request_id"`ResourceIconstring `db:"resource_icon" json:"resource_icon"`}
typeInsertChatMessagesParams¶added inv2.23.0
typeInsertChatParams¶added inv2.23.0
typeInsertCryptoKeyParams¶added inv2.16.0
type InsertCryptoKeyParams struct {FeatureCryptoKeyFeature `db:"feature" json:"feature"`Sequenceint32 `db:"sequence" json:"sequence"`Secretsql.NullString `db:"secret" json:"secret"`StartsAttime.Time `db:"starts_at" json:"starts_at"`SecretKeyIDsql.NullString `db:"secret_key_id" json:"secret_key_id"`}
typeInsertCustomRoleParams¶added inv2.15.0
type InsertCustomRoleParams struct {Namestring `db:"name" json:"name"`DisplayNamestring `db:"display_name" json:"display_name"`OrganizationIDuuid.NullUUID `db:"organization_id" json:"organization_id"`SitePermissionsCustomRolePermissions `db:"site_permissions" json:"site_permissions"`OrgPermissionsCustomRolePermissions `db:"org_permissions" json:"org_permissions"`UserPermissionsCustomRolePermissions `db:"user_permissions" json:"user_permissions"`}
typeInsertDBCryptKeyParams¶added inv2.2.0
typeInsertExternalAuthLinkParams¶added inv2.2.1
type InsertExternalAuthLinkParams struct {ProviderIDstring `db:"provider_id" json:"provider_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`OAuthAccessTokenstring `db:"oauth_access_token" json:"oauth_access_token"`OAuthAccessTokenKeyIDsql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"`OAuthRefreshTokenstring `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthRefreshTokenKeyIDsql.NullString `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"`OAuthExpirytime.Time `db:"oauth_expiry" json:"oauth_expiry"`OAuthExtrapqtype.NullRawMessage `db:"oauth_extra" json:"oauth_extra"`}
typeInsertGroupParams¶
type InsertGroupParams struct {IDuuid.UUID `db:"id" json:"id"`Namestring `db:"name" json:"name"`DisplayNamestring `db:"display_name" json:"display_name"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`AvatarURLstring `db:"avatar_url" json:"avatar_url"`QuotaAllowanceint32 `db:"quota_allowance" json:"quota_allowance"`}
typeInsertInboxNotificationParams¶added inv2.21.0
type InsertInboxNotificationParams struct {IDuuid.UUID `db:"id" json:"id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`Targets []uuid.UUID `db:"targets" json:"targets"`Titlestring `db:"title" json:"title"`Contentstring `db:"content" json:"content"`Iconstring `db:"icon" json:"icon"`Actionsjson.RawMessage `db:"actions" json:"actions"`CreatedAttime.Time `db:"created_at" json:"created_at"`}
typeInsertMemoryResourceMonitorParams¶added inv2.20.0
type InsertMemoryResourceMonitorParams struct {AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`Enabledbool `db:"enabled" json:"enabled"`StateWorkspaceAgentMonitorState `db:"state" json:"state"`Thresholdint32 `db:"threshold" json:"threshold"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`DebouncedUntiltime.Time `db:"debounced_until" json:"debounced_until"`}
typeInsertMissingGroupsParams¶
type InsertMissingGroupsParams struct {OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`SourceGroupSource `db:"source" json:"source"`GroupNames []string `db:"group_names" json:"group_names"`}
typeInsertOAuth2ProviderAppCodeParams¶added inv2.9.0
type InsertOAuth2ProviderAppCodeParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`ExpiresAttime.Time `db:"expires_at" json:"expires_at"`SecretPrefix []byte `db:"secret_prefix" json:"secret_prefix"`HashedSecret []byte `db:"hashed_secret" json:"hashed_secret"`AppIDuuid.UUID `db:"app_id" json:"app_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}
typeInsertOAuth2ProviderAppParams¶added inv2.6.0
type InsertOAuth2ProviderAppParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Namestring `db:"name" json:"name"`Iconstring `db:"icon" json:"icon"`CallbackURLstring `db:"callback_url" json:"callback_url"`}
typeInsertOAuth2ProviderAppSecretParams¶added inv2.6.0
type InsertOAuth2ProviderAppSecretParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`SecretPrefix []byte `db:"secret_prefix" json:"secret_prefix"`HashedSecret []byte `db:"hashed_secret" json:"hashed_secret"`DisplaySecretstring `db:"display_secret" json:"display_secret"`AppIDuuid.UUID `db:"app_id" json:"app_id"`}
typeInsertOAuth2ProviderAppTokenParams¶added inv2.9.0
type InsertOAuth2ProviderAppTokenParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`ExpiresAttime.Time `db:"expires_at" json:"expires_at"`HashPrefix []byte `db:"hash_prefix" json:"hash_prefix"`RefreshHash []byte `db:"refresh_hash" json:"refresh_hash"`AppSecretIDuuid.UUID `db:"app_secret_id" json:"app_secret_id"`APIKeyIDstring `db:"api_key_id" json:"api_key_id"`}
typeInsertOrganizationMemberParams¶
type InsertOrganizationMemberParams struct {OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Roles []string `db:"roles" json:"roles"`}
typeInsertOrganizationParams¶
type InsertOrganizationParams struct {IDuuid.UUID `db:"id" json:"id"`Namestring `db:"name" json:"name"`DisplayNamestring `db:"display_name" json:"display_name"`Descriptionstring `db:"description" json:"description"`Iconstring `db:"icon" json:"icon"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}
typeInsertPresetParametersParams¶added inv2.20.0
typeInsertPresetParams¶added inv2.20.0
type InsertPresetParams struct {IDuuid.UUID `db:"id" json:"id"`TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`Namestring `db:"name" json:"name"`CreatedAttime.Time `db:"created_at" json:"created_at"`DesiredInstancessql.NullInt32 `db:"desired_instances" json:"desired_instances"`InvalidateAfterSecssql.NullInt32 `db:"invalidate_after_secs" json:"invalidate_after_secs"`}
typeInsertProvisionerJobLogsParams¶
type InsertProvisionerJobLogsParams struct {JobIDuuid.UUID `db:"job_id" json:"job_id"`CreatedAt []time.Time `db:"created_at" json:"created_at"`Source []LogSource `db:"source" json:"source"`Level []LogLevel `db:"level" json:"level"`Stage []string `db:"stage" json:"stage"`Output []string `db:"output" json:"output"`}
typeInsertProvisionerJobParams¶
type InsertProvisionerJobParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`InitiatorIDuuid.UUID `db:"initiator_id" json:"initiator_id"`ProvisionerProvisionerType `db:"provisioner" json:"provisioner"`StorageMethodProvisionerStorageMethod `db:"storage_method" json:"storage_method"`FileIDuuid.UUID `db:"file_id" json:"file_id"`TypeProvisionerJobType `db:"type" json:"type"`Inputjson.RawMessage `db:"input" json:"input"`TagsStringMap `db:"tags" json:"tags"`TraceMetadatapqtype.NullRawMessage `db:"trace_metadata" json:"trace_metadata"`}
typeInsertProvisionerJobTimingsParams¶added inv2.15.0
type InsertProvisionerJobTimingsParams struct {JobIDuuid.UUID `db:"job_id" json:"job_id"`StartedAt []time.Time `db:"started_at" json:"started_at"`EndedAt []time.Time `db:"ended_at" json:"ended_at"`Stage []ProvisionerJobTimingStage `db:"stage" json:"stage"`Source []string `db:"source" json:"source"`Action []string `db:"action" json:"action"`Resource []string `db:"resource" json:"resource"`}
typeInsertProvisionerKeyParams¶added inv2.14.0
type InsertProvisionerKeyParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`HashedSecret []byte `db:"hashed_secret" json:"hashed_secret"`TagsStringMap `db:"tags" json:"tags"`Namestring `db:"name" json:"name"`}
typeInsertReplicaParams¶
type InsertReplicaParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`StartedAttime.Time `db:"started_at" json:"started_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Hostnamestring `db:"hostname" json:"hostname"`RegionIDint32 `db:"region_id" json:"region_id"`RelayAddressstring `db:"relay_address" json:"relay_address"`Versionstring `db:"version" json:"version"`DatabaseLatencyint32 `db:"database_latency" json:"database_latency"`Primarybool `db:"primary" json:"primary"`}
typeInsertTelemetryItemIfNotExistsParams¶added inv2.19.0
typeInsertTemplateParams¶
type InsertTemplateParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`Namestring `db:"name" json:"name"`ProvisionerProvisionerType `db:"provisioner" json:"provisioner"`ActiveVersionIDuuid.UUID `db:"active_version_id" json:"active_version_id"`Descriptionstring `db:"description" json:"description"`CreatedByuuid.UUID `db:"created_by" json:"created_by"`Iconstring `db:"icon" json:"icon"`UserACLTemplateACL `db:"user_acl" json:"user_acl"`GroupACLTemplateACL `db:"group_acl" json:"group_acl"`DisplayNamestring `db:"display_name" json:"display_name"`AllowUserCancelWorkspaceJobsbool `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"`MaxPortSharingLevelAppSharingLevel `db:"max_port_sharing_level" json:"max_port_sharing_level"`}
typeInsertTemplateVersionParameterParams¶
type InsertTemplateVersionParameterParams struct {TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`Namestring `db:"name" json:"name"`Descriptionstring `db:"description" json:"description"`Typestring `db:"type" json:"type"`Mutablebool `db:"mutable" json:"mutable"`DefaultValuestring `db:"default_value" json:"default_value"`Iconstring `db:"icon" json:"icon"`Optionsjson.RawMessage `db:"options" json:"options"`ValidationRegexstring `db:"validation_regex" json:"validation_regex"`ValidationMinsql.NullInt32 `db:"validation_min" json:"validation_min"`ValidationMaxsql.NullInt32 `db:"validation_max" json:"validation_max"`ValidationErrorstring `db:"validation_error" json:"validation_error"`ValidationMonotonicstring `db:"validation_monotonic" json:"validation_monotonic"`Requiredbool `db:"required" json:"required"`DisplayNamestring `db:"display_name" json:"display_name"`DisplayOrderint32 `db:"display_order" json:"display_order"`Ephemeralbool `db:"ephemeral" json:"ephemeral"`}
typeInsertTemplateVersionParams¶
type InsertTemplateVersionParams struct {IDuuid.UUID `db:"id" json:"id"`TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Namestring `db:"name" json:"name"`Messagestring `db:"message" json:"message"`Readmestring `db:"readme" json:"readme"`JobIDuuid.UUID `db:"job_id" json:"job_id"`CreatedByuuid.UUID `db:"created_by" json:"created_by"`SourceExampleIDsql.NullString `db:"source_example_id" json:"source_example_id"`}
typeInsertTemplateVersionTerraformValuesByJobIDParams¶added inv2.21.0
type InsertTemplateVersionTerraformValuesByJobIDParams struct {JobIDuuid.UUID `db:"job_id" json:"job_id"`CachedPlanjson.RawMessage `db:"cached_plan" json:"cached_plan"`CachedModuleFilesuuid.NullUUID `db:"cached_module_files" json:"cached_module_files"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`ProvisionerdVersionstring `db:"provisionerd_version" json:"provisionerd_version"`}
typeInsertTemplateVersionVariableParams¶
type InsertTemplateVersionVariableParams struct {TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`Namestring `db:"name" json:"name"`Descriptionstring `db:"description" json:"description"`Typestring `db:"type" json:"type"`Valuestring `db:"value" json:"value"`DefaultValuestring `db:"default_value" json:"default_value"`Requiredbool `db:"required" json:"required"`Sensitivebool `db:"sensitive" json:"sensitive"`}
typeInsertTemplateVersionWorkspaceTagParams¶added inv2.12.0
typeInsertUserGroupsByIDParams¶added inv2.16.0
typeInsertUserLinkParams¶
type InsertUserLinkParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`LoginTypeLoginType `db:"login_type" json:"login_type"`LinkedIDstring `db:"linked_id" json:"linked_id"`OAuthAccessTokenstring `db:"oauth_access_token" json:"oauth_access_token"`OAuthAccessTokenKeyIDsql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"`OAuthRefreshTokenstring `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthRefreshTokenKeyIDsql.NullString `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"`OAuthExpirytime.Time `db:"oauth_expiry" json:"oauth_expiry"`ClaimsUserLinkClaims `db:"claims" json:"claims"`}
typeInsertUserParams¶
type InsertUserParams struct {IDuuid.UUID `db:"id" json:"id"`Emailstring `db:"email" json:"email"`Usernamestring `db:"username" json:"username"`Namestring `db:"name" json:"name"`HashedPassword []byte `db:"hashed_password" json:"hashed_password"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`RBACRolespq.StringArray `db:"rbac_roles" json:"rbac_roles"`LoginTypeLoginType `db:"login_type" json:"login_type"`Statusstring `db:"status" json:"status"`}
typeInsertVolumeResourceMonitorParams¶added inv2.20.0
type InsertVolumeResourceMonitorParams struct {AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`Pathstring `db:"path" json:"path"`Enabledbool `db:"enabled" json:"enabled"`StateWorkspaceAgentMonitorState `db:"state" json:"state"`Thresholdint32 `db:"threshold" json:"threshold"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`DebouncedUntiltime.Time `db:"debounced_until" json:"debounced_until"`}
typeInsertWebpushSubscriptionParams¶added inv2.21.0
type InsertWebpushSubscriptionParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`Endpointstring `db:"endpoint" json:"endpoint"`EndpointP256dhKeystring `db:"endpoint_p256dh_key" json:"endpoint_p256dh_key"`EndpointAuthKeystring `db:"endpoint_auth_key" json:"endpoint_auth_key"`}
typeInsertWorkspaceAgentDevcontainersParams¶added inv2.21.0
type InsertWorkspaceAgentDevcontainersParams struct {WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`ID []uuid.UUID `db:"id" json:"id"`Name []string `db:"name" json:"name"`WorkspaceFolder []string `db:"workspace_folder" json:"workspace_folder"`ConfigPath []string `db:"config_path" json:"config_path"`}
typeInsertWorkspaceAgentLogSourcesParams¶added inv2.2.0
type InsertWorkspaceAgentLogSourcesParams struct {WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`ID []uuid.UUID `db:"id" json:"id"`DisplayName []string `db:"display_name" json:"display_name"`Icon []string `db:"icon" json:"icon"`}
typeInsertWorkspaceAgentLogsParams¶
type InsertWorkspaceAgentLogsParams struct {AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`Output []string `db:"output" json:"output"`Level []LogLevel `db:"level" json:"level"`LogSourceIDuuid.UUID `db:"log_source_id" json:"log_source_id"`OutputLengthint32 `db:"output_length" json:"output_length"`}
typeInsertWorkspaceAgentMetadataParams¶
type InsertWorkspaceAgentMetadataParams struct {WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`DisplayNamestring `db:"display_name" json:"display_name"`Keystring `db:"key" json:"key"`Scriptstring `db:"script" json:"script"`Timeoutint64 `db:"timeout" json:"timeout"`Intervalint64 `db:"interval" json:"interval"`DisplayOrderint32 `db:"display_order" json:"display_order"`}
typeInsertWorkspaceAgentParams¶
type InsertWorkspaceAgentParams struct {IDuuid.UUID `db:"id" json:"id"`ParentIDuuid.NullUUID `db:"parent_id" json:"parent_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Namestring `db:"name" json:"name"`ResourceIDuuid.UUID `db:"resource_id" json:"resource_id"`AuthTokenuuid.UUID `db:"auth_token" json:"auth_token"`AuthInstanceIDsql.NullString `db:"auth_instance_id" json:"auth_instance_id"`Architecturestring `db:"architecture" json:"architecture"`EnvironmentVariablespqtype.NullRawMessage `db:"environment_variables" json:"environment_variables"`OperatingSystemstring `db:"operating_system" json:"operating_system"`Directorystring `db:"directory" json:"directory"`InstanceMetadatapqtype.NullRawMessage `db:"instance_metadata" json:"instance_metadata"`ResourceMetadatapqtype.NullRawMessage `db:"resource_metadata" json:"resource_metadata"`ConnectionTimeoutSecondsint32 `db:"connection_timeout_seconds" json:"connection_timeout_seconds"`TroubleshootingURLstring `db:"troubleshooting_url" json:"troubleshooting_url"`MOTDFilestring `db:"motd_file" json:"motd_file"`DisplayApps []DisplayApp `db:"display_apps" json:"display_apps"`DisplayOrderint32 `db:"display_order" json:"display_order"`APIKeyScopeAgentKeyScopeEnum `db:"api_key_scope" json:"api_key_scope"`}
typeInsertWorkspaceAgentScriptTimingsParams¶added inv2.16.0
type InsertWorkspaceAgentScriptTimingsParams struct {ScriptIDuuid.UUID `db:"script_id" json:"script_id"`StartedAttime.Time `db:"started_at" json:"started_at"`EndedAttime.Time `db:"ended_at" json:"ended_at"`ExitCodeint32 `db:"exit_code" json:"exit_code"`StageWorkspaceAgentScriptTimingStage `db:"stage" json:"stage"`StatusWorkspaceAgentScriptTimingStatus `db:"status" json:"status"`}
typeInsertWorkspaceAgentScriptsParams¶added inv2.2.0
type InsertWorkspaceAgentScriptsParams struct {WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`LogSourceID []uuid.UUID `db:"log_source_id" json:"log_source_id"`LogPath []string `db:"log_path" json:"log_path"`Script []string `db:"script" json:"script"`Cron []string `db:"cron" json:"cron"`StartBlocksLogin []bool `db:"start_blocks_login" json:"start_blocks_login"`RunOnStart []bool `db:"run_on_start" json:"run_on_start"`RunOnStop []bool `db:"run_on_stop" json:"run_on_stop"`TimeoutSeconds []int32 `db:"timeout_seconds" json:"timeout_seconds"`DisplayName []string `db:"display_name" json:"display_name"`ID []uuid.UUID `db:"id" json:"id"`}
typeInsertWorkspaceAgentStatsParams¶
type InsertWorkspaceAgentStatsParams struct {ID []uuid.UUID `db:"id" json:"id"`CreatedAt []time.Time `db:"created_at" json:"created_at"`UserID []uuid.UUID `db:"user_id" json:"user_id"`WorkspaceID []uuid.UUID `db:"workspace_id" json:"workspace_id"`TemplateID []uuid.UUID `db:"template_id" json:"template_id"`AgentID []uuid.UUID `db:"agent_id" json:"agent_id"`ConnectionsByProtojson.RawMessage `db:"connections_by_proto" json:"connections_by_proto"`ConnectionCount []int64 `db:"connection_count" json:"connection_count"`RxPackets []int64 `db:"rx_packets" json:"rx_packets"`RxBytes []int64 `db:"rx_bytes" json:"rx_bytes"`TxPackets []int64 `db:"tx_packets" json:"tx_packets"`TxBytes []int64 `db:"tx_bytes" json:"tx_bytes"`SessionCountVSCode []int64 `db:"session_count_vscode" json:"session_count_vscode"`SessionCountJetBrains []int64 `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTY []int64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`SessionCountSSH []int64 `db:"session_count_ssh" json:"session_count_ssh"`ConnectionMedianLatencyMS []float64 `db:"connection_median_latency_ms" json:"connection_median_latency_ms"`Usage []bool `db:"usage" json:"usage"`}
typeInsertWorkspaceAppParams¶
type InsertWorkspaceAppParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`Slugstring `db:"slug" json:"slug"`DisplayNamestring `db:"display_name" json:"display_name"`Iconstring `db:"icon" json:"icon"`Commandsql.NullString `db:"command" json:"command"`Urlsql.NullString `db:"url" json:"url"`Externalbool `db:"external" json:"external"`Subdomainbool `db:"subdomain" json:"subdomain"`SharingLevelAppSharingLevel `db:"sharing_level" json:"sharing_level"`HealthcheckUrlstring `db:"healthcheck_url" json:"healthcheck_url"`HealthcheckIntervalint32 `db:"healthcheck_interval" json:"healthcheck_interval"`HealthcheckThresholdint32 `db:"healthcheck_threshold" json:"healthcheck_threshold"`HealthWorkspaceAppHealth `db:"health" json:"health"`DisplayOrderint32 `db:"display_order" json:"display_order"`Hiddenbool `db:"hidden" json:"hidden"`OpenInWorkspaceAppOpenIn `db:"open_in" json:"open_in"`DisplayGroupsql.NullString `db:"display_group" json:"display_group"`}
typeInsertWorkspaceAppStatsParams¶
type InsertWorkspaceAppStatsParams struct {UserID []uuid.UUID `db:"user_id" json:"user_id"`WorkspaceID []uuid.UUID `db:"workspace_id" json:"workspace_id"`AgentID []uuid.UUID `db:"agent_id" json:"agent_id"`AccessMethod []string `db:"access_method" json:"access_method"`SlugOrPort []string `db:"slug_or_port" json:"slug_or_port"`SessionID []uuid.UUID `db:"session_id" json:"session_id"`SessionStartedAt []time.Time `db:"session_started_at" json:"session_started_at"`SessionEndedAt []time.Time `db:"session_ended_at" json:"session_ended_at"`Requests []int32 `db:"requests" json:"requests"`}
typeInsertWorkspaceAppStatusParams¶added inv2.21.0
type InsertWorkspaceAppStatusParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`AppIDuuid.UUID `db:"app_id" json:"app_id"`StateWorkspaceAppStatusState `db:"state" json:"state"`Messagestring `db:"message" json:"message"`Urisql.NullString `db:"uri" json:"uri"`}
typeInsertWorkspaceBuildParams¶
type InsertWorkspaceBuildParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`BuildNumberint32 `db:"build_number" json:"build_number"`TransitionWorkspaceTransition `db:"transition" json:"transition"`InitiatorIDuuid.UUID `db:"initiator_id" json:"initiator_id"`JobIDuuid.UUID `db:"job_id" json:"job_id"`ProvisionerState []byte `db:"provisioner_state" json:"provisioner_state"`Deadlinetime.Time `db:"deadline" json:"deadline"`MaxDeadlinetime.Time `db:"max_deadline" json:"max_deadline"`ReasonBuildReason `db:"reason" json:"reason"`TemplateVersionPresetIDuuid.NullUUID `db:"template_version_preset_id" json:"template_version_preset_id"`}
typeInsertWorkspaceModuleParams¶added inv2.18.0
type InsertWorkspaceModuleParams struct {IDuuid.UUID `db:"id" json:"id"`JobIDuuid.UUID `db:"job_id" json:"job_id"`TransitionWorkspaceTransition `db:"transition" json:"transition"`Sourcestring `db:"source" json:"source"`Versionstring `db:"version" json:"version"`Keystring `db:"key" json:"key"`CreatedAttime.Time `db:"created_at" json:"created_at"`}
typeInsertWorkspaceParams¶
type InsertWorkspaceParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`OwnerIDuuid.UUID `db:"owner_id" json:"owner_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`Namestring `db:"name" json:"name"`AutostartSchedulesql.NullString `db:"autostart_schedule" json:"autostart_schedule"`Ttlsql.NullInt64 `db:"ttl" json:"ttl"`LastUsedAttime.Time `db:"last_used_at" json:"last_used_at"`AutomaticUpdatesAutomaticUpdates `db:"automatic_updates" json:"automatic_updates"`NextStartAtsql.NullTime `db:"next_start_at" json:"next_start_at"`}
typeInsertWorkspaceProxyParams¶
type InsertWorkspaceProxyParams struct {IDuuid.UUID `db:"id" json:"id"`Namestring `db:"name" json:"name"`DisplayNamestring `db:"display_name" json:"display_name"`Iconstring `db:"icon" json:"icon"`DerpEnabledbool `db:"derp_enabled" json:"derp_enabled"`DerpOnlybool `db:"derp_only" json:"derp_only"`TokenHashedSecret []byte `db:"token_hashed_secret" json:"token_hashed_secret"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}
typeInsertWorkspaceResourceParams¶
type InsertWorkspaceResourceParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`JobIDuuid.UUID `db:"job_id" json:"job_id"`TransitionWorkspaceTransition `db:"transition" json:"transition"`Typestring `db:"type" json:"type"`Namestring `db:"name" json:"name"`Hidebool `db:"hide" json:"hide"`Iconstring `db:"icon" json:"icon"`InstanceTypesql.NullString `db:"instance_type" json:"instance_type"`DailyCostint32 `db:"daily_cost" json:"daily_cost"`ModulePathsql.NullString `db:"module_path" json:"module_path"`}
typeJfrogXrayScan¶added inv2.8.0
type JfrogXrayScan struct {AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`Criticalint32 `db:"critical" json:"critical"`Highint32 `db:"high" json:"high"`Mediumint32 `db:"medium" json:"medium"`ResultsUrlstring `db:"results_url" json:"results_url"`}
typeLicense¶
type License struct {IDint32 `db:"id" json:"id"`UploadedAttime.Time `db:"uploaded_at" json:"uploaded_at"`JWTstring `db:"jwt" json:"jwt"`// exp tracks the claim of the same name in the JWT, and we include it here so that we can easily query for licenses that have not yet expired.Exptime.Time `db:"exp" json:"exp"`UUIDuuid.UUID `db:"uuid" json:"uuid"`}
func (License)RBACObject¶
typeLoginType¶
type LoginTypestring
Specifies the method of authentication. "none" is a special case in which no authentication method is allowed.
funcAllLoginTypeValues¶
func AllLoginTypeValues() []LoginType
typeMarkAllInboxNotificationsAsReadParams¶added inv2.21.0
typeNameOrganizationPair¶added inv2.13.0
type NameOrganizationPair struct {Namestring `db:"name" json:"name"`// OrganizationID if unset will assume a null column valueOrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`}
NameOrganizationPair is used as a lookup tuple for custom role rows.
func (*NameOrganizationPair)Scan¶added inv2.13.0
func (*NameOrganizationPair) Scan(_ interface{})error
func (NameOrganizationPair)Value¶added inv2.13.0
func (aNameOrganizationPair) Value() (driver.Value,error)
Value returns the tuple **literal**To get the literal value to return, you can use the expression syntax in a psqlshell.
SELECT ('customrole'::text,'ece79dac-926e-44ca-9790-2ff7c5eb6e0c'::uuid);To see 'null' option. Using the nil uuid as null to avoid empty string literals for null.SELECT ('customrole',00000000-0000-0000-0000-000000000000);
This value is usually used as an array, NameOrganizationPair[]. You can seewhat that literal is as well, with proper quoting.
SELECT ARRAY[('customrole'::text,'ece79dac-926e-44ca-9790-2ff7c5eb6e0c'::uuid)];
typeNotificationMessage¶added inv2.13.0
type NotificationMessage struct {IDuuid.UUID `db:"id" json:"id"`NotificationTemplateIDuuid.UUID `db:"notification_template_id" json:"notification_template_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`MethodNotificationMethod `db:"method" json:"method"`StatusNotificationMessageStatus `db:"status" json:"status"`StatusReasonsql.NullString `db:"status_reason" json:"status_reason"`CreatedBystring `db:"created_by" json:"created_by"`Payload []byte `db:"payload" json:"payload"`AttemptCountsql.NullInt32 `db:"attempt_count" json:"attempt_count"`Targets []uuid.UUID `db:"targets" json:"targets"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAtsql.NullTime `db:"updated_at" json:"updated_at"`LeasedUntilsql.NullTime `db:"leased_until" json:"leased_until"`NextRetryAftersql.NullTime `db:"next_retry_after" json:"next_retry_after"`QueuedSecondssql.NullFloat64 `db:"queued_seconds" json:"queued_seconds"`// Auto-generated by insert/update trigger, used to prevent duplicate notifications from being enqueued on the same dayDedupeHashsql.NullString `db:"dedupe_hash" json:"dedupe_hash"`}
typeNotificationMessageStatus¶added inv2.13.0
type NotificationMessageStatusstring
const (NotificationMessageStatusPendingNotificationMessageStatus = "pending"NotificationMessageStatusLeasedNotificationMessageStatus = "leased"NotificationMessageStatusSentNotificationMessageStatus = "sent"NotificationMessageStatusPermanentFailureNotificationMessageStatus = "permanent_failure"NotificationMessageStatusTemporaryFailureNotificationMessageStatus = "temporary_failure"NotificationMessageStatusUnknownNotificationMessageStatus = "unknown"NotificationMessageStatusInhibitedNotificationMessageStatus = "inhibited")
funcAllNotificationMessageStatusValues¶added inv2.13.0
func AllNotificationMessageStatusValues() []NotificationMessageStatus
func (*NotificationMessageStatus)Scan¶added inv2.13.0
func (e *NotificationMessageStatus) Scan(src interface{})error
func (NotificationMessageStatus)Valid¶added inv2.13.0
func (eNotificationMessageStatus) Valid()bool
typeNotificationMethod¶added inv2.13.0
type NotificationMethodstring
const (NotificationMethodSmtpNotificationMethod = "smtp"NotificationMethodWebhookNotificationMethod = "webhook"NotificationMethodInboxNotificationMethod = "inbox")
funcAllNotificationMethodValues¶added inv2.13.0
func AllNotificationMethodValues() []NotificationMethod
func (*NotificationMethod)Scan¶added inv2.13.0
func (e *NotificationMethod) Scan(src interface{})error
func (NotificationMethod)Valid¶added inv2.13.0
func (eNotificationMethod) Valid()bool
typeNotificationPreference¶added inv2.15.0
type NotificationPreference struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`NotificationTemplateIDuuid.UUID `db:"notification_template_id" json:"notification_template_id"`Disabledbool `db:"disabled" json:"disabled"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}
typeNotificationReportGeneratorLog¶added inv2.16.0
type NotificationReportGeneratorLog struct {NotificationTemplateIDuuid.UUID `db:"notification_template_id" json:"notification_template_id"`LastGeneratedAttime.Time `db:"last_generated_at" json:"last_generated_at"`}
Log of generated reports for users.
typeNotificationTemplate¶added inv2.13.0
type NotificationTemplate struct {IDuuid.UUID `db:"id" json:"id"`Namestring `db:"name" json:"name"`TitleTemplatestring `db:"title_template" json:"title_template"`BodyTemplatestring `db:"body_template" json:"body_template"`Actions []byte `db:"actions" json:"actions"`Groupsql.NullString `db:"group" json:"group"`// NULL defers to the deployment-level methodMethodNullNotificationMethod `db:"method" json:"method"`KindNotificationTemplateKind `db:"kind" json:"kind"`EnabledByDefaultbool `db:"enabled_by_default" json:"enabled_by_default"`}
Templates from which to create notification messages.
typeNotificationTemplateKind¶added inv2.15.0
type NotificationTemplateKindstring
const (NotificationTemplateKindSystemNotificationTemplateKind = "system")
funcAllNotificationTemplateKindValues¶added inv2.15.0
func AllNotificationTemplateKindValues() []NotificationTemplateKind
func (*NotificationTemplateKind)Scan¶added inv2.15.0
func (e *NotificationTemplateKind) Scan(src interface{})error
func (NotificationTemplateKind)Valid¶added inv2.15.0
func (eNotificationTemplateKind) Valid()bool
typeNotificationsSettings¶added inv2.14.0
typeNullAPIKeyScope¶
type NullAPIKeyScope struct {APIKeyScopeAPIKeyScope `json:"api_key_scope"`Validbool `json:"valid"`// Valid is true if APIKeyScope is not NULL}
func (*NullAPIKeyScope)Scan¶
func (ns *NullAPIKeyScope) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullAgentKeyScopeEnum¶added inv2.22.0
type NullAgentKeyScopeEnum struct {AgentKeyScopeEnumAgentKeyScopeEnum `json:"agent_key_scope_enum"`Validbool `json:"valid"`// Valid is true if AgentKeyScopeEnum is not NULL}
func (*NullAgentKeyScopeEnum)Scan¶added inv2.22.0
func (ns *NullAgentKeyScopeEnum) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullAppSharingLevel¶
type NullAppSharingLevel struct {AppSharingLevelAppSharingLevel `json:"app_sharing_level"`Validbool `json:"valid"`// Valid is true if AppSharingLevel is not NULL}
func (*NullAppSharingLevel)Scan¶
func (ns *NullAppSharingLevel) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullAuditAction¶
type NullAuditAction struct {AuditActionAuditAction `json:"audit_action"`Validbool `json:"valid"`// Valid is true if AuditAction is not NULL}
func (*NullAuditAction)Scan¶
func (ns *NullAuditAction) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullAutomaticUpdates¶added inv2.3.0
type NullAutomaticUpdates struct {AutomaticUpdatesAutomaticUpdates `json:"automatic_updates"`Validbool `json:"valid"`// Valid is true if AutomaticUpdates is not NULL}
func (*NullAutomaticUpdates)Scan¶added inv2.3.0
func (ns *NullAutomaticUpdates) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullBuildReason¶
type NullBuildReason struct {BuildReasonBuildReason `json:"build_reason"`Validbool `json:"valid"`// Valid is true if BuildReason is not NULL}
func (*NullBuildReason)Scan¶
func (ns *NullBuildReason) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullCryptoKeyFeature¶added inv2.16.0
type NullCryptoKeyFeature struct {CryptoKeyFeatureCryptoKeyFeature `json:"crypto_key_feature"`Validbool `json:"valid"`// Valid is true if CryptoKeyFeature is not NULL}
func (*NullCryptoKeyFeature)Scan¶added inv2.16.0
func (ns *NullCryptoKeyFeature) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullDisplayApp¶added inv2.1.5
type NullDisplayApp struct {DisplayAppDisplayApp `json:"display_app"`Validbool `json:"valid"`// Valid is true if DisplayApp is not NULL}
func (*NullDisplayApp)Scan¶added inv2.1.5
func (ns *NullDisplayApp) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullGroupSource¶
type NullGroupSource struct {GroupSourceGroupSource `json:"group_source"`Validbool `json:"valid"`// Valid is true if GroupSource is not NULL}
func (*NullGroupSource)Scan¶
func (ns *NullGroupSource) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullInboxNotificationReadStatus¶added inv2.21.0
type NullInboxNotificationReadStatus struct {InboxNotificationReadStatusInboxNotificationReadStatus `json:"inbox_notification_read_status"`Validbool `json:"valid"`// Valid is true if InboxNotificationReadStatus is not NULL}
func (*NullInboxNotificationReadStatus)Scan¶added inv2.21.0
func (ns *NullInboxNotificationReadStatus) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullLogLevel¶
type NullLogLevel struct {LogLevelLogLevel `json:"log_level"`Validbool `json:"valid"`// Valid is true if LogLevel is not NULL}
func (*NullLogLevel)Scan¶
func (ns *NullLogLevel) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullLogSource¶
type NullLogSource struct {LogSourceLogSource `json:"log_source"`Validbool `json:"valid"`// Valid is true if LogSource is not NULL}
func (*NullLogSource)Scan¶
func (ns *NullLogSource) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullLoginType¶
type NullLoginType struct {LoginTypeLoginType `json:"login_type"`Validbool `json:"valid"`// Valid is true if LoginType is not NULL}
func (*NullLoginType)Scan¶
func (ns *NullLoginType) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullNotificationMessageStatus¶added inv2.13.0
type NullNotificationMessageStatus struct {NotificationMessageStatusNotificationMessageStatus `json:"notification_message_status"`Validbool `json:"valid"`// Valid is true if NotificationMessageStatus is not NULL}
func (*NullNotificationMessageStatus)Scan¶added inv2.13.0
func (ns *NullNotificationMessageStatus) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullNotificationMethod¶added inv2.13.0
type NullNotificationMethod struct {NotificationMethodNotificationMethod `json:"notification_method"`Validbool `json:"valid"`// Valid is true if NotificationMethod is not NULL}
func (*NullNotificationMethod)Scan¶added inv2.13.0
func (ns *NullNotificationMethod) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullNotificationTemplateKind¶added inv2.15.0
type NullNotificationTemplateKind struct {NotificationTemplateKindNotificationTemplateKind `json:"notification_template_kind"`Validbool `json:"valid"`// Valid is true if NotificationTemplateKind is not NULL}
func (*NullNotificationTemplateKind)Scan¶added inv2.15.0
func (ns *NullNotificationTemplateKind) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullParameterDestinationScheme¶
type NullParameterDestinationScheme struct {ParameterDestinationSchemeParameterDestinationScheme `json:"parameter_destination_scheme"`Validbool `json:"valid"`// Valid is true if ParameterDestinationScheme is not NULL}
func (*NullParameterDestinationScheme)Scan¶
func (ns *NullParameterDestinationScheme) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullParameterScope¶
type NullParameterScope struct {ParameterScopeParameterScope `json:"parameter_scope"`Validbool `json:"valid"`// Valid is true if ParameterScope is not NULL}
func (*NullParameterScope)Scan¶
func (ns *NullParameterScope) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullParameterSourceScheme¶
type NullParameterSourceScheme struct {ParameterSourceSchemeParameterSourceScheme `json:"parameter_source_scheme"`Validbool `json:"valid"`// Valid is true if ParameterSourceScheme is not NULL}
func (*NullParameterSourceScheme)Scan¶
func (ns *NullParameterSourceScheme) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullParameterTypeSystem¶
type NullParameterTypeSystem struct {ParameterTypeSystemParameterTypeSystem `json:"parameter_type_system"`Validbool `json:"valid"`// Valid is true if ParameterTypeSystem is not NULL}
func (*NullParameterTypeSystem)Scan¶
func (ns *NullParameterTypeSystem) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullPortShareProtocol¶added inv2.9.0
type NullPortShareProtocol struct {PortShareProtocolPortShareProtocol `json:"port_share_protocol"`Validbool `json:"valid"`// Valid is true if PortShareProtocol is not NULL}
func (*NullPortShareProtocol)Scan¶added inv2.9.0
func (ns *NullPortShareProtocol) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullPrebuildStatus¶added inv2.23.0
type NullPrebuildStatus struct {PrebuildStatusPrebuildStatus `json:"prebuild_status"`Validbool `json:"valid"`// Valid is true if PrebuildStatus is not NULL}
func (*NullPrebuildStatus)Scan¶added inv2.23.0
func (ns *NullPrebuildStatus) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullProvisionerDaemonStatus¶added inv2.19.0
type NullProvisionerDaemonStatus struct {ProvisionerDaemonStatusProvisionerDaemonStatus `json:"provisioner_daemon_status"`Validbool `json:"valid"`// Valid is true if ProvisionerDaemonStatus is not NULL}
func (*NullProvisionerDaemonStatus)Scan¶added inv2.19.0
func (ns *NullProvisionerDaemonStatus) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullProvisionerJobStatus¶added inv2.3.0
type NullProvisionerJobStatus struct {ProvisionerJobStatusProvisionerJobStatus `json:"provisioner_job_status"`Validbool `json:"valid"`// Valid is true if ProvisionerJobStatus is not NULL}
func (*NullProvisionerJobStatus)Scan¶added inv2.3.0
func (ns *NullProvisionerJobStatus) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullProvisionerJobTimingStage¶added inv2.15.0
type NullProvisionerJobTimingStage struct {ProvisionerJobTimingStageProvisionerJobTimingStage `json:"provisioner_job_timing_stage"`Validbool `json:"valid"`// Valid is true if ProvisionerJobTimingStage is not NULL}
func (*NullProvisionerJobTimingStage)Scan¶added inv2.15.0
func (ns *NullProvisionerJobTimingStage) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullProvisionerJobType¶
type NullProvisionerJobType struct {ProvisionerJobTypeProvisionerJobType `json:"provisioner_job_type"`Validbool `json:"valid"`// Valid is true if ProvisionerJobType is not NULL}
func (*NullProvisionerJobType)Scan¶
func (ns *NullProvisionerJobType) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullProvisionerStorageMethod¶
type NullProvisionerStorageMethod struct {ProvisionerStorageMethodProvisionerStorageMethod `json:"provisioner_storage_method"`Validbool `json:"valid"`// Valid is true if ProvisionerStorageMethod is not NULL}
func (*NullProvisionerStorageMethod)Scan¶
func (ns *NullProvisionerStorageMethod) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullProvisionerType¶
type NullProvisionerType struct {ProvisionerTypeProvisionerType `json:"provisioner_type"`Validbool `json:"valid"`// Valid is true if ProvisionerType is not NULL}
func (*NullProvisionerType)Scan¶
func (ns *NullProvisionerType) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullResourceType¶
type NullResourceType struct {ResourceTypeResourceType `json:"resource_type"`Validbool `json:"valid"`// Valid is true if ResourceType is not NULL}
func (*NullResourceType)Scan¶
func (ns *NullResourceType) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullStartupScriptBehavior¶
type NullStartupScriptBehavior struct {StartupScriptBehaviorStartupScriptBehavior `json:"startup_script_behavior"`Validbool `json:"valid"`// Valid is true if StartupScriptBehavior is not NULL}
func (*NullStartupScriptBehavior)Scan¶
func (ns *NullStartupScriptBehavior) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullTailnetStatus¶added inv2.4.0
type NullTailnetStatus struct {TailnetStatusTailnetStatus `json:"tailnet_status"`Validbool `json:"valid"`// Valid is true if TailnetStatus is not NULL}
func (*NullTailnetStatus)Scan¶added inv2.4.0
func (ns *NullTailnetStatus) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullUserStatus¶
type NullUserStatus struct {UserStatusUserStatus `json:"user_status"`Validbool `json:"valid"`// Valid is true if UserStatus is not NULL}
func (*NullUserStatus)Scan¶
func (ns *NullUserStatus) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullWorkspaceAgentLifecycleState¶
type NullWorkspaceAgentLifecycleState struct {WorkspaceAgentLifecycleStateWorkspaceAgentLifecycleState `json:"workspace_agent_lifecycle_state"`Validbool `json:"valid"`// Valid is true if WorkspaceAgentLifecycleState is not NULL}
func (*NullWorkspaceAgentLifecycleState)Scan¶
func (ns *NullWorkspaceAgentLifecycleState) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullWorkspaceAgentMonitorState¶added inv2.20.0
type NullWorkspaceAgentMonitorState struct {WorkspaceAgentMonitorStateWorkspaceAgentMonitorState `json:"workspace_agent_monitor_state"`Validbool `json:"valid"`// Valid is true if WorkspaceAgentMonitorState is not NULL}
func (*NullWorkspaceAgentMonitorState)Scan¶added inv2.20.0
func (ns *NullWorkspaceAgentMonitorState) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullWorkspaceAgentScriptTimingStage¶added inv2.16.0
type NullWorkspaceAgentScriptTimingStage struct {WorkspaceAgentScriptTimingStageWorkspaceAgentScriptTimingStage `json:"workspace_agent_script_timing_stage"`Validbool `json:"valid"`// Valid is true if WorkspaceAgentScriptTimingStage is not NULL}
func (*NullWorkspaceAgentScriptTimingStage)Scan¶added inv2.16.0
func (ns *NullWorkspaceAgentScriptTimingStage) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullWorkspaceAgentScriptTimingStatus¶added inv2.16.0
type NullWorkspaceAgentScriptTimingStatus struct {WorkspaceAgentScriptTimingStatusWorkspaceAgentScriptTimingStatus `json:"workspace_agent_script_timing_status"`Validbool `json:"valid"`// Valid is true if WorkspaceAgentScriptTimingStatus is not NULL}
func (*NullWorkspaceAgentScriptTimingStatus)Scan¶added inv2.16.0
func (ns *NullWorkspaceAgentScriptTimingStatus) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullWorkspaceAgentSubsystem¶
type NullWorkspaceAgentSubsystem struct {WorkspaceAgentSubsystemWorkspaceAgentSubsystem `json:"workspace_agent_subsystem"`Validbool `json:"valid"`// Valid is true if WorkspaceAgentSubsystem is not NULL}
func (*NullWorkspaceAgentSubsystem)Scan¶
func (ns *NullWorkspaceAgentSubsystem) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullWorkspaceAppHealth¶
type NullWorkspaceAppHealth struct {WorkspaceAppHealthWorkspaceAppHealth `json:"workspace_app_health"`Validbool `json:"valid"`// Valid is true if WorkspaceAppHealth is not NULL}
func (*NullWorkspaceAppHealth)Scan¶
func (ns *NullWorkspaceAppHealth) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullWorkspaceAppOpenIn¶added inv2.19.0
type NullWorkspaceAppOpenIn struct {WorkspaceAppOpenInWorkspaceAppOpenIn `json:"workspace_app_open_in"`Validbool `json:"valid"`// Valid is true if WorkspaceAppOpenIn is not NULL}
func (*NullWorkspaceAppOpenIn)Scan¶added inv2.19.0
func (ns *NullWorkspaceAppOpenIn) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullWorkspaceAppStatusState¶added inv2.21.0
type NullWorkspaceAppStatusState struct {WorkspaceAppStatusStateWorkspaceAppStatusState `json:"workspace_app_status_state"`Validbool `json:"valid"`// Valid is true if WorkspaceAppStatusState is not NULL}
func (*NullWorkspaceAppStatusState)Scan¶added inv2.21.0
func (ns *NullWorkspaceAppStatusState) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullWorkspaceTransition¶
type NullWorkspaceTransition struct {WorkspaceTransitionWorkspaceTransition `json:"workspace_transition"`Validbool `json:"valid"`// Valid is true if WorkspaceTransition is not NULL}
func (*NullWorkspaceTransition)Scan¶
func (ns *NullWorkspaceTransition) Scan(value interface{})error
Scan implements the Scanner interface.
typeOAuth2ProviderApp¶added inv2.6.0
type OAuth2ProviderApp struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Namestring `db:"name" json:"name"`Iconstring `db:"icon" json:"icon"`CallbackURLstring `db:"callback_url" json:"callback_url"`}
A table used to configure apps that can use Coder as an OAuth2 provider, the reverse of what we are calling external authentication.
func (OAuth2ProviderApp)RBACObject¶added inv2.9.0
func (OAuth2ProviderApp) RBACObject()rbac.Object
typeOAuth2ProviderAppCode¶added inv2.9.0
type OAuth2ProviderAppCode struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`ExpiresAttime.Time `db:"expires_at" json:"expires_at"`SecretPrefix []byte `db:"secret_prefix" json:"secret_prefix"`HashedSecret []byte `db:"hashed_secret" json:"hashed_secret"`UserIDuuid.UUID `db:"user_id" json:"user_id"`AppIDuuid.UUID `db:"app_id" json:"app_id"`}
Codes are meant to be exchanged for access tokens.
func (OAuth2ProviderAppCode)RBACObject¶added inv2.9.0
func (cOAuth2ProviderAppCode) RBACObject()rbac.Object
typeOAuth2ProviderAppSecret¶added inv2.6.0
type OAuth2ProviderAppSecret struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`LastUsedAtsql.NullTime `db:"last_used_at" json:"last_used_at"`HashedSecret []byte `db:"hashed_secret" json:"hashed_secret"`// The tail end of the original secret so secrets can be differentiated.DisplaySecretstring `db:"display_secret" json:"display_secret"`AppIDuuid.UUID `db:"app_id" json:"app_id"`SecretPrefix []byte `db:"secret_prefix" json:"secret_prefix"`}
func (OAuth2ProviderAppSecret)RBACObject¶added inv2.9.0
func (OAuth2ProviderAppSecret) RBACObject()rbac.Object
typeOAuth2ProviderAppToken¶added inv2.9.0
type OAuth2ProviderAppToken struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`ExpiresAttime.Time `db:"expires_at" json:"expires_at"`HashPrefix []byte `db:"hash_prefix" json:"hash_prefix"`// Refresh tokens provide a way to refresh an access token (API key). An expired API key can be refreshed if this token is not yet expired, meaning this expiry can outlive an API key.RefreshHash []byte `db:"refresh_hash" json:"refresh_hash"`AppSecretIDuuid.UUID `db:"app_secret_id" json:"app_secret_id"`APIKeyIDstring `db:"api_key_id" json:"api_key_id"`}
typeOIDCClaimFieldValuesParams¶added inv2.18.0
typeOrganization¶
type Organization struct {IDuuid.UUID `db:"id" json:"id"`Namestring `db:"name" json:"name"`Descriptionstring `db:"description" json:"description"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`IsDefaultbool `db:"is_default" json:"is_default"`DisplayNamestring `db:"display_name" json:"display_name"`Iconstring `db:"icon" json:"icon"`Deletedbool `db:"deleted" json:"deleted"`}
func (Organization)RBACObject¶
func (oOrganization) RBACObject()rbac.Object
typeOrganizationMember¶
type OrganizationMember struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Roles []string `db:"roles" json:"roles"`}
func (OrganizationMember)Auditable¶added inv2.13.0
func (mOrganizationMember) Auditable(usernamestring)AuditableOrganizationMember
func (OrganizationMember)RBACObject¶
func (mOrganizationMember) RBACObject()rbac.Object
typeOrganizationMembersParams¶added inv2.13.0
typeOrganizationMembersRow¶added inv2.13.0
type OrganizationMembersRow struct {OrganizationMemberOrganizationMember `db:"organization_member" json:"organization_member"`Usernamestring `db:"username" json:"username"`AvatarURLstring `db:"avatar_url" json:"avatar_url"`Namestring `db:"name" json:"name"`Emailstring `db:"email" json:"email"`GlobalRolespq.StringArray `db:"global_roles" json:"global_roles"`}
func (OrganizationMembersRow)RBACObject¶added inv2.13.0
func (mOrganizationMembersRow) RBACObject()rbac.Object
typePGLock¶added inv2.17.0
type PGLock struct {// LockType see:https://www.postgresql.org/docs/current/monitoring-stats.html#WAIT-EVENT-LOCK-TABLELockType *string `db:"locktype"`Database *string `db:"database"`// oidRelation *string `db:"relation"`// oidRelationName *string `db:"relation_name"`Page *int `db:"page"`Tuple *int `db:"tuple"`VirtualXID *string `db:"virtualxid"`TransactionID *string `db:"transactionid"`// xidClassID *string `db:"classid"`// oidObjID *string `db:"objid"`// oidObjSubID *int `db:"objsubid"`VirtualTransaction *string `db:"virtualtransaction"`PIDint `db:"pid"`Mode *string `db:"mode"`Grantedbool `db:"granted"`FastPath *bool `db:"fastpath"`WaitStart *time.Time `db:"waitstart"`}
PGLock docs see:https://www.postgresql.org/docs/current/view-pg-locks.html#VIEW-PG-LOCKS
typePGLocks¶added inv2.17.0
type PGLocks []PGLock
func (PGLocks)Difference¶added inv2.17.0
Difference returns the difference between two sets of locks.This is helpful to determine what changed between the two sets.
typePaginatedOrganizationMembersParams¶added inv2.21.0
typePaginatedOrganizationMembersRow¶added inv2.21.0
type PaginatedOrganizationMembersRow struct {OrganizationMemberOrganizationMember `db:"organization_member" json:"organization_member"`Usernamestring `db:"username" json:"username"`AvatarURLstring `db:"avatar_url" json:"avatar_url"`Namestring `db:"name" json:"name"`Emailstring `db:"email" json:"email"`GlobalRolespq.StringArray `db:"global_roles" json:"global_roles"`Countint64 `db:"count" json:"count"`}
func (PaginatedOrganizationMembersRow)RBACObject¶added inv2.21.0
func (mPaginatedOrganizationMembersRow) RBACObject()rbac.Object
typeParameterDestinationScheme¶
type ParameterDestinationSchemestring
const (ParameterDestinationSchemeNoneParameterDestinationScheme = "none"ParameterDestinationSchemeEnvironmentVariableParameterDestinationScheme = "environment_variable"ParameterDestinationSchemeProvisionerVariableParameterDestinationScheme = "provisioner_variable")
funcAllParameterDestinationSchemeValues¶
func AllParameterDestinationSchemeValues() []ParameterDestinationScheme
func (*ParameterDestinationScheme)Scan¶
func (e *ParameterDestinationScheme) Scan(src interface{})error
func (ParameterDestinationScheme)Valid¶
func (eParameterDestinationScheme) Valid()bool
typeParameterSchema¶
type ParameterSchema struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`JobIDuuid.UUID `db:"job_id" json:"job_id"`Namestring `db:"name" json:"name"`Descriptionstring `db:"description" json:"description"`DefaultSourceSchemeParameterSourceScheme `db:"default_source_scheme" json:"default_source_scheme"`DefaultSourceValuestring `db:"default_source_value" json:"default_source_value"`AllowOverrideSourcebool `db:"allow_override_source" json:"allow_override_source"`DefaultDestinationSchemeParameterDestinationScheme `db:"default_destination_scheme" json:"default_destination_scheme"`AllowOverrideDestinationbool `db:"allow_override_destination" json:"allow_override_destination"`DefaultRefreshstring `db:"default_refresh" json:"default_refresh"`RedisplayValuebool `db:"redisplay_value" json:"redisplay_value"`ValidationErrorstring `db:"validation_error" json:"validation_error"`ValidationConditionstring `db:"validation_condition" json:"validation_condition"`ValidationTypeSystemParameterTypeSystem `db:"validation_type_system" json:"validation_type_system"`ValidationValueTypestring `db:"validation_value_type" json:"validation_value_type"`Indexint32 `db:"index" json:"index"`}
typeParameterScope¶
type ParameterScopestring
const (ParameterScopeTemplateParameterScope = "template"ParameterScopeImportJobParameterScope = "import_job"ParameterScopeWorkspaceParameterScope = "workspace")
funcAllParameterScopeValues¶
func AllParameterScopeValues() []ParameterScope
func (*ParameterScope)Scan¶
func (e *ParameterScope) Scan(src interface{})error
func (ParameterScope)Valid¶
func (eParameterScope) Valid()bool
typeParameterSourceScheme¶
type ParameterSourceSchemestring
const (ParameterSourceSchemeNoneParameterSourceScheme = "none"ParameterSourceSchemeDataParameterSourceScheme = "data")
funcAllParameterSourceSchemeValues¶
func AllParameterSourceSchemeValues() []ParameterSourceScheme
func (*ParameterSourceScheme)Scan¶
func (e *ParameterSourceScheme) Scan(src interface{})error
func (ParameterSourceScheme)Valid¶
func (eParameterSourceScheme) Valid()bool
typeParameterTypeSystem¶
type ParameterTypeSystemstring
const (ParameterTypeSystemNoneParameterTypeSystem = "none"ParameterTypeSystemHCLParameterTypeSystem = "hcl")
funcAllParameterTypeSystemValues¶
func AllParameterTypeSystemValues() []ParameterTypeSystem
func (*ParameterTypeSystem)Scan¶
func (e *ParameterTypeSystem) Scan(src interface{})error
func (ParameterTypeSystem)Valid¶
func (eParameterTypeSystem) Valid()bool
typeParameterValue¶
type ParameterValue struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`ScopeParameterScope `db:"scope" json:"scope"`ScopeIDuuid.UUID `db:"scope_id" json:"scope_id"`Namestring `db:"name" json:"name"`SourceSchemeParameterSourceScheme `db:"source_scheme" json:"source_scheme"`SourceValuestring `db:"source_value" json:"source_value"`DestinationSchemeParameterDestinationScheme `db:"destination_scheme" json:"destination_scheme"`}
typePortShareProtocol¶added inv2.9.0
type PortShareProtocolstring
const (PortShareProtocolHttpPortShareProtocol = "http"PortShareProtocolHttpsPortShareProtocol = "https")
funcAllPortShareProtocolValues¶added inv2.9.0
func AllPortShareProtocolValues() []PortShareProtocol
func (*PortShareProtocol)Scan¶added inv2.9.0
func (e *PortShareProtocol) Scan(src interface{})error
func (PortShareProtocol)Valid¶added inv2.9.0
func (ePortShareProtocol) Valid()bool
typePrebuildStatus¶added inv2.23.0
type PrebuildStatusstring
const (PrebuildStatusHealthyPrebuildStatus = "healthy"PrebuildStatusHardLimitedPrebuildStatus = "hard_limited"PrebuildStatusValidationFailedPrebuildStatus = "validation_failed")
funcAllPrebuildStatusValues¶added inv2.23.0
func AllPrebuildStatusValues() []PrebuildStatus
func (*PrebuildStatus)Scan¶added inv2.23.0
func (e *PrebuildStatus) Scan(src interface{})error
func (PrebuildStatus)Valid¶added inv2.23.0
func (ePrebuildStatus) Valid()bool
typeProvisionerDaemon¶
type ProvisionerDaemon struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`Namestring `db:"name" json:"name"`Provisioners []ProvisionerType `db:"provisioners" json:"provisioners"`ReplicaIDuuid.NullUUID `db:"replica_id" json:"replica_id"`TagsStringMap `db:"tags" json:"tags"`LastSeenAtsql.NullTime `db:"last_seen_at" json:"last_seen_at"`Versionstring `db:"version" json:"version"`// The API version of the provisioner daemonAPIVersionstring `db:"api_version" json:"api_version"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`KeyIDuuid.UUID `db:"key_id" json:"key_id"`}
func (ProvisionerDaemon)RBACObject¶
func (pProvisionerDaemon) RBACObject()rbac.Object
typeProvisionerDaemonStatus¶added inv2.19.0
type ProvisionerDaemonStatusstring
The status of a provisioner daemon.
const (ProvisionerDaemonStatusOfflineProvisionerDaemonStatus = "offline"ProvisionerDaemonStatusIdleProvisionerDaemonStatus = "idle"ProvisionerDaemonStatusBusyProvisionerDaemonStatus = "busy")
funcAllProvisionerDaemonStatusValues¶added inv2.19.0
func AllProvisionerDaemonStatusValues() []ProvisionerDaemonStatus
func (*ProvisionerDaemonStatus)Scan¶added inv2.19.0
func (e *ProvisionerDaemonStatus) Scan(src interface{})error
func (ProvisionerDaemonStatus)Valid¶added inv2.19.0
func (eProvisionerDaemonStatus) Valid()bool
typeProvisionerJob¶
type ProvisionerJob struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`StartedAtsql.NullTime `db:"started_at" json:"started_at"`CanceledAtsql.NullTime `db:"canceled_at" json:"canceled_at"`CompletedAtsql.NullTime `db:"completed_at" json:"completed_at"`Errorsql.NullString `db:"error" json:"error"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`InitiatorIDuuid.UUID `db:"initiator_id" json:"initiator_id"`ProvisionerProvisionerType `db:"provisioner" json:"provisioner"`StorageMethodProvisionerStorageMethod `db:"storage_method" json:"storage_method"`TypeProvisionerJobType `db:"type" json:"type"`Inputjson.RawMessage `db:"input" json:"input"`WorkerIDuuid.NullUUID `db:"worker_id" json:"worker_id"`FileIDuuid.UUID `db:"file_id" json:"file_id"`TagsStringMap `db:"tags" json:"tags"`ErrorCodesql.NullString `db:"error_code" json:"error_code"`TraceMetadatapqtype.NullRawMessage `db:"trace_metadata" json:"trace_metadata"`// Computed column to track the status of the job.JobStatusProvisionerJobStatus `db:"job_status" json:"job_status"`}
func (ProvisionerJob)Finished¶added inv2.3.0
func (pProvisionerJob) Finished()bool
func (ProvisionerJob)FinishedAt¶added inv2.3.0
func (pProvisionerJob) FinishedAt()time.Time
func (ProvisionerJob)RBACObject¶added inv2.19.0
func (pProvisionerJob) RBACObject()rbac.Object
typeProvisionerJobLog¶
type ProvisionerJobLog struct {JobIDuuid.UUID `db:"job_id" json:"job_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`SourceLogSource `db:"source" json:"source"`LevelLogLevel `db:"level" json:"level"`Stagestring `db:"stage" json:"stage"`Outputstring `db:"output" json:"output"`IDint64 `db:"id" json:"id"`}
typeProvisionerJobStat¶added inv2.15.0
type ProvisionerJobStat struct {JobIDuuid.UUID `db:"job_id" json:"job_id"`JobStatusProvisionerJobStatus `db:"job_status" json:"job_status"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`WorkerIDuuid.NullUUID `db:"worker_id" json:"worker_id"`Errorsql.NullString `db:"error" json:"error"`ErrorCodesql.NullString `db:"error_code" json:"error_code"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`QueuedSecsfloat64 `db:"queued_secs" json:"queued_secs"`CompletionSecsfloat64 `db:"completion_secs" json:"completion_secs"`CanceledSecsfloat64 `db:"canceled_secs" json:"canceled_secs"`InitSecsfloat64 `db:"init_secs" json:"init_secs"`PlanSecsfloat64 `db:"plan_secs" json:"plan_secs"`GraphSecsfloat64 `db:"graph_secs" json:"graph_secs"`ApplySecsfloat64 `db:"apply_secs" json:"apply_secs"`}
typeProvisionerJobStatus¶added inv2.3.0
type ProvisionerJobStatusstring
Computed status of a provisioner job. Jobs could be stuck in a hung state, these states do not guarantee any transition to another state.
const (ProvisionerJobStatusPendingProvisionerJobStatus = "pending"ProvisionerJobStatusRunningProvisionerJobStatus = "running"ProvisionerJobStatusSucceededProvisionerJobStatus = "succeeded"ProvisionerJobStatusCancelingProvisionerJobStatus = "canceling"ProvisionerJobStatusCanceledProvisionerJobStatus = "canceled"ProvisionerJobStatusFailedProvisionerJobStatus = "failed"ProvisionerJobStatusUnknownProvisionerJobStatus = "unknown")
funcAllProvisionerJobStatusValues¶added inv2.3.0
func AllProvisionerJobStatusValues() []ProvisionerJobStatus
func (*ProvisionerJobStatus)Scan¶added inv2.3.0
func (e *ProvisionerJobStatus) Scan(src interface{})error
func (ProvisionerJobStatus)Valid¶added inv2.3.0
func (eProvisionerJobStatus) Valid()bool
typeProvisionerJobTiming¶added inv2.15.0
type ProvisionerJobTiming struct {JobIDuuid.UUID `db:"job_id" json:"job_id"`StartedAttime.Time `db:"started_at" json:"started_at"`EndedAttime.Time `db:"ended_at" json:"ended_at"`StageProvisionerJobTimingStage `db:"stage" json:"stage"`Sourcestring `db:"source" json:"source"`Actionstring `db:"action" json:"action"`Resourcestring `db:"resource" json:"resource"`}
typeProvisionerJobTimingStage¶added inv2.15.0
type ProvisionerJobTimingStagestring
const (ProvisionerJobTimingStageInitProvisionerJobTimingStage = "init"ProvisionerJobTimingStagePlanProvisionerJobTimingStage = "plan"ProvisionerJobTimingStageGraphProvisionerJobTimingStage = "graph"ProvisionerJobTimingStageApplyProvisionerJobTimingStage = "apply")
funcAllProvisionerJobTimingStageValues¶added inv2.15.0
func AllProvisionerJobTimingStageValues() []ProvisionerJobTimingStage
func (*ProvisionerJobTimingStage)Scan¶added inv2.15.0
func (e *ProvisionerJobTimingStage) Scan(src interface{})error
func (ProvisionerJobTimingStage)Valid¶added inv2.15.0
func (eProvisionerJobTimingStage) Valid()bool
typeProvisionerJobType¶
type ProvisionerJobTypestring
const (ProvisionerJobTypeTemplateVersionImportProvisionerJobType = "template_version_import"ProvisionerJobTypeWorkspaceBuildProvisionerJobType = "workspace_build"ProvisionerJobTypeTemplateVersionDryRunProvisionerJobType = "template_version_dry_run")
funcAllProvisionerJobTypeValues¶
func AllProvisionerJobTypeValues() []ProvisionerJobType
func (*ProvisionerJobType)Scan¶
func (e *ProvisionerJobType) Scan(src interface{})error
func (ProvisionerJobType)Valid¶
func (eProvisionerJobType) Valid()bool
typeProvisionerKey¶added inv2.14.0
type ProvisionerKey struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`Namestring `db:"name" json:"name"`HashedSecret []byte `db:"hashed_secret" json:"hashed_secret"`TagsStringMap `db:"tags" json:"tags"`}
func (ProvisionerKey)RBACObject¶added inv2.14.0
func (pProvisionerKey) RBACObject()rbac.Object
RBACObject for a provisioner key is the same as a provisioner daemon.Keys == provisioners from a RBAC perspective.
typeProvisionerStorageMethod¶
type ProvisionerStorageMethodstring
const (ProvisionerStorageMethodFileProvisionerStorageMethod = "file")
funcAllProvisionerStorageMethodValues¶
func AllProvisionerStorageMethodValues() []ProvisionerStorageMethod
func (*ProvisionerStorageMethod)Scan¶
func (e *ProvisionerStorageMethod) Scan(src interface{})error
func (ProvisionerStorageMethod)Valid¶
func (eProvisionerStorageMethod) Valid()bool
typeProvisionerType¶
type ProvisionerTypestring
const (ProvisionerTypeEchoProvisionerType = "echo"ProvisionerTypeTerraformProvisionerType = "terraform")
funcAllProvisionerTypeValues¶
func AllProvisionerTypeValues() []ProvisionerType
func (*ProvisionerType)Scan¶
func (e *ProvisionerType) Scan(src interface{})error
func (ProvisionerType)Valid¶
func (eProvisionerType) Valid()bool
typeRegisterWorkspaceProxyParams¶
type RegisterWorkspaceProxyParams struct {Urlstring `db:"url" json:"url"`WildcardHostnamestring `db:"wildcard_hostname" json:"wildcard_hostname"`DerpEnabledbool `db:"derp_enabled" json:"derp_enabled"`DerpOnlybool `db:"derp_only" json:"derp_only"`Versionstring `db:"version" json:"version"`IDuuid.UUID `db:"id" json:"id"`}
typeRemoveUserFromGroupsParams¶added inv2.16.0
typeReplica¶
type Replica struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`StartedAttime.Time `db:"started_at" json:"started_at"`StoppedAtsql.NullTime `db:"stopped_at" json:"stopped_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Hostnamestring `db:"hostname" json:"hostname"`RegionIDint32 `db:"region_id" json:"region_id"`RelayAddressstring `db:"relay_address" json:"relay_address"`DatabaseLatencyint32 `db:"database_latency" json:"database_latency"`Versionstring `db:"version" json:"version"`Errorstring `db:"error" json:"error"`Primarybool `db:"primary" json:"primary"`}
typeResourceType¶
type ResourceTypestring
const (ResourceTypeOrganizationResourceType = "organization"ResourceTypeTemplateResourceType = "template"ResourceTypeTemplateVersionResourceType = "template_version"ResourceTypeUserResourceType = "user"ResourceTypeWorkspaceResourceType = "workspace"ResourceTypeGitSshKeyResourceType = "git_ssh_key"ResourceTypeApiKeyResourceType = "api_key"ResourceTypeGroupResourceType = "group"ResourceTypeWorkspaceBuildResourceType = "workspace_build"ResourceTypeLicenseResourceType = "license"ResourceTypeWorkspaceProxyResourceType = "workspace_proxy"ResourceTypeConvertLoginResourceType = "convert_login"ResourceTypeHealthSettingsResourceType = "health_settings"ResourceTypeOauth2ProviderAppResourceType = "oauth2_provider_app"ResourceTypeOauth2ProviderAppSecretResourceType = "oauth2_provider_app_secret"ResourceTypeCustomRoleResourceType = "custom_role"ResourceTypeOrganizationMemberResourceType = "organization_member"ResourceTypeNotificationsSettingsResourceType = "notifications_settings"ResourceTypeNotificationTemplateResourceType = "notification_template"ResourceTypeIdpSyncSettingsOrganizationResourceType = "idp_sync_settings_organization"ResourceTypeIdpSyncSettingsGroupResourceType = "idp_sync_settings_group"ResourceTypeIdpSyncSettingsRoleResourceType = "idp_sync_settings_role"ResourceTypeWorkspaceAgentResourceType = "workspace_agent"ResourceTypeWorkspaceAppResourceType = "workspace_app")
funcAllResourceTypeValues¶
func AllResourceTypeValues() []ResourceType
func (*ResourceType)Scan¶
func (e *ResourceType) Scan(src interface{})error
func (ResourceType)Valid¶
func (eResourceType) Valid()bool
typeSiteConfig¶
typeStartupScriptBehavior¶
type StartupScriptBehaviorstring
const (StartupScriptBehaviorBlockingStartupScriptBehavior = "blocking"StartupScriptBehaviorNonBlockingStartupScriptBehavior = "non-blocking")
funcAllStartupScriptBehaviorValues¶
func AllStartupScriptBehaviorValues() []StartupScriptBehavior
func (*StartupScriptBehavior)Scan¶
func (e *StartupScriptBehavior) Scan(src interface{})error
func (StartupScriptBehavior)Valid¶
func (eStartupScriptBehavior) Valid()bool
typeStore¶
type Store interface {Ping(ctxcontext.Context) (time.Duration,error)PGLocks(ctxcontext.Context) (PGLocks,error)InTx(func(Store)error, *TxOptions)error// contains filtered or unexported methods}
Store contains all queryable database functions.It extends the generated interface to add transaction support.
typeStringMapOfInt¶added inv2.10.0
func (*StringMapOfInt)Scan¶added inv2.10.0
func (m *StringMapOfInt) Scan(src interface{})error
typeTailnetAgent¶
typeTailnetClient¶
typeTailnetClientSubscription¶added inv2.2.0
typeTailnetCoordinator¶
type TailnetCoordinator struct {IDuuid.UUID `db:"id" json:"id"`HeartbeatAttime.Time `db:"heartbeat_at" json:"heartbeat_at"`}
We keep this separate from replicas in case we need to break the coordinator out into its own service
typeTailnetPeer¶added inv2.4.0
typeTailnetStatus¶added inv2.4.0
type TailnetStatusstring
const (TailnetStatusOkTailnetStatus = "ok"TailnetStatusLostTailnetStatus = "lost")
funcAllTailnetStatusValues¶added inv2.4.0
func AllTailnetStatusValues() []TailnetStatus
func (*TailnetStatus)Scan¶added inv2.4.0
func (e *TailnetStatus) Scan(src interface{})error
func (TailnetStatus)Valid¶added inv2.4.0
func (eTailnetStatus) Valid()bool
typeTailnetTunnel¶added inv2.4.0
typeTelemetryItem¶added inv2.19.0
typeTemplate¶
type Template struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`Deletedbool `db:"deleted" json:"deleted"`Namestring `db:"name" json:"name"`ProvisionerProvisionerType `db:"provisioner" json:"provisioner"`ActiveVersionIDuuid.UUID `db:"active_version_id" json:"active_version_id"`Descriptionstring `db:"description" json:"description"`DefaultTTLint64 `db:"default_ttl" json:"default_ttl"`CreatedByuuid.UUID `db:"created_by" json:"created_by"`Iconstring `db:"icon" json:"icon"`UserACLTemplateACL `db:"user_acl" json:"user_acl"`GroupACLTemplateACL `db:"group_acl" json:"group_acl"`DisplayNamestring `db:"display_name" json:"display_name"`AllowUserCancelWorkspaceJobsbool `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"`AllowUserAutostartbool `db:"allow_user_autostart" json:"allow_user_autostart"`AllowUserAutostopbool `db:"allow_user_autostop" json:"allow_user_autostop"`FailureTTLint64 `db:"failure_ttl" json:"failure_ttl"`TimeTilDormantint64 `db:"time_til_dormant" json:"time_til_dormant"`TimeTilDormantAutoDeleteint64 `db:"time_til_dormant_autodelete" json:"time_til_dormant_autodelete"`AutostopRequirementDaysOfWeekint16 `db:"autostop_requirement_days_of_week" json:"autostop_requirement_days_of_week"`AutostopRequirementWeeksint64 `db:"autostop_requirement_weeks" json:"autostop_requirement_weeks"`AutostartBlockDaysOfWeekint16 `db:"autostart_block_days_of_week" json:"autostart_block_days_of_week"`RequireActiveVersionbool `db:"require_active_version" json:"require_active_version"`Deprecatedstring `db:"deprecated" json:"deprecated"`ActivityBumpint64 `db:"activity_bump" json:"activity_bump"`MaxPortSharingLevelAppSharingLevel `db:"max_port_sharing_level" json:"max_port_sharing_level"`UseClassicParameterFlowbool `db:"use_classic_parameter_flow" json:"use_classic_parameter_flow"`CreatedByAvatarURLstring `db:"created_by_avatar_url" json:"created_by_avatar_url"`CreatedByUsernamestring `db:"created_by_username" json:"created_by_username"`CreatedByNamestring `db:"created_by_name" json:"created_by_name"`OrganizationNamestring `db:"organization_name" json:"organization_name"`OrganizationDisplayNamestring `db:"organization_display_name" json:"organization_display_name"`OrganizationIconstring `db:"organization_icon" json:"organization_icon"`}
Joins in the display name information such as username, avatar, and organization name.
func (Template)AutostartAllowedDays¶added inv2.3.1
AutostartAllowedDays returns the inverse of 'AutostartBlockDaysOfWeek'.It is more useful to have the days that are allowed to autostart from a UXPOV. The database prefers the 0 value being 'all days allowed'.
func (Template)RBACObject¶
typeTemplateACL¶
TemplateACL is a map of ids to permissions.
func (*TemplateACL)Scan¶
func (t *TemplateACL) Scan(src interface{})error
typeTemplateGroup¶
typeTemplateTable¶
type TemplateTable struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`Deletedbool `db:"deleted" json:"deleted"`Namestring `db:"name" json:"name"`ProvisionerProvisionerType `db:"provisioner" json:"provisioner"`ActiveVersionIDuuid.UUID `db:"active_version_id" json:"active_version_id"`Descriptionstring `db:"description" json:"description"`// The default duration for autostop for workspaces created from this template.DefaultTTLint64 `db:"default_ttl" json:"default_ttl"`CreatedByuuid.UUID `db:"created_by" json:"created_by"`Iconstring `db:"icon" json:"icon"`UserACLTemplateACL `db:"user_acl" json:"user_acl"`GroupACLTemplateACL `db:"group_acl" json:"group_acl"`// Display name is a custom, human-friendly template name that user can set.DisplayNamestring `db:"display_name" json:"display_name"`// Allow users to cancel in-progress workspace jobs.AllowUserCancelWorkspaceJobsbool `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"`// Allow users to specify an autostart schedule for workspaces (enterprise).AllowUserAutostartbool `db:"allow_user_autostart" json:"allow_user_autostart"`// Allow users to specify custom autostop values for workspaces (enterprise).AllowUserAutostopbool `db:"allow_user_autostop" json:"allow_user_autostop"`FailureTTLint64 `db:"failure_ttl" json:"failure_ttl"`TimeTilDormantint64 `db:"time_til_dormant" json:"time_til_dormant"`TimeTilDormantAutoDeleteint64 `db:"time_til_dormant_autodelete" json:"time_til_dormant_autodelete"`// A bitmap of days of week to restart the workspace on, starting with Monday as the 0th bit, and Sunday as the 6th bit. The 7th bit is unused.AutostopRequirementDaysOfWeekint16 `db:"autostop_requirement_days_of_week" json:"autostop_requirement_days_of_week"`// The number of weeks between restarts. 0 or 1 weeks means "every week", 2 week means "every second week", etc. Weeks are counted from January 2, 2023, which is the first Monday of 2023. This is to ensure workspaces are started consistently for all customers on the same n-week cycles.AutostopRequirementWeeksint64 `db:"autostop_requirement_weeks" json:"autostop_requirement_weeks"`// A bitmap of days of week that autostart of a workspace is not allowed. Default allows all days. This is intended as a cost savings measure to prevent auto start on weekends (for example).AutostartBlockDaysOfWeekint16 `db:"autostart_block_days_of_week" json:"autostart_block_days_of_week"`RequireActiveVersionbool `db:"require_active_version" json:"require_active_version"`// If set to a non empty string, the template will no longer be able to be used. The message will be displayed to the user.Deprecatedstring `db:"deprecated" json:"deprecated"`ActivityBumpint64 `db:"activity_bump" json:"activity_bump"`MaxPortSharingLevelAppSharingLevel `db:"max_port_sharing_level" json:"max_port_sharing_level"`// Determines whether to default to the dynamic parameter creation flow for this template or continue using the legacy classic parameter creation flow.This is a template wide setting, the template admin can revert to the classic flow if there are any issues. An escape hatch is required, as workspace creation is a core workflow and cannot break. This column will be removed when the dynamic parameter creation flow is stable.UseClassicParameterFlowbool `db:"use_classic_parameter_flow" json:"use_classic_parameter_flow"`}
typeTemplateUsageStat¶added inv2.10.0
type TemplateUsageStat struct {// Start time of the usage period.StartTimetime.Time `db:"start_time" json:"start_time"`// End time of the usage period.EndTimetime.Time `db:"end_time" json:"end_time"`// ID of the template being used.TemplateIDuuid.UUID `db:"template_id" json:"template_id"`// ID of the user using the template.UserIDuuid.UUID `db:"user_id" json:"user_id"`// Median latency the user is experiencing, in milliseconds. Null means no value was recorded.MedianLatencyMssql.NullFloat64 `db:"median_latency_ms" json:"median_latency_ms"`// Total minutes the user has been using the template.UsageMinsint16 `db:"usage_mins" json:"usage_mins"`// Total minutes the user has been using SSH.SshMinsint16 `db:"ssh_mins" json:"ssh_mins"`// Total minutes the user has been using SFTP.SftpMinsint16 `db:"sftp_mins" json:"sftp_mins"`// Total minutes the user has been using the reconnecting PTY.ReconnectingPtyMinsint16 `db:"reconnecting_pty_mins" json:"reconnecting_pty_mins"`// Total minutes the user has been using VSCode.VscodeMinsint16 `db:"vscode_mins" json:"vscode_mins"`// Total minutes the user has been using JetBrains.JetbrainsMinsint16 `db:"jetbrains_mins" json:"jetbrains_mins"`// Object with app names as keys and total minutes used as values. Null means no app usage was recorded.AppUsageMinsStringMapOfInt `db:"app_usage_mins" json:"app_usage_mins"`}
Records aggregated usage statistics for templates/users. All usage is rounded up to the nearest minute.
typeTemplateUser¶
typeTemplateVersion¶
type TemplateVersion struct {IDuuid.UUID `db:"id" json:"id"`TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Namestring `db:"name" json:"name"`Readmestring `db:"readme" json:"readme"`JobIDuuid.UUID `db:"job_id" json:"job_id"`CreatedByuuid.UUID `db:"created_by" json:"created_by"`ExternalAuthProvidersjson.RawMessage `db:"external_auth_providers" json:"external_auth_providers"`Messagestring `db:"message" json:"message"`Archivedbool `db:"archived" json:"archived"`SourceExampleIDsql.NullString `db:"source_example_id" json:"source_example_id"`CreatedByAvatarURLstring `db:"created_by_avatar_url" json:"created_by_avatar_url"`CreatedByUsernamestring `db:"created_by_username" json:"created_by_username"`CreatedByNamestring `db:"created_by_name" json:"created_by_name"`}
Joins in the username + avatar url of the created by user.
func (TemplateVersion)RBACObject¶
func (TemplateVersion) RBACObject(templateTemplate)rbac.Object
func (TemplateVersion)RBACObjectNoTemplate¶
func (vTemplateVersion) RBACObjectNoTemplate()rbac.Object
RBACObjectNoTemplate is for orphaned template versions.
typeTemplateVersionParameter¶
type TemplateVersionParameter struct {TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`// Parameter nameNamestring `db:"name" json:"name"`// Parameter descriptionDescriptionstring `db:"description" json:"description"`// Parameter typeTypestring `db:"type" json:"type"`// Is parameter mutable?Mutablebool `db:"mutable" json:"mutable"`// Default valueDefaultValuestring `db:"default_value" json:"default_value"`// IconIconstring `db:"icon" json:"icon"`// Additional optionsOptionsjson.RawMessage `db:"options" json:"options"`// Validation: regex patternValidationRegexstring `db:"validation_regex" json:"validation_regex"`// Validation: minimum length of valueValidationMinsql.NullInt32 `db:"validation_min" json:"validation_min"`// Validation: maximum length of valueValidationMaxsql.NullInt32 `db:"validation_max" json:"validation_max"`// Validation: error displayed when the regex does not match.ValidationErrorstring `db:"validation_error" json:"validation_error"`// Validation: consecutive values preserve the monotonic orderValidationMonotonicstring `db:"validation_monotonic" json:"validation_monotonic"`// Is parameter required?Requiredbool `db:"required" json:"required"`// Display name of the rich parameterDisplayNamestring `db:"display_name" json:"display_name"`// Specifies the order in which to display parameters in user interfaces.DisplayOrderint32 `db:"display_order" json:"display_order"`// The value of an ephemeral parameter will not be preserved between consecutive workspace builds.Ephemeralbool `db:"ephemeral" json:"ephemeral"`}
typeTemplateVersionPreset¶added inv2.20.0
type TemplateVersionPreset struct {IDuuid.UUID `db:"id" json:"id"`TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`Namestring `db:"name" json:"name"`CreatedAttime.Time `db:"created_at" json:"created_at"`DesiredInstancessql.NullInt32 `db:"desired_instances" json:"desired_instances"`InvalidateAfterSecssql.NullInt32 `db:"invalidate_after_secs" json:"invalidate_after_secs"`PrebuildStatusPrebuildStatus `db:"prebuild_status" json:"prebuild_status"`}
typeTemplateVersionPresetParameter¶added inv2.20.0
typeTemplateVersionTable¶
type TemplateVersionTable struct {IDuuid.UUID `db:"id" json:"id"`TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Namestring `db:"name" json:"name"`Readmestring `db:"readme" json:"readme"`JobIDuuid.UUID `db:"job_id" json:"job_id"`CreatedByuuid.UUID `db:"created_by" json:"created_by"`// IDs of External auth providers for a specific template versionExternalAuthProvidersjson.RawMessage `db:"external_auth_providers" json:"external_auth_providers"`// Message describing the changes in this version of the template, similar to a Git commit message. Like a commit message, this should be a short, high-level description of the changes in this version of the template. This message is immutable and should not be updated after the fact.Messagestring `db:"message" json:"message"`Archivedbool `db:"archived" json:"archived"`SourceExampleIDsql.NullString `db:"source_example_id" json:"source_example_id"`}
typeTemplateVersionTerraformValue¶added inv2.21.0
type TemplateVersionTerraformValue struct {TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`CachedPlanjson.RawMessage `db:"cached_plan" json:"cached_plan"`CachedModuleFilesuuid.NullUUID `db:"cached_module_files" json:"cached_module_files"`// What version of the provisioning engine was used to generate the cached plan and module files.ProvisionerdVersionstring `db:"provisionerd_version" json:"provisionerd_version"`}
typeTemplateVersionVariable¶
type TemplateVersionVariable struct {TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`// Variable nameNamestring `db:"name" json:"name"`// Variable descriptionDescriptionstring `db:"description" json:"description"`// Variable typeTypestring `db:"type" json:"type"`// Variable valueValuestring `db:"value" json:"value"`// Variable default valueDefaultValuestring `db:"default_value" json:"default_value"`// Required variables needs a default value or a value provided by template adminRequiredbool `db:"required" json:"required"`// Sensitive variables have their values redacted in logs or site UISensitivebool `db:"sensitive" json:"sensitive"`}
typeTemplateVersionWorkspaceTag¶added inv2.12.0
typeTxOptions¶added inv2.17.0
type TxOptions struct {// Isolation is the transaction isolation level.// If zero, the driver or database's default level is used.Isolationsql.IsolationLevelReadOnlybool// -- Coder specific metadata --// TxIdentifier is a unique identifier for the transaction to be used// in metrics. Can be any string.TxIdentifierstring// contains filtered or unexported fields}
TxOptions is used to pass some execution metadata to the callers.Ideally we could throw this into a context, but no context is used fortransactions. So instead, the return context is attached to the optionspassed in.This metadata should not be returned in the method signature, because itis only used for metric tracking. It should never be used by business logic.
funcDefaultTXOptions¶added inv2.17.0
func DefaultTXOptions() *TxOptions
func (TxOptions)ExecutionCount¶added inv2.17.0
typeUnarchiveTemplateVersionParams¶added inv2.3.0
typeUniqueConstraint¶
type UniqueConstraintstring
UniqueConstraint represents a named unique constraint on a table.
const (UniqueAgentStatsPkeyUniqueConstraint = "agent_stats_pkey"// ALTER TABLE ONLY workspace_agent_stats ADD CONSTRAINT agent_stats_pkey PRIMARY KEY (id);UniqueAPIKeysPkeyUniqueConstraint = "api_keys_pkey"// ALTER TABLE ONLY api_keys ADD CONSTRAINT api_keys_pkey PRIMARY KEY (id);UniqueAuditLogsPkeyUniqueConstraint = "audit_logs_pkey"// ALTER TABLE ONLY audit_logs ADD CONSTRAINT audit_logs_pkey PRIMARY KEY (id);UniqueChatMessagesPkeyUniqueConstraint = "chat_messages_pkey"// ALTER TABLE ONLY chat_messages ADD CONSTRAINT chat_messages_pkey PRIMARY KEY (id);UniqueChatsPkeyUniqueConstraint = "chats_pkey"// ALTER TABLE ONLY chats ADD CONSTRAINT chats_pkey PRIMARY KEY (id);UniqueCryptoKeysPkeyUniqueConstraint = "crypto_keys_pkey"// ALTER TABLE ONLY crypto_keys ADD CONSTRAINT crypto_keys_pkey PRIMARY KEY (feature, sequence);UniqueCustomRolesUniqueKeyUniqueConstraint = "custom_roles_unique_key"// ALTER TABLE ONLY custom_roles ADD CONSTRAINT custom_roles_unique_key UNIQUE (name, organization_id);UniqueDbcryptKeysActiveKeyDigestKeyUniqueConstraint = "dbcrypt_keys_active_key_digest_key"// ALTER TABLE ONLY dbcrypt_keys ADD CONSTRAINT dbcrypt_keys_active_key_digest_key UNIQUE (active_key_digest);UniqueDbcryptKeysPkeyUniqueConstraint = "dbcrypt_keys_pkey"// ALTER TABLE ONLY dbcrypt_keys ADD CONSTRAINT dbcrypt_keys_pkey PRIMARY KEY (number);UniqueDbcryptKeysRevokedKeyDigestKeyUniqueConstraint = "dbcrypt_keys_revoked_key_digest_key"// ALTER TABLE ONLY dbcrypt_keys ADD CONSTRAINT dbcrypt_keys_revoked_key_digest_key UNIQUE (revoked_key_digest);UniqueFilesHashCreatedByKeyUniqueConstraint = "files_hash_created_by_key"// ALTER TABLE ONLY files ADD CONSTRAINT files_hash_created_by_key UNIQUE (hash, created_by);UniqueFilesPkeyUniqueConstraint = "files_pkey"// ALTER TABLE ONLY files ADD CONSTRAINT files_pkey PRIMARY KEY (id);UniqueGitAuthLinksProviderIDUserIDKeyUniqueConstraint = "git_auth_links_provider_id_user_id_key"// ALTER TABLE ONLY external_auth_links ADD CONSTRAINT git_auth_links_provider_id_user_id_key UNIQUE (provider_id, user_id);UniqueGitSSHKeysPkeyUniqueConstraint = "gitsshkeys_pkey"// ALTER TABLE ONLY gitsshkeys ADD CONSTRAINT gitsshkeys_pkey PRIMARY KEY (user_id);UniqueGroupMembersUserIDGroupIDKeyUniqueConstraint = "group_members_user_id_group_id_key"// ALTER TABLE ONLY group_members ADD CONSTRAINT group_members_user_id_group_id_key UNIQUE (user_id, group_id);UniqueGroupsNameOrganizationIDKeyUniqueConstraint = "groups_name_organization_id_key"// ALTER TABLE ONLY groups ADD CONSTRAINT groups_name_organization_id_key UNIQUE (name, organization_id);UniqueGroupsPkeyUniqueConstraint = "groups_pkey"// ALTER TABLE ONLY groups ADD CONSTRAINT groups_pkey PRIMARY KEY (id);UniqueInboxNotificationsPkeyUniqueConstraint = "inbox_notifications_pkey"// ALTER TABLE ONLY inbox_notifications ADD CONSTRAINT inbox_notifications_pkey PRIMARY KEY (id);UniqueJfrogXrayScansPkeyUniqueConstraint = "jfrog_xray_scans_pkey"// ALTER TABLE ONLY jfrog_xray_scans ADD CONSTRAINT jfrog_xray_scans_pkey PRIMARY KEY (agent_id, workspace_id);UniqueLicensesJWTKeyUniqueConstraint = "licenses_jwt_key"// ALTER TABLE ONLY licenses ADD CONSTRAINT licenses_jwt_key UNIQUE (jwt);UniqueLicensesPkeyUniqueConstraint = "licenses_pkey"// ALTER TABLE ONLY licenses ADD CONSTRAINT licenses_pkey PRIMARY KEY (id);UniqueNotificationMessagesPkeyUniqueConstraint = "notification_messages_pkey"// ALTER TABLE ONLY notification_messages ADD CONSTRAINT notification_messages_pkey PRIMARY KEY (id);UniqueNotificationPreferencesPkeyUniqueConstraint = "notification_preferences_pkey"// ALTER TABLE ONLY notification_preferences ADD CONSTRAINT notification_preferences_pkey PRIMARY KEY (user_id, notification_template_id);UniqueNotificationReportGeneratorLogsPkeyUniqueConstraint = "notification_report_generator_logs_pkey"// ALTER TABLE ONLY notification_report_generator_logs ADD CONSTRAINT notification_report_generator_logs_pkey PRIMARY KEY (notification_template_id);UniqueNotificationTemplatesNameKeyUniqueConstraint = "notification_templates_name_key"// ALTER TABLE ONLY notification_templates ADD CONSTRAINT notification_templates_name_key UNIQUE (name);UniqueNotificationTemplatesPkeyUniqueConstraint = "notification_templates_pkey"// ALTER TABLE ONLY notification_templates ADD CONSTRAINT notification_templates_pkey PRIMARY KEY (id);UniqueOauth2ProviderAppCodesPkeyUniqueConstraint = "oauth2_provider_app_codes_pkey"// ALTER TABLE ONLY oauth2_provider_app_codes ADD CONSTRAINT oauth2_provider_app_codes_pkey PRIMARY KEY (id);UniqueOauth2ProviderAppCodesSecretPrefixKeyUniqueConstraint = "oauth2_provider_app_codes_secret_prefix_key"// ALTER TABLE ONLY oauth2_provider_app_codes ADD CONSTRAINT oauth2_provider_app_codes_secret_prefix_key UNIQUE (secret_prefix);UniqueOauth2ProviderAppSecretsPkeyUniqueConstraint = "oauth2_provider_app_secrets_pkey"// ALTER TABLE ONLY oauth2_provider_app_secrets ADD CONSTRAINT oauth2_provider_app_secrets_pkey PRIMARY KEY (id);UniqueOauth2ProviderAppSecretsSecretPrefixKeyUniqueConstraint = "oauth2_provider_app_secrets_secret_prefix_key"// ALTER TABLE ONLY oauth2_provider_app_secrets ADD CONSTRAINT oauth2_provider_app_secrets_secret_prefix_key UNIQUE (secret_prefix);UniqueOauth2ProviderAppTokensHashPrefixKeyUniqueConstraint = "oauth2_provider_app_tokens_hash_prefix_key"// ALTER TABLE ONLY oauth2_provider_app_tokens ADD CONSTRAINT oauth2_provider_app_tokens_hash_prefix_key UNIQUE (hash_prefix);UniqueOauth2ProviderAppTokensPkeyUniqueConstraint = "oauth2_provider_app_tokens_pkey"// ALTER TABLE ONLY oauth2_provider_app_tokens ADD CONSTRAINT oauth2_provider_app_tokens_pkey PRIMARY KEY (id);UniqueOauth2ProviderAppsNameKeyUniqueConstraint = "oauth2_provider_apps_name_key"// ALTER TABLE ONLY oauth2_provider_apps ADD CONSTRAINT oauth2_provider_apps_name_key UNIQUE (name);UniqueOauth2ProviderAppsPkeyUniqueConstraint = "oauth2_provider_apps_pkey"// ALTER TABLE ONLY oauth2_provider_apps ADD CONSTRAINT oauth2_provider_apps_pkey PRIMARY KEY (id);UniqueOrganizationMembersPkeyUniqueConstraint = "organization_members_pkey"// ALTER TABLE ONLY organization_members ADD CONSTRAINT organization_members_pkey PRIMARY KEY (organization_id, user_id);UniqueOrganizationsPkeyUniqueConstraint = "organizations_pkey"// ALTER TABLE ONLY organizations ADD CONSTRAINT organizations_pkey PRIMARY KEY (id);UniqueParameterSchemasJobIDNameKeyUniqueConstraint = "parameter_schemas_job_id_name_key"// ALTER TABLE ONLY parameter_schemas ADD CONSTRAINT parameter_schemas_job_id_name_key UNIQUE (job_id, name);UniqueParameterSchemasPkeyUniqueConstraint = "parameter_schemas_pkey"// ALTER TABLE ONLY parameter_schemas ADD CONSTRAINT parameter_schemas_pkey PRIMARY KEY (id);UniqueParameterValuesPkeyUniqueConstraint = "parameter_values_pkey"// ALTER TABLE ONLY parameter_values ADD CONSTRAINT parameter_values_pkey PRIMARY KEY (id);UniqueParameterValuesScopeIDNameKeyUniqueConstraint = "parameter_values_scope_id_name_key"// ALTER TABLE ONLY parameter_values ADD CONSTRAINT parameter_values_scope_id_name_key UNIQUE (scope_id, name);UniqueProvisionerDaemonsPkeyUniqueConstraint = "provisioner_daemons_pkey"// ALTER TABLE ONLY provisioner_daemons ADD CONSTRAINT provisioner_daemons_pkey PRIMARY KEY (id);UniqueProvisionerJobLogsPkeyUniqueConstraint = "provisioner_job_logs_pkey"// ALTER TABLE ONLY provisioner_job_logs ADD CONSTRAINT provisioner_job_logs_pkey PRIMARY KEY (id);UniqueProvisionerJobsPkeyUniqueConstraint = "provisioner_jobs_pkey"// ALTER TABLE ONLY provisioner_jobs ADD CONSTRAINT provisioner_jobs_pkey PRIMARY KEY (id);UniqueProvisionerKeysPkeyUniqueConstraint = "provisioner_keys_pkey"// ALTER TABLE ONLY provisioner_keys ADD CONSTRAINT provisioner_keys_pkey PRIMARY KEY (id);UniqueSiteConfigsKeyKeyUniqueConstraint = "site_configs_key_key"// ALTER TABLE ONLY site_configs ADD CONSTRAINT site_configs_key_key UNIQUE (key);UniqueTailnetAgentsPkeyUniqueConstraint = "tailnet_agents_pkey"// ALTER TABLE ONLY tailnet_agents ADD CONSTRAINT tailnet_agents_pkey PRIMARY KEY (id, coordinator_id);UniqueTailnetClientSubscriptionsPkeyUniqueConstraint = "tailnet_client_subscriptions_pkey"// ALTER TABLE ONLY tailnet_client_subscriptions ADD CONSTRAINT tailnet_client_subscriptions_pkey PRIMARY KEY (client_id, coordinator_id, agent_id);UniqueTailnetClientsPkeyUniqueConstraint = "tailnet_clients_pkey"// ALTER TABLE ONLY tailnet_clients ADD CONSTRAINT tailnet_clients_pkey PRIMARY KEY (id, coordinator_id);UniqueTailnetCoordinatorsPkeyUniqueConstraint = "tailnet_coordinators_pkey"// ALTER TABLE ONLY tailnet_coordinators ADD CONSTRAINT tailnet_coordinators_pkey PRIMARY KEY (id);UniqueTailnetPeersPkeyUniqueConstraint = "tailnet_peers_pkey"// ALTER TABLE ONLY tailnet_peers ADD CONSTRAINT tailnet_peers_pkey PRIMARY KEY (id, coordinator_id);UniqueTailnetTunnelsPkeyUniqueConstraint = "tailnet_tunnels_pkey"// ALTER TABLE ONLY tailnet_tunnels ADD CONSTRAINT tailnet_tunnels_pkey PRIMARY KEY (coordinator_id, src_id, dst_id);UniqueTelemetryItemsPkeyUniqueConstraint = "telemetry_items_pkey"// ALTER TABLE ONLY telemetry_items ADD CONSTRAINT telemetry_items_pkey PRIMARY KEY (key);UniqueTemplateUsageStatsPkeyUniqueConstraint = "template_usage_stats_pkey"// ALTER TABLE ONLY template_usage_stats ADD CONSTRAINT template_usage_stats_pkey PRIMARY KEY (start_time, template_id, user_id);UniqueTemplateVersionParametersTemplateVersionIDNameKeyUniqueConstraint = "template_version_parameters_template_version_id_name_key"// ALTER TABLE ONLY template_version_parameters ADD CONSTRAINT template_version_parameters_template_version_id_name_key UNIQUE (template_version_id, name);UniqueTemplateVersionPresetParametersPkeyUniqueConstraint = "template_version_preset_parameters_pkey"// ALTER TABLE ONLY template_version_preset_parameters ADD CONSTRAINT template_version_preset_parameters_pkey PRIMARY KEY (id);UniqueTemplateVersionPresetsPkeyUniqueConstraint = "template_version_presets_pkey"// ALTER TABLE ONLY template_version_presets ADD CONSTRAINT template_version_presets_pkey PRIMARY KEY (id);UniqueTemplateVersionTerraformValuesTemplateVersionIDKeyUniqueConstraint = "template_version_terraform_values_template_version_id_key"// ALTER TABLE ONLY template_version_terraform_values ADD CONSTRAINT template_version_terraform_values_template_version_id_key UNIQUE (template_version_id);UniqueTemplateVersionVariablesTemplateVersionIDNameKeyUniqueConstraint = "template_version_variables_template_version_id_name_key"// ALTER TABLE ONLY template_version_variables ADD CONSTRAINT template_version_variables_template_version_id_name_key UNIQUE (template_version_id, name);UniqueTemplateVersionWorkspaceTagsTemplateVersionIDKeyKeyUniqueConstraint = "template_version_workspace_tags_template_version_id_key_key"// ALTER TABLE ONLY template_version_workspace_tags ADD CONSTRAINT template_version_workspace_tags_template_version_id_key_key UNIQUE (template_version_id, key);UniqueTemplateVersionsPkeyUniqueConstraint = "template_versions_pkey"// ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_pkey PRIMARY KEY (id);UniqueTemplateVersionsTemplateIDNameKeyUniqueConstraint = "template_versions_template_id_name_key"// ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_template_id_name_key UNIQUE (template_id, name);UniqueTemplatesPkeyUniqueConstraint = "templates_pkey"// ALTER TABLE ONLY templates ADD CONSTRAINT templates_pkey PRIMARY KEY (id);UniqueUserConfigsPkeyUniqueConstraint = "user_configs_pkey"// ALTER TABLE ONLY user_configs ADD CONSTRAINT user_configs_pkey PRIMARY KEY (user_id, key);UniqueUserDeletedPkeyUniqueConstraint = "user_deleted_pkey"// ALTER TABLE ONLY user_deleted ADD CONSTRAINT user_deleted_pkey PRIMARY KEY (id);UniqueUserLinksPkeyUniqueConstraint = "user_links_pkey"// ALTER TABLE ONLY user_links ADD CONSTRAINT user_links_pkey PRIMARY KEY (user_id, login_type);UniqueUserStatusChangesPkeyUniqueConstraint = "user_status_changes_pkey"// ALTER TABLE ONLY user_status_changes ADD CONSTRAINT user_status_changes_pkey PRIMARY KEY (id);UniqueUsersPkeyUniqueConstraint = "users_pkey"// ALTER TABLE ONLY users ADD CONSTRAINT users_pkey PRIMARY KEY (id);UniqueWebpushSubscriptionsPkeyUniqueConstraint = "webpush_subscriptions_pkey"// ALTER TABLE ONLY webpush_subscriptions ADD CONSTRAINT webpush_subscriptions_pkey PRIMARY KEY (id);UniqueWorkspaceAgentDevcontainersPkeyUniqueConstraint = "workspace_agent_devcontainers_pkey"// ALTER TABLE ONLY workspace_agent_devcontainers ADD CONSTRAINT workspace_agent_devcontainers_pkey PRIMARY KEY (id);UniqueWorkspaceAgentLogSourcesPkeyUniqueConstraint = "workspace_agent_log_sources_pkey"// ALTER TABLE ONLY workspace_agent_log_sources ADD CONSTRAINT workspace_agent_log_sources_pkey PRIMARY KEY (workspace_agent_id, id);UniqueWorkspaceAgentMemoryResourceMonitorsPkeyUniqueConstraint = "workspace_agent_memory_resource_monitors_pkey"// ALTER TABLE ONLY workspace_agent_memory_resource_monitors ADD CONSTRAINT workspace_agent_memory_resource_monitors_pkey PRIMARY KEY (agent_id);UniqueWorkspaceAgentMetadataPkeyUniqueConstraint = "workspace_agent_metadata_pkey"// ALTER TABLE ONLY workspace_agent_metadata ADD CONSTRAINT workspace_agent_metadata_pkey PRIMARY KEY (workspace_agent_id, key);UniqueWorkspaceAgentPortSharePkeyUniqueConstraint = "workspace_agent_port_share_pkey"// ALTER TABLE ONLY workspace_agent_port_share ADD CONSTRAINT workspace_agent_port_share_pkey PRIMARY KEY (workspace_id, agent_name, port);UniqueWorkspaceAgentScriptTimingsScriptIDStartedAtKeyUniqueConstraint = "workspace_agent_script_timings_script_id_started_at_key"// ALTER TABLE ONLY workspace_agent_script_timings ADD CONSTRAINT workspace_agent_script_timings_script_id_started_at_key UNIQUE (script_id, started_at);UniqueWorkspaceAgentScriptsIDKeyUniqueConstraint = "workspace_agent_scripts_id_key"// ALTER TABLE ONLY workspace_agent_scripts ADD CONSTRAINT workspace_agent_scripts_id_key UNIQUE (id);UniqueWorkspaceAgentStartupLogsPkeyUniqueConstraint = "workspace_agent_startup_logs_pkey"// ALTER TABLE ONLY workspace_agent_logs ADD CONSTRAINT workspace_agent_startup_logs_pkey PRIMARY KEY (id);UniqueWorkspaceAgentVolumeResourceMonitorsPkeyUniqueConstraint = "workspace_agent_volume_resource_monitors_pkey"// ALTER TABLE ONLY workspace_agent_volume_resource_monitors ADD CONSTRAINT workspace_agent_volume_resource_monitors_pkey PRIMARY KEY (agent_id, path);UniqueWorkspaceAgentsPkeyUniqueConstraint = "workspace_agents_pkey"// ALTER TABLE ONLY workspace_agents ADD CONSTRAINT workspace_agents_pkey PRIMARY KEY (id);UniqueWorkspaceAppAuditSessionsAgentIDAppIDUserIDIpUseKeyUniqueConstraint = "workspace_app_audit_sessions_agent_id_app_id_user_id_ip_use_key"// ALTER TABLE ONLY workspace_app_audit_sessions ADD CONSTRAINT workspace_app_audit_sessions_agent_id_app_id_user_id_ip_use_key UNIQUE (agent_id, app_id, user_id, ip, user_agent, slug_or_port, status_code);UniqueWorkspaceAppAuditSessionsPkeyUniqueConstraint = "workspace_app_audit_sessions_pkey"// ALTER TABLE ONLY workspace_app_audit_sessions ADD CONSTRAINT workspace_app_audit_sessions_pkey PRIMARY KEY (id);UniqueWorkspaceAppStatsPkeyUniqueConstraint = "workspace_app_stats_pkey"// ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_pkey PRIMARY KEY (id);UniqueWorkspaceAppStatsUserIDAgentIDSessionIDKeyUniqueConstraint = "workspace_app_stats_user_id_agent_id_session_id_key"// ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_user_id_agent_id_session_id_key UNIQUE (user_id, agent_id, session_id);UniqueWorkspaceAppStatusesPkeyUniqueConstraint = "workspace_app_statuses_pkey"// ALTER TABLE ONLY workspace_app_statuses ADD CONSTRAINT workspace_app_statuses_pkey PRIMARY KEY (id);UniqueWorkspaceAppsAgentIDSlugIndexUniqueConstraint = "workspace_apps_agent_id_slug_idx"// ALTER TABLE ONLY workspace_apps ADD CONSTRAINT workspace_apps_agent_id_slug_idx UNIQUE (agent_id, slug);UniqueWorkspaceAppsPkeyUniqueConstraint = "workspace_apps_pkey"// ALTER TABLE ONLY workspace_apps ADD CONSTRAINT workspace_apps_pkey PRIMARY KEY (id);UniqueWorkspaceBuildParametersWorkspaceBuildIDNameKeyUniqueConstraint = "workspace_build_parameters_workspace_build_id_name_key"// ALTER TABLE ONLY workspace_build_parameters ADD CONSTRAINT workspace_build_parameters_workspace_build_id_name_key UNIQUE (workspace_build_id, name);UniqueWorkspaceBuildsJobIDKeyUniqueConstraint = "workspace_builds_job_id_key"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_job_id_key UNIQUE (job_id);UniqueWorkspaceBuildsPkeyUniqueConstraint = "workspace_builds_pkey"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_pkey PRIMARY KEY (id);UniqueWorkspaceBuildsWorkspaceIDBuildNumberKeyUniqueConstraint = "workspace_builds_workspace_id_build_number_key"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_workspace_id_build_number_key UNIQUE (workspace_id, build_number);UniqueWorkspaceProxiesPkeyUniqueConstraint = "workspace_proxies_pkey"// ALTER TABLE ONLY workspace_proxies ADD CONSTRAINT workspace_proxies_pkey PRIMARY KEY (id);UniqueWorkspaceProxiesRegionIDUniqueUniqueConstraint = "workspace_proxies_region_id_unique"// ALTER TABLE ONLY workspace_proxies ADD CONSTRAINT workspace_proxies_region_id_unique UNIQUE (region_id);UniqueWorkspaceResourceMetadataNameUniqueConstraint = "workspace_resource_metadata_name"// ALTER TABLE ONLY workspace_resource_metadata ADD CONSTRAINT workspace_resource_metadata_name UNIQUE (workspace_resource_id, key);UniqueWorkspaceResourceMetadataPkeyUniqueConstraint = "workspace_resource_metadata_pkey"// ALTER TABLE ONLY workspace_resource_metadata ADD CONSTRAINT workspace_resource_metadata_pkey PRIMARY KEY (id);UniqueWorkspaceResourcesPkeyUniqueConstraint = "workspace_resources_pkey"// ALTER TABLE ONLY workspace_resources ADD CONSTRAINT workspace_resources_pkey PRIMARY KEY (id);UniqueWorkspacesPkeyUniqueConstraint = "workspaces_pkey"// ALTER TABLE ONLY workspaces ADD CONSTRAINT workspaces_pkey PRIMARY KEY (id);UniqueIndexAPIKeyNameUniqueConstraint = "idx_api_key_name"// CREATE UNIQUE INDEX idx_api_key_name ON api_keys USING btree (user_id, token_name) WHERE (login_type = 'token'::login_type);UniqueIndexCustomRolesNameLowerUniqueConstraint = "idx_custom_roles_name_lower"// CREATE UNIQUE INDEX idx_custom_roles_name_lower ON custom_roles USING btree (lower(name));UniqueIndexOrganizationNameLowerUniqueConstraint = "idx_organization_name_lower"// CREATE UNIQUE INDEX idx_organization_name_lower ON organizations USING btree (lower(name)) WHERE (deleted = false);UniqueIndexProvisionerDaemonsOrgNameOwnerKeyUniqueConstraint = "idx_provisioner_daemons_org_name_owner_key"// CREATE UNIQUE INDEX idx_provisioner_daemons_org_name_owner_key ON provisioner_daemons USING btree (organization_id, name, lower(COALESCE((tags ->> 'owner'::text), ”::text)));UniqueIndexUniquePresetNameUniqueConstraint = "idx_unique_preset_name"// CREATE UNIQUE INDEX idx_unique_preset_name ON template_version_presets USING btree (name, template_version_id);UniqueIndexUsersEmailUniqueConstraint = "idx_users_email"// CREATE UNIQUE INDEX idx_users_email ON users USING btree (email) WHERE (deleted = false);UniqueIndexUsersUsernameUniqueConstraint = "idx_users_username"// CREATE UNIQUE INDEX idx_users_username ON users USING btree (username) WHERE (deleted = false);UniqueNotificationMessagesDedupeHashIndexUniqueConstraint = "notification_messages_dedupe_hash_idx"// CREATE UNIQUE INDEX notification_messages_dedupe_hash_idx ON notification_messages USING btree (dedupe_hash);UniqueOrganizationsSingleDefaultOrgUniqueConstraint = "organizations_single_default_org"// CREATE UNIQUE INDEX organizations_single_default_org ON organizations USING btree (is_default) WHERE (is_default = true);UniqueProvisionerKeysOrganizationIDNameIndexUniqueConstraint = "provisioner_keys_organization_id_name_idx"// CREATE UNIQUE INDEX provisioner_keys_organization_id_name_idx ON provisioner_keys USING btree (organization_id, lower((name)::text));UniqueTemplateUsageStatsStartTimeTemplateIDUserIDIndexUniqueConstraint = "template_usage_stats_start_time_template_id_user_id_idx"// CREATE UNIQUE INDEX template_usage_stats_start_time_template_id_user_id_idx ON template_usage_stats USING btree (start_time, template_id, user_id);UniqueTemplatesOrganizationIDNameIndexUniqueConstraint = "templates_organization_id_name_idx"// CREATE UNIQUE INDEX templates_organization_id_name_idx ON templates USING btree (organization_id, lower((name)::text)) WHERE (deleted = false);UniqueUserLinksLinkedIDLoginTypeIndexUniqueConstraint = "user_links_linked_id_login_type_idx"// CREATE UNIQUE INDEX user_links_linked_id_login_type_idx ON user_links USING btree (linked_id, login_type) WHERE (linked_id <> ”::text);UniqueUsersEmailLowerIndexUniqueConstraint = "users_email_lower_idx"// CREATE UNIQUE INDEX users_email_lower_idx ON users USING btree (lower(email)) WHERE (deleted = false);UniqueUsersUsernameLowerIndexUniqueConstraint = "users_username_lower_idx"// CREATE UNIQUE INDEX users_username_lower_idx ON users USING btree (lower(username)) WHERE (deleted = false);UniqueWorkspaceAppAuditSessionsUniqueIndexUniqueConstraint = "workspace_app_audit_sessions_unique_index"// CREATE UNIQUE INDEX workspace_app_audit_sessions_unique_index ON workspace_app_audit_sessions USING btree (agent_id, app_id, user_id, ip, user_agent, slug_or_port, status_code);UniqueWorkspaceProxiesLowerNameIndexUniqueConstraint = "workspace_proxies_lower_name_idx"// CREATE UNIQUE INDEX workspace_proxies_lower_name_idx ON workspace_proxies USING btree (lower(name)) WHERE (deleted = false);UniqueWorkspacesOwnerIDLowerIndexUniqueConstraint = "workspaces_owner_id_lower_idx"// CREATE UNIQUE INDEX workspaces_owner_id_lower_idx ON workspaces USING btree (owner_id, lower((name)::text)) WHERE (deleted = false);)
UniqueConstraint enums.
typeUpdateChatByIDParams¶added inv2.23.0
typeUpdateCryptoKeyDeletesAtParams¶added inv2.16.0
type UpdateCryptoKeyDeletesAtParams struct {FeatureCryptoKeyFeature `db:"feature" json:"feature"`Sequenceint32 `db:"sequence" json:"sequence"`DeletesAtsql.NullTime `db:"deletes_at" json:"deletes_at"`}
typeUpdateCustomRoleParams¶added inv2.15.0
type UpdateCustomRoleParams struct {DisplayNamestring `db:"display_name" json:"display_name"`SitePermissionsCustomRolePermissions `db:"site_permissions" json:"site_permissions"`OrgPermissionsCustomRolePermissions `db:"org_permissions" json:"org_permissions"`UserPermissionsCustomRolePermissions `db:"user_permissions" json:"user_permissions"`Namestring `db:"name" json:"name"`OrganizationIDuuid.NullUUID `db:"organization_id" json:"organization_id"`}
typeUpdateExternalAuthLinkParams¶added inv2.2.1
type UpdateExternalAuthLinkParams struct {ProviderIDstring `db:"provider_id" json:"provider_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`OAuthAccessTokenstring `db:"oauth_access_token" json:"oauth_access_token"`OAuthAccessTokenKeyIDsql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"`OAuthRefreshTokenstring `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthRefreshTokenKeyIDsql.NullString `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"`OAuthExpirytime.Time `db:"oauth_expiry" json:"oauth_expiry"`OAuthExtrapqtype.NullRawMessage `db:"oauth_extra" json:"oauth_extra"`}
typeUpdateExternalAuthLinkRefreshTokenParams¶added inv2.18.0
type UpdateExternalAuthLinkRefreshTokenParams struct {OAuthRefreshTokenstring `db:"oauth_refresh_token" json:"oauth_refresh_token"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`ProviderIDstring `db:"provider_id" json:"provider_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`OAuthRefreshTokenKeyIDstring `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"`}
typeUpdateInboxNotificationReadStatusParams¶added inv2.21.0
typeUpdateMemoryResourceMonitorParams¶added inv2.20.0
typeUpdateNotificationTemplateMethodByIDParams¶added inv2.15.0
type UpdateNotificationTemplateMethodByIDParams struct {MethodNullNotificationMethod `db:"method" json:"method"`IDuuid.UUID `db:"id" json:"id"`}
typeUpdateOAuth2ProviderAppByIDParams¶added inv2.6.0
typeUpdateOAuth2ProviderAppSecretByIDParams¶added inv2.6.0
typeUpdateOrganizationDeletedByIDParams¶added inv2.20.0
typeUpdateOrganizationParams¶added inv2.12.0
type UpdateOrganizationParams struct {UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Namestring `db:"name" json:"name"`DisplayNamestring `db:"display_name" json:"display_name"`Descriptionstring `db:"description" json:"description"`Iconstring `db:"icon" json:"icon"`IDuuid.UUID `db:"id" json:"id"`}
typeUpdatePresetPrebuildStatusParams¶added inv2.23.0
type UpdatePresetPrebuildStatusParams struct {StatusPrebuildStatus `db:"status" json:"status"`PresetIDuuid.UUID `db:"preset_id" json:"preset_id"`}
typeUpdateProvisionerDaemonLastSeenAtParams¶added inv2.6.0
typeUpdateProvisionerJobWithCompleteByIDParams¶
type UpdateProvisionerJobWithCompleteByIDParams struct {IDuuid.UUID `db:"id" json:"id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`CompletedAtsql.NullTime `db:"completed_at" json:"completed_at"`Errorsql.NullString `db:"error" json:"error"`ErrorCodesql.NullString `db:"error_code" json:"error_code"`}
typeUpdateProvisionerJobWithCompleteWithStartedAtByIDParams¶added inv2.23.0
type UpdateProvisionerJobWithCompleteWithStartedAtByIDParams struct {IDuuid.UUID `db:"id" json:"id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`CompletedAtsql.NullTime `db:"completed_at" json:"completed_at"`Errorsql.NullString `db:"error" json:"error"`ErrorCodesql.NullString `db:"error_code" json:"error_code"`StartedAtsql.NullTime `db:"started_at" json:"started_at"`}
typeUpdateReplicaParams¶
type UpdateReplicaParams struct {IDuuid.UUID `db:"id" json:"id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`StartedAttime.Time `db:"started_at" json:"started_at"`StoppedAtsql.NullTime `db:"stopped_at" json:"stopped_at"`RelayAddressstring `db:"relay_address" json:"relay_address"`RegionIDint32 `db:"region_id" json:"region_id"`Hostnamestring `db:"hostname" json:"hostname"`Versionstring `db:"version" json:"version"`Errorstring `db:"error" json:"error"`DatabaseLatencyint32 `db:"database_latency" json:"database_latency"`Primarybool `db:"primary" json:"primary"`}
typeUpdateTailnetPeerStatusByCoordinatorParams¶added inv2.15.0
type UpdateTailnetPeerStatusByCoordinatorParams struct {CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`StatusTailnetStatus `db:"status" json:"status"`}
typeUpdateTemplateACLByIDParams¶
type UpdateTemplateACLByIDParams struct {GroupACLTemplateACL `db:"group_acl" json:"group_acl"`UserACLTemplateACL `db:"user_acl" json:"user_acl"`IDuuid.UUID `db:"id" json:"id"`}
typeUpdateTemplateAccessControlByIDParams¶added inv2.3.2
typeUpdateTemplateMetaByIDParams¶
type UpdateTemplateMetaByIDParams struct {IDuuid.UUID `db:"id" json:"id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Descriptionstring `db:"description" json:"description"`Namestring `db:"name" json:"name"`Iconstring `db:"icon" json:"icon"`DisplayNamestring `db:"display_name" json:"display_name"`AllowUserCancelWorkspaceJobsbool `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"`GroupACLTemplateACL `db:"group_acl" json:"group_acl"`MaxPortSharingLevelAppSharingLevel `db:"max_port_sharing_level" json:"max_port_sharing_level"`UseClassicParameterFlowbool `db:"use_classic_parameter_flow" json:"use_classic_parameter_flow"`}
typeUpdateTemplateScheduleByIDParams¶
type UpdateTemplateScheduleByIDParams struct {IDuuid.UUID `db:"id" json:"id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`AllowUserAutostartbool `db:"allow_user_autostart" json:"allow_user_autostart"`AllowUserAutostopbool `db:"allow_user_autostop" json:"allow_user_autostop"`DefaultTTLint64 `db:"default_ttl" json:"default_ttl"`ActivityBumpint64 `db:"activity_bump" json:"activity_bump"`AutostopRequirementDaysOfWeekint16 `db:"autostop_requirement_days_of_week" json:"autostop_requirement_days_of_week"`AutostopRequirementWeeksint64 `db:"autostop_requirement_weeks" json:"autostop_requirement_weeks"`AutostartBlockDaysOfWeekint16 `db:"autostart_block_days_of_week" json:"autostart_block_days_of_week"`FailureTTLint64 `db:"failure_ttl" json:"failure_ttl"`TimeTilDormantint64 `db:"time_til_dormant" json:"time_til_dormant"`TimeTilDormantAutoDeleteint64 `db:"time_til_dormant_autodelete" json:"time_til_dormant_autodelete"`}
typeUpdateTemplateVersionExternalAuthProvidersByJobIDParams¶added inv2.2.1
typeUpdateTemplateWorkspacesLastUsedAtParams¶added inv2.1.2
typeUpdateUserGithubComUserIDParams¶added inv2.14.0
typeUpdateUserHashedOneTimePasscodeParams¶added inv2.17.0
typeUpdateUserLinkParams¶
type UpdateUserLinkParams struct {OAuthAccessTokenstring `db:"oauth_access_token" json:"oauth_access_token"`OAuthAccessTokenKeyIDsql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"`OAuthRefreshTokenstring `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthRefreshTokenKeyIDsql.NullString `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"`OAuthExpirytime.Time `db:"oauth_expiry" json:"oauth_expiry"`ClaimsUserLinkClaims `db:"claims" json:"claims"`UserIDuuid.UUID `db:"user_id" json:"user_id"`LoginTypeLoginType `db:"login_type" json:"login_type"`}
typeUpdateUserNotificationPreferencesParams¶added inv2.15.0
typeUpdateUserStatusParams¶
type UpdateUserStatusParams struct {IDuuid.UUID `db:"id" json:"id"`StatusUserStatus `db:"status" json:"status"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}
typeUpdateUserTerminalFontParams¶added inv2.22.0
typeUpdateUserThemePreferenceParams¶added inv2.22.0
typeUpdateVolumeResourceMonitorParams¶added inv2.20.0
type UpdateVolumeResourceMonitorParams struct {AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`Pathstring `db:"path" json:"path"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`StateWorkspaceAgentMonitorState `db:"state" json:"state"`DebouncedUntiltime.Time `db:"debounced_until" json:"debounced_until"`}
typeUpdateWorkspaceAgentConnectionByIDParams¶
type UpdateWorkspaceAgentConnectionByIDParams struct {IDuuid.UUID `db:"id" json:"id"`FirstConnectedAtsql.NullTime `db:"first_connected_at" json:"first_connected_at"`LastConnectedAtsql.NullTime `db:"last_connected_at" json:"last_connected_at"`LastConnectedReplicaIDuuid.NullUUID `db:"last_connected_replica_id" json:"last_connected_replica_id"`DisconnectedAtsql.NullTime `db:"disconnected_at" json:"disconnected_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}
typeUpdateWorkspaceAgentMetadataParams¶
type UpdateWorkspaceAgentMetadataParams struct {WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`Key []string `db:"key" json:"key"`Value []string `db:"value" json:"value"`Error []string `db:"error" json:"error"`CollectedAt []time.Time `db:"collected_at" json:"collected_at"`}
typeUpdateWorkspaceAgentStartupByIDParams¶
type UpdateWorkspaceAgentStartupByIDParams struct {IDuuid.UUID `db:"id" json:"id"`Versionstring `db:"version" json:"version"`ExpandedDirectorystring `db:"expanded_directory" json:"expanded_directory"`Subsystems []WorkspaceAgentSubsystem `db:"subsystems" json:"subsystems"`APIVersionstring `db:"api_version" json:"api_version"`}
typeUpdateWorkspaceAppHealthByIDParams¶
type UpdateWorkspaceAppHealthByIDParams struct {IDuuid.UUID `db:"id" json:"id"`HealthWorkspaceAppHealth `db:"health" json:"health"`}
typeUpdateWorkspaceAutomaticUpdatesParams¶added inv2.3.0
type UpdateWorkspaceAutomaticUpdatesParams struct {IDuuid.UUID `db:"id" json:"id"`AutomaticUpdatesAutomaticUpdates `db:"automatic_updates" json:"automatic_updates"`}
typeUpdateWorkspaceBuildDeadlineByIDParams¶added inv2.2.0
typeUpdateWorkspaceBuildProvisionerStateByIDParams¶added inv2.2.0
typeUpdateWorkspaceDormantDeletingAtParams¶added inv2.1.4
typeUpdateWorkspaceNextStartAtParams¶added inv2.19.0
typeUpdateWorkspacesDormantDeletingAtByTemplateIDParams¶added inv2.1.4
typeUpdateWorkspacesTTLByTemplateIDParams¶added inv2.19.0
typeUpsertNotificationReportGeneratorLogParams¶added inv2.16.0
typeUpsertProvisionerDaemonParams¶added inv2.5.1
type UpsertProvisionerDaemonParams struct {CreatedAttime.Time `db:"created_at" json:"created_at"`Namestring `db:"name" json:"name"`Provisioners []ProvisionerType `db:"provisioners" json:"provisioners"`TagsStringMap `db:"tags" json:"tags"`LastSeenAtsql.NullTime `db:"last_seen_at" json:"last_seen_at"`Versionstring `db:"version" json:"version"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`APIVersionstring `db:"api_version" json:"api_version"`KeyIDuuid.UUID `db:"key_id" json:"key_id"`}
typeUpsertRuntimeConfigParams¶added inv2.16.0
typeUpsertTailnetClientSubscriptionParams¶added inv2.2.0
typeUpsertTailnetPeerParams¶added inv2.4.0
typeUpsertTailnetTunnelParams¶added inv2.4.0
typeUpsertTelemetryItemParams¶added inv2.19.0
typeUpsertWebpushVAPIDKeysParams¶added inv2.21.0
typeUpsertWorkspaceAgentPortShareParams¶added inv2.9.0
type UpsertWorkspaceAgentPortShareParams struct {WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`AgentNamestring `db:"agent_name" json:"agent_name"`Portint32 `db:"port" json:"port"`ShareLevelAppSharingLevel `db:"share_level" json:"share_level"`ProtocolPortShareProtocol `db:"protocol" json:"protocol"`}
typeUpsertWorkspaceAppAuditSessionParams¶added inv2.21.0
type UpsertWorkspaceAppAuditSessionParams struct {IDuuid.UUID `db:"id" json:"id"`AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`AppIDuuid.UUID `db:"app_id" json:"app_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`Ipstring `db:"ip" json:"ip"`UserAgentstring `db:"user_agent" json:"user_agent"`SlugOrPortstring `db:"slug_or_port" json:"slug_or_port"`StatusCodeint32 `db:"status_code" json:"status_code"`StartedAttime.Time `db:"started_at" json:"started_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`StaleIntervalMSint64 `db:"stale_interval_ms" json:"stale_interval_ms"`}
typeUser¶
type User struct {IDuuid.UUID `db:"id" json:"id"`Emailstring `db:"email" json:"email"`Usernamestring `db:"username" json:"username"`HashedPassword []byte `db:"hashed_password" json:"hashed_password"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`StatusUserStatus `db:"status" json:"status"`RBACRolespq.StringArray `db:"rbac_roles" json:"rbac_roles"`LoginTypeLoginType `db:"login_type" json:"login_type"`AvatarURLstring `db:"avatar_url" json:"avatar_url"`Deletedbool `db:"deleted" json:"deleted"`LastSeenAttime.Time `db:"last_seen_at" json:"last_seen_at"`// Daily (!) cron schedule (with optional CRON_TZ) signifying the start of the user's quiet hours. If empty, the default quiet hours on the instance is used instead.QuietHoursSchedulestring `db:"quiet_hours_schedule" json:"quiet_hours_schedule"`// Name of the Coder userNamestring `db:"name" json:"name"`// The GitHub.com numerical user ID. It is used to check if the user has starred the Coder repository. It is also used for filtering users in the users list CLI command, and may become more widely used in the future.GithubComUserIDsql.NullInt64 `db:"github_com_user_id" json:"github_com_user_id"`// A hash of the one-time-passcode given to the user.HashedOneTimePasscode []byte `db:"hashed_one_time_passcode" json:"hashed_one_time_passcode"`// The time when the one-time-passcode expires.OneTimePasscodeExpiresAtsql.NullTime `db:"one_time_passcode_expires_at" json:"one_time_passcode_expires_at"`// Determines if a user is a system user, and therefore cannot login or perform normal actionsIsSystembool `db:"is_system" json:"is_system"`}
funcConvertUserRows¶
func ConvertUserRows(rows []GetUsersRow) []User
func (User)RBACObject¶
RBACObject returns the RBAC object for the site wide user resource.
typeUserConfig¶added inv2.21.0
typeUserDeleted¶added inv2.19.0
type UserDeleted struct {IDuuid.UUID `db:"id" json:"id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`DeletedAttime.Time `db:"deleted_at" json:"deleted_at"`}
Tracks when users were deleted
typeUserLink¶
type UserLink struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`LoginTypeLoginType `db:"login_type" json:"login_type"`LinkedIDstring `db:"linked_id" json:"linked_id"`OAuthAccessTokenstring `db:"oauth_access_token" json:"oauth_access_token"`OAuthRefreshTokenstring `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthExpirytime.Time `db:"oauth_expiry" json:"oauth_expiry"`// The ID of the key used to encrypt the OAuth access token. If this is NULL, the access token is not encryptedOAuthAccessTokenKeyIDsql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"`// The ID of the key used to encrypt the OAuth refresh token. If this is NULL, the refresh token is not encryptedOAuthRefreshTokenKeyIDsql.NullString `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"`// Claims from the IDP for the linked user. Includes both id_token and userinfo claims.ClaimsUserLinkClaims `db:"claims" json:"claims"`}
func (UserLink)RBACObject¶
typeUserLinkClaims¶added inv2.18.0
type UserLinkClaims struct {IDTokenClaims map[string]interface{} `json:"id_token_claims"`UserInfoClaims map[string]interface{} `json:"user_info_claims"`// MergeClaims are computed in Golang. It is the result of merging// the IDTokenClaims and UserInfoClaims. UserInfoClaims take precedence.MergedClaims map[string]interface{} `json:"merged_claims"`}
UserLinkClaims is the returned IDP claims for a given user link.These claims are fetched at login time. These are the claims that wereused for IDP sync.
func (*UserLinkClaims)Scan¶added inv2.18.0
func (a *UserLinkClaims) Scan(src interface{})error
typeUserStatus¶
type UserStatusstring
Defines the users status: active, dormant, or suspended.
const (UserStatusActiveUserStatus = "active"UserStatusSuspendedUserStatus = "suspended"UserStatusDormantUserStatus = "dormant")
funcAllUserStatusValues¶
func AllUserStatusValues() []UserStatus
func (*UserStatus)Scan¶
func (e *UserStatus) Scan(src interface{})error
func (UserStatus)Valid¶
func (eUserStatus) Valid()bool
typeUserStatusChange¶added inv2.19.0
type UserStatusChange struct {IDuuid.UUID `db:"id" json:"id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`NewStatusUserStatus `db:"new_status" json:"new_status"`ChangedAttime.Time `db:"changed_at" json:"changed_at"`}
Tracks the history of user status changes
typeVisibleUser¶
type VisibleUser struct {IDuuid.UUID `db:"id" json:"id"`Usernamestring `db:"username" json:"username"`Namestring `db:"name" json:"name"`AvatarURLstring `db:"avatar_url" json:"avatar_url"`}
Visible fields of users are allowed to be joined with other tables for including context of other resources.
typeWebpushSubscription¶added inv2.21.0
type WebpushSubscription struct {IDuuid.UUID `db:"id" json:"id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`Endpointstring `db:"endpoint" json:"endpoint"`EndpointP256dhKeystring `db:"endpoint_p256dh_key" json:"endpoint_p256dh_key"`EndpointAuthKeystring `db:"endpoint_auth_key" json:"endpoint_auth_key"`}
typeWorkspace¶
type Workspace struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`OwnerIDuuid.UUID `db:"owner_id" json:"owner_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`Deletedbool `db:"deleted" json:"deleted"`Namestring `db:"name" json:"name"`AutostartSchedulesql.NullString `db:"autostart_schedule" json:"autostart_schedule"`Ttlsql.NullInt64 `db:"ttl" json:"ttl"`LastUsedAttime.Time `db:"last_used_at" json:"last_used_at"`DormantAtsql.NullTime `db:"dormant_at" json:"dormant_at"`DeletingAtsql.NullTime `db:"deleting_at" json:"deleting_at"`AutomaticUpdatesAutomaticUpdates `db:"automatic_updates" json:"automatic_updates"`Favoritebool `db:"favorite" json:"favorite"`NextStartAtsql.NullTime `db:"next_start_at" json:"next_start_at"`OwnerAvatarUrlstring `db:"owner_avatar_url" json:"owner_avatar_url"`OwnerUsernamestring `db:"owner_username" json:"owner_username"`OwnerNamestring `db:"owner_name" json:"owner_name"`OrganizationNamestring `db:"organization_name" json:"organization_name"`OrganizationDisplayNamestring `db:"organization_display_name" json:"organization_display_name"`OrganizationIconstring `db:"organization_icon" json:"organization_icon"`OrganizationDescriptionstring `db:"organization_description" json:"organization_description"`TemplateNamestring `db:"template_name" json:"template_name"`TemplateDisplayNamestring `db:"template_display_name" json:"template_display_name"`TemplateIconstring `db:"template_icon" json:"template_icon"`TemplateDescriptionstring `db:"template_description" json:"template_description"`}
Joins in the display name information such as username, avatar, and organization name.
funcConvertWorkspaceRows¶
func ConvertWorkspaceRows(rows []GetWorkspacesRow) []Workspace
func (Workspace)RBACObject¶
func (Workspace)WorkspaceTable¶added inv2.17.0
func (wWorkspace) WorkspaceTable()WorkspaceTable
WorkspaceTable converts a Workspace to it's reduced version.A more generalized solution is to use json marshaling toconsistently keep these two structs in sync.That would be a lot of overhead, and a more costly unit test iswritten to make sure these match up.
typeWorkspaceAgent¶
type WorkspaceAgent struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Namestring `db:"name" json:"name"`FirstConnectedAtsql.NullTime `db:"first_connected_at" json:"first_connected_at"`LastConnectedAtsql.NullTime `db:"last_connected_at" json:"last_connected_at"`DisconnectedAtsql.NullTime `db:"disconnected_at" json:"disconnected_at"`ResourceIDuuid.UUID `db:"resource_id" json:"resource_id"`AuthTokenuuid.UUID `db:"auth_token" json:"auth_token"`AuthInstanceIDsql.NullString `db:"auth_instance_id" json:"auth_instance_id"`Architecturestring `db:"architecture" json:"architecture"`EnvironmentVariablespqtype.NullRawMessage `db:"environment_variables" json:"environment_variables"`OperatingSystemstring `db:"operating_system" json:"operating_system"`InstanceMetadatapqtype.NullRawMessage `db:"instance_metadata" json:"instance_metadata"`ResourceMetadatapqtype.NullRawMessage `db:"resource_metadata" json:"resource_metadata"`Directorystring `db:"directory" json:"directory"`// Version tracks the version of the currently running workspace agent. Workspace agents register their version upon start.Versionstring `db:"version" json:"version"`LastConnectedReplicaIDuuid.NullUUID `db:"last_connected_replica_id" json:"last_connected_replica_id"`// Connection timeout in seconds, 0 means disabled.ConnectionTimeoutSecondsint32 `db:"connection_timeout_seconds" json:"connection_timeout_seconds"`// URL for troubleshooting the agent.TroubleshootingURLstring `db:"troubleshooting_url" json:"troubleshooting_url"`// Path to file inside workspace containing the message of the day (MOTD) to show to the user when logging in via SSH.MOTDFilestring `db:"motd_file" json:"motd_file"`// The current lifecycle state reported by the workspace agent.LifecycleStateWorkspaceAgentLifecycleState `db:"lifecycle_state" json:"lifecycle_state"`// The resolved path of a user-specified directory. e.g. ~/coder -> /home/coder/coderExpandedDirectorystring `db:"expanded_directory" json:"expanded_directory"`// Total length of startup logsLogsLengthint32 `db:"logs_length" json:"logs_length"`// Whether the startup logs overflowed in lengthLogsOverflowedbool `db:"logs_overflowed" json:"logs_overflowed"`// The time the agent entered the starting lifecycle stateStartedAtsql.NullTime `db:"started_at" json:"started_at"`// The time the agent entered the ready or start_error lifecycle stateReadyAtsql.NullTime `db:"ready_at" json:"ready_at"`Subsystems []WorkspaceAgentSubsystem `db:"subsystems" json:"subsystems"`DisplayApps []DisplayApp `db:"display_apps" json:"display_apps"`APIVersionstring `db:"api_version" json:"api_version"`// Specifies the order in which to display agents in user interfaces.DisplayOrderint32 `db:"display_order" json:"display_order"`ParentIDuuid.NullUUID `db:"parent_id" json:"parent_id"`// Defines the scope of the API key associated with the agent. 'all' allows access to everything, 'no_user_data' restricts it to exclude user data.APIKeyScopeAgentKeyScopeEnum `db:"api_key_scope" json:"api_key_scope"`}
func (WorkspaceAgent)Status¶
func (aWorkspaceAgent) Status(inactiveTimeouttime.Duration)WorkspaceAgentConnectionStatus
typeWorkspaceAgentDevcontainer¶added inv2.21.0
type WorkspaceAgentDevcontainer struct {// Unique identifierIDuuid.UUID `db:"id" json:"id"`// Workspace agent foreign keyWorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`// Creation timestampCreatedAttime.Time `db:"created_at" json:"created_at"`// Workspace folderWorkspaceFolderstring `db:"workspace_folder" json:"workspace_folder"`// Path to devcontainer.json.ConfigPathstring `db:"config_path" json:"config_path"`// The name of the Dev Container.Namestring `db:"name" json:"name"`}
Workspace agent devcontainer configuration
typeWorkspaceAgentLifecycleState¶
type WorkspaceAgentLifecycleStatestring
const (WorkspaceAgentLifecycleStateCreatedWorkspaceAgentLifecycleState = "created"WorkspaceAgentLifecycleStateStartingWorkspaceAgentLifecycleState = "starting"WorkspaceAgentLifecycleStateStartTimeoutWorkspaceAgentLifecycleState = "start_timeout"WorkspaceAgentLifecycleStateStartErrorWorkspaceAgentLifecycleState = "start_error"WorkspaceAgentLifecycleStateReadyWorkspaceAgentLifecycleState = "ready"WorkspaceAgentLifecycleStateShuttingDownWorkspaceAgentLifecycleState = "shutting_down"WorkspaceAgentLifecycleStateShutdownTimeoutWorkspaceAgentLifecycleState = "shutdown_timeout"WorkspaceAgentLifecycleStateShutdownErrorWorkspaceAgentLifecycleState = "shutdown_error"WorkspaceAgentLifecycleStateOffWorkspaceAgentLifecycleState = "off")
funcAllWorkspaceAgentLifecycleStateValues¶
func AllWorkspaceAgentLifecycleStateValues() []WorkspaceAgentLifecycleState
func (*WorkspaceAgentLifecycleState)Scan¶
func (e *WorkspaceAgentLifecycleState) Scan(src interface{})error
func (WorkspaceAgentLifecycleState)Valid¶
func (eWorkspaceAgentLifecycleState) Valid()bool
typeWorkspaceAgentLog¶
type WorkspaceAgentLog struct {AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`Outputstring `db:"output" json:"output"`IDint64 `db:"id" json:"id"`LevelLogLevel `db:"level" json:"level"`LogSourceIDuuid.UUID `db:"log_source_id" json:"log_source_id"`}
typeWorkspaceAgentMemoryResourceMonitor¶added inv2.20.0
type WorkspaceAgentMemoryResourceMonitor struct {AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`Enabledbool `db:"enabled" json:"enabled"`Thresholdint32 `db:"threshold" json:"threshold"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`StateWorkspaceAgentMonitorState `db:"state" json:"state"`DebouncedUntiltime.Time `db:"debounced_until" json:"debounced_until"`}
typeWorkspaceAgentMetadatum¶
type WorkspaceAgentMetadatum struct {WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`DisplayNamestring `db:"display_name" json:"display_name"`Keystring `db:"key" json:"key"`Scriptstring `db:"script" json:"script"`Valuestring `db:"value" json:"value"`Errorstring `db:"error" json:"error"`Timeoutint64 `db:"timeout" json:"timeout"`Intervalint64 `db:"interval" json:"interval"`CollectedAttime.Time `db:"collected_at" json:"collected_at"`// Specifies the order in which to display agent metadata in user interfaces.DisplayOrderint32 `db:"display_order" json:"display_order"`}
typeWorkspaceAgentMonitorState¶added inv2.20.0
type WorkspaceAgentMonitorStatestring
const (WorkspaceAgentMonitorStateOKWorkspaceAgentMonitorState = "OK"WorkspaceAgentMonitorStateNOKWorkspaceAgentMonitorState = "NOK")
funcAllWorkspaceAgentMonitorStateValues¶added inv2.20.0
func AllWorkspaceAgentMonitorStateValues() []WorkspaceAgentMonitorState
func (*WorkspaceAgentMonitorState)Scan¶added inv2.20.0
func (e *WorkspaceAgentMonitorState) Scan(src interface{})error
func (WorkspaceAgentMonitorState)Valid¶added inv2.20.0
func (eWorkspaceAgentMonitorState) Valid()bool
typeWorkspaceAgentPortShare¶added inv2.9.0
type WorkspaceAgentPortShare struct {WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`AgentNamestring `db:"agent_name" json:"agent_name"`Portint32 `db:"port" json:"port"`ShareLevelAppSharingLevel `db:"share_level" json:"share_level"`ProtocolPortShareProtocol `db:"protocol" json:"protocol"`}
typeWorkspaceAgentScript¶added inv2.2.0
type WorkspaceAgentScript struct {WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`LogSourceIDuuid.UUID `db:"log_source_id" json:"log_source_id"`LogPathstring `db:"log_path" json:"log_path"`CreatedAttime.Time `db:"created_at" json:"created_at"`Scriptstring `db:"script" json:"script"`Cronstring `db:"cron" json:"cron"`StartBlocksLoginbool `db:"start_blocks_login" json:"start_blocks_login"`RunOnStartbool `db:"run_on_start" json:"run_on_start"`RunOnStopbool `db:"run_on_stop" json:"run_on_stop"`TimeoutSecondsint32 `db:"timeout_seconds" json:"timeout_seconds"`DisplayNamestring `db:"display_name" json:"display_name"`IDuuid.UUID `db:"id" json:"id"`}
typeWorkspaceAgentScriptTiming¶added inv2.16.0
type WorkspaceAgentScriptTiming struct {ScriptIDuuid.UUID `db:"script_id" json:"script_id"`StartedAttime.Time `db:"started_at" json:"started_at"`EndedAttime.Time `db:"ended_at" json:"ended_at"`ExitCodeint32 `db:"exit_code" json:"exit_code"`StageWorkspaceAgentScriptTimingStage `db:"stage" json:"stage"`StatusWorkspaceAgentScriptTimingStatus `db:"status" json:"status"`}
typeWorkspaceAgentScriptTimingStage¶added inv2.16.0
type WorkspaceAgentScriptTimingStagestring
What stage the script was ran in.
const (WorkspaceAgentScriptTimingStageStartWorkspaceAgentScriptTimingStage = "start"WorkspaceAgentScriptTimingStageStopWorkspaceAgentScriptTimingStage = "stop"WorkspaceAgentScriptTimingStageCronWorkspaceAgentScriptTimingStage = "cron")
funcAllWorkspaceAgentScriptTimingStageValues¶added inv2.16.0
func AllWorkspaceAgentScriptTimingStageValues() []WorkspaceAgentScriptTimingStage
func (*WorkspaceAgentScriptTimingStage)Scan¶added inv2.16.0
func (e *WorkspaceAgentScriptTimingStage) Scan(src interface{})error
func (WorkspaceAgentScriptTimingStage)Valid¶added inv2.16.0
func (eWorkspaceAgentScriptTimingStage) Valid()bool
typeWorkspaceAgentScriptTimingStatus¶added inv2.16.0
type WorkspaceAgentScriptTimingStatusstring
What the exit status of the script is.
const (WorkspaceAgentScriptTimingStatusOkWorkspaceAgentScriptTimingStatus = "ok"WorkspaceAgentScriptTimingStatusExitFailureWorkspaceAgentScriptTimingStatus = "exit_failure"WorkspaceAgentScriptTimingStatusTimedOutWorkspaceAgentScriptTimingStatus = "timed_out"WorkspaceAgentScriptTimingStatusPipesLeftOpenWorkspaceAgentScriptTimingStatus = "pipes_left_open")
funcAllWorkspaceAgentScriptTimingStatusValues¶added inv2.16.0
func AllWorkspaceAgentScriptTimingStatusValues() []WorkspaceAgentScriptTimingStatus
func (*WorkspaceAgentScriptTimingStatus)Scan¶added inv2.16.0
func (e *WorkspaceAgentScriptTimingStatus) Scan(src interface{})error
func (WorkspaceAgentScriptTimingStatus)Valid¶added inv2.16.0
func (eWorkspaceAgentScriptTimingStatus) Valid()bool
typeWorkspaceAgentStat¶
type WorkspaceAgentStat struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UserIDuuid.UUID `db:"user_id" json:"user_id"`AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`ConnectionsByProtojson.RawMessage `db:"connections_by_proto" json:"connections_by_proto"`ConnectionCountint64 `db:"connection_count" json:"connection_count"`RxPacketsint64 `db:"rx_packets" json:"rx_packets"`RxBytesint64 `db:"rx_bytes" json:"rx_bytes"`TxPacketsint64 `db:"tx_packets" json:"tx_packets"`TxBytesint64 `db:"tx_bytes" json:"tx_bytes"`ConnectionMedianLatencyMSfloat64 `db:"connection_median_latency_ms" json:"connection_median_latency_ms"`SessionCountVSCodeint64 `db:"session_count_vscode" json:"session_count_vscode"`SessionCountJetBrainsint64 `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`SessionCountSSHint64 `db:"session_count_ssh" json:"session_count_ssh"`Usagebool `db:"usage" json:"usage"`}
typeWorkspaceAgentStatus¶
type WorkspaceAgentStatusstring
const (WorkspaceAgentStatusConnectingWorkspaceAgentStatus = "connecting"WorkspaceAgentStatusConnectedWorkspaceAgentStatus = "connected"WorkspaceAgentStatusDisconnectedWorkspaceAgentStatus = "disconnected"WorkspaceAgentStatusTimeoutWorkspaceAgentStatus = "timeout")
This is also in codersdk/workspaceagents.go and should be kept in sync.
func (WorkspaceAgentStatus)Valid¶
func (sWorkspaceAgentStatus) Valid()bool
typeWorkspaceAgentSubsystem¶
type WorkspaceAgentSubsystemstring
const (WorkspaceAgentSubsystemEnvbuilderWorkspaceAgentSubsystem = "envbuilder"WorkspaceAgentSubsystemEnvboxWorkspaceAgentSubsystem = "envbox"WorkspaceAgentSubsystemNoneWorkspaceAgentSubsystem = "none"WorkspaceAgentSubsystemExectraceWorkspaceAgentSubsystem = "exectrace")
funcAllWorkspaceAgentSubsystemValues¶
func AllWorkspaceAgentSubsystemValues() []WorkspaceAgentSubsystem
func (*WorkspaceAgentSubsystem)Scan¶
func (e *WorkspaceAgentSubsystem) Scan(src interface{})error
func (WorkspaceAgentSubsystem)Valid¶
func (eWorkspaceAgentSubsystem) Valid()bool
typeWorkspaceAgentVolumeResourceMonitor¶added inv2.20.0
type WorkspaceAgentVolumeResourceMonitor struct {AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`Enabledbool `db:"enabled" json:"enabled"`Thresholdint32 `db:"threshold" json:"threshold"`Pathstring `db:"path" json:"path"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`StateWorkspaceAgentMonitorState `db:"state" json:"state"`DebouncedUntiltime.Time `db:"debounced_until" json:"debounced_until"`}
typeWorkspaceApp¶
type WorkspaceApp struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`DisplayNamestring `db:"display_name" json:"display_name"`Iconstring `db:"icon" json:"icon"`Commandsql.NullString `db:"command" json:"command"`Urlsql.NullString `db:"url" json:"url"`HealthcheckUrlstring `db:"healthcheck_url" json:"healthcheck_url"`HealthcheckIntervalint32 `db:"healthcheck_interval" json:"healthcheck_interval"`HealthcheckThresholdint32 `db:"healthcheck_threshold" json:"healthcheck_threshold"`HealthWorkspaceAppHealth `db:"health" json:"health"`Subdomainbool `db:"subdomain" json:"subdomain"`SharingLevelAppSharingLevel `db:"sharing_level" json:"sharing_level"`Slugstring `db:"slug" json:"slug"`Externalbool `db:"external" json:"external"`// Specifies the order in which to display agent app in user interfaces.DisplayOrderint32 `db:"display_order" json:"display_order"`// Determines if the app is not shown in user interfaces.Hiddenbool `db:"hidden" json:"hidden"`OpenInWorkspaceAppOpenIn `db:"open_in" json:"open_in"`DisplayGroupsql.NullString `db:"display_group" json:"display_group"`}
typeWorkspaceAppAuditSession¶added inv2.21.0
type WorkspaceAppAuditSession struct {// The agent that the workspace app or port forward belongs to.AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`// The app that is currently in the workspace app. This is may be uuid.Nil because ports are not associated with an app.AppIDuuid.UUID `db:"app_id" json:"app_id"`// The user that is currently using the workspace app. This is may be uuid.Nil if we cannot determine the user.UserIDuuid.UUID `db:"user_id" json:"user_id"`// The IP address of the user that is currently using the workspace app.Ipstring `db:"ip" json:"ip"`// The user agent of the user that is currently using the workspace app.UserAgentstring `db:"user_agent" json:"user_agent"`// The slug or port of the workspace app that the user is currently using.SlugOrPortstring `db:"slug_or_port" json:"slug_or_port"`// The HTTP status produced by the token authorization. Defaults to 200 if no status is provided.StatusCodeint32 `db:"status_code" json:"status_code"`// The time the user started the session.StartedAttime.Time `db:"started_at" json:"started_at"`// The time the session was last updated.UpdatedAttime.Time `db:"updated_at" json:"updated_at"`IDuuid.UUID `db:"id" json:"id"`}
Audit sessions for workspace apps, the data in this table is ephemeral and is used to deduplicate audit log entries for workspace apps. While a session is active, the same data will not be logged again. This table does not store historical data.
typeWorkspaceAppHealth¶
type WorkspaceAppHealthstring
const (WorkspaceAppHealthDisabledWorkspaceAppHealth = "disabled"WorkspaceAppHealthInitializingWorkspaceAppHealth = "initializing"WorkspaceAppHealthHealthyWorkspaceAppHealth = "healthy"WorkspaceAppHealthUnhealthyWorkspaceAppHealth = "unhealthy")
funcAllWorkspaceAppHealthValues¶
func AllWorkspaceAppHealthValues() []WorkspaceAppHealth
func (*WorkspaceAppHealth)Scan¶
func (e *WorkspaceAppHealth) Scan(src interface{})error
func (WorkspaceAppHealth)Valid¶
func (eWorkspaceAppHealth) Valid()bool
typeWorkspaceAppOpenIn¶added inv2.19.0
type WorkspaceAppOpenInstring
const (WorkspaceAppOpenInTabWorkspaceAppOpenIn = "tab"WorkspaceAppOpenInWindowWorkspaceAppOpenIn = "window"WorkspaceAppOpenInSlimWindowWorkspaceAppOpenIn = "slim-window")
funcAllWorkspaceAppOpenInValues¶added inv2.19.0
func AllWorkspaceAppOpenInValues() []WorkspaceAppOpenIn
func (*WorkspaceAppOpenIn)Scan¶added inv2.19.0
func (e *WorkspaceAppOpenIn) Scan(src interface{})error
func (WorkspaceAppOpenIn)Valid¶added inv2.19.0
func (eWorkspaceAppOpenIn) Valid()bool
typeWorkspaceAppStat¶
type WorkspaceAppStat struct {// The ID of the recordIDint64 `db:"id" json:"id"`// The user who used the workspace appUserIDuuid.UUID `db:"user_id" json:"user_id"`// The workspace that the workspace app was used inWorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`// The workspace agent that was usedAgentIDuuid.UUID `db:"agent_id" json:"agent_id"`// The method used to access the workspace appAccessMethodstring `db:"access_method" json:"access_method"`// The slug or port used to to identify the appSlugOrPortstring `db:"slug_or_port" json:"slug_or_port"`// The unique identifier for the sessionSessionIDuuid.UUID `db:"session_id" json:"session_id"`// The time the session startedSessionStartedAttime.Time `db:"session_started_at" json:"session_started_at"`// The time the session endedSessionEndedAttime.Time `db:"session_ended_at" json:"session_ended_at"`// The number of requests made during the session, a number larger than 1 indicates that multiple sessions were rolled up into oneRequestsint32 `db:"requests" json:"requests"`}
A record of workspace app usage statistics
typeWorkspaceAppStatus¶added inv2.21.0
type WorkspaceAppStatus struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`AppIDuuid.UUID `db:"app_id" json:"app_id"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`StateWorkspaceAppStatusState `db:"state" json:"state"`Messagestring `db:"message" json:"message"`Urisql.NullString `db:"uri" json:"uri"`}
typeWorkspaceAppStatusState¶added inv2.21.0
type WorkspaceAppStatusStatestring
const (WorkspaceAppStatusStateWorkingWorkspaceAppStatusState = "working"WorkspaceAppStatusStateCompleteWorkspaceAppStatusState = "complete"WorkspaceAppStatusStateFailureWorkspaceAppStatusState = "failure")
funcAllWorkspaceAppStatusStateValues¶added inv2.21.0
func AllWorkspaceAppStatusStateValues() []WorkspaceAppStatusState
func (*WorkspaceAppStatusState)Scan¶added inv2.21.0
func (e *WorkspaceAppStatusState) Scan(src interface{})error
func (WorkspaceAppStatusState)Valid¶added inv2.21.0
func (eWorkspaceAppStatusState) Valid()bool
typeWorkspaceBuild¶
type WorkspaceBuild struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`BuildNumberint32 `db:"build_number" json:"build_number"`TransitionWorkspaceTransition `db:"transition" json:"transition"`InitiatorIDuuid.UUID `db:"initiator_id" json:"initiator_id"`ProvisionerState []byte `db:"provisioner_state" json:"provisioner_state"`JobIDuuid.UUID `db:"job_id" json:"job_id"`Deadlinetime.Time `db:"deadline" json:"deadline"`ReasonBuildReason `db:"reason" json:"reason"`DailyCostint32 `db:"daily_cost" json:"daily_cost"`MaxDeadlinetime.Time `db:"max_deadline" json:"max_deadline"`TemplateVersionPresetIDuuid.NullUUID `db:"template_version_preset_id" json:"template_version_preset_id"`InitiatorByAvatarUrlstring `db:"initiator_by_avatar_url" json:"initiator_by_avatar_url"`InitiatorByUsernamestring `db:"initiator_by_username" json:"initiator_by_username"`InitiatorByNamestring `db:"initiator_by_name" json:"initiator_by_name"`}
Joins in the username + avatar url of the initiated by user.
typeWorkspaceBuildTable¶
type WorkspaceBuildTable struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`BuildNumberint32 `db:"build_number" json:"build_number"`TransitionWorkspaceTransition `db:"transition" json:"transition"`InitiatorIDuuid.UUID `db:"initiator_id" json:"initiator_id"`ProvisionerState []byte `db:"provisioner_state" json:"provisioner_state"`JobIDuuid.UUID `db:"job_id" json:"job_id"`Deadlinetime.Time `db:"deadline" json:"deadline"`ReasonBuildReason `db:"reason" json:"reason"`DailyCostint32 `db:"daily_cost" json:"daily_cost"`MaxDeadlinetime.Time `db:"max_deadline" json:"max_deadline"`TemplateVersionPresetIDuuid.NullUUID `db:"template_version_preset_id" json:"template_version_preset_id"`}
typeWorkspaceLatestBuild¶added inv2.22.0
type WorkspaceLatestBuild struct {IDuuid.UUID `db:"id" json:"id"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`JobIDuuid.UUID `db:"job_id" json:"job_id"`TemplateVersionPresetIDuuid.NullUUID `db:"template_version_preset_id" json:"template_version_preset_id"`TransitionWorkspaceTransition `db:"transition" json:"transition"`CreatedAttime.Time `db:"created_at" json:"created_at"`JobStatusProvisionerJobStatus `db:"job_status" json:"job_status"`}
typeWorkspaceModule¶added inv2.18.0
type WorkspaceModule struct {IDuuid.UUID `db:"id" json:"id"`JobIDuuid.UUID `db:"job_id" json:"job_id"`TransitionWorkspaceTransition `db:"transition" json:"transition"`Sourcestring `db:"source" json:"source"`Versionstring `db:"version" json:"version"`Keystring `db:"key" json:"key"`CreatedAttime.Time `db:"created_at" json:"created_at"`}
typeWorkspacePrebuild¶added inv2.22.0
type WorkspacePrebuild struct {IDuuid.UUID `db:"id" json:"id"`Namestring `db:"name" json:"name"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`Readybool `db:"ready" json:"ready"`CurrentPresetIDuuid.NullUUID `db:"current_preset_id" json:"current_preset_id"`}
typeWorkspacePrebuildBuild¶added inv2.22.0
type WorkspacePrebuildBuild struct {IDuuid.UUID `db:"id" json:"id"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`TransitionWorkspaceTransition `db:"transition" json:"transition"`JobIDuuid.UUID `db:"job_id" json:"job_id"`TemplateVersionPresetIDuuid.NullUUID `db:"template_version_preset_id" json:"template_version_preset_id"`BuildNumberint32 `db:"build_number" json:"build_number"`}
typeWorkspaceProxy¶
type WorkspaceProxy struct {IDuuid.UUID `db:"id" json:"id"`Namestring `db:"name" json:"name"`DisplayNamestring `db:"display_name" json:"display_name"`// Expects an emoji character. (/emojis/1f1fa-1f1f8.png)Iconstring `db:"icon" json:"icon"`// Full url including scheme of the proxy api url:https://us.example.comUrlstring `db:"url" json:"url"`// Hostname with the wildcard for subdomain based app hosting: *.us.example.comWildcardHostnamestring `db:"wildcard_hostname" json:"wildcard_hostname"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`// Boolean indicator of a deleted workspace proxy. Proxies are soft-deleted.Deletedbool `db:"deleted" json:"deleted"`// Hashed secret is used to authenticate the workspace proxy using a session token.TokenHashedSecret []byte `db:"token_hashed_secret" json:"token_hashed_secret"`RegionIDint32 `db:"region_id" json:"region_id"`DerpEnabledbool `db:"derp_enabled" json:"derp_enabled"`// Disables app/terminal proxying for this proxy and only acts as a DERP relay.DerpOnlybool `db:"derp_only" json:"derp_only"`Versionstring `db:"version" json:"version"`}
func (WorkspaceProxy)IsPrimary¶
func (wWorkspaceProxy) IsPrimary()bool
func (WorkspaceProxy)RBACObject¶
func (wWorkspaceProxy) RBACObject()rbac.Object
typeWorkspaceResource¶
type WorkspaceResource struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`JobIDuuid.UUID `db:"job_id" json:"job_id"`TransitionWorkspaceTransition `db:"transition" json:"transition"`Typestring `db:"type" json:"type"`Namestring `db:"name" json:"name"`Hidebool `db:"hide" json:"hide"`Iconstring `db:"icon" json:"icon"`InstanceTypesql.NullString `db:"instance_type" json:"instance_type"`DailyCostint32 `db:"daily_cost" json:"daily_cost"`ModulePathsql.NullString `db:"module_path" json:"module_path"`}
typeWorkspaceStatus¶
type WorkspaceStatusstring
const (WorkspaceStatusPendingWorkspaceStatus = "pending"WorkspaceStatusStartingWorkspaceStatus = "starting"WorkspaceStatusRunningWorkspaceStatus = "running"WorkspaceStatusStoppingWorkspaceStatus = "stopping"WorkspaceStatusStoppedWorkspaceStatus = "stopped"WorkspaceStatusFailedWorkspaceStatus = "failed"WorkspaceStatusCancelingWorkspaceStatus = "canceling"WorkspaceStatusCanceledWorkspaceStatus = "canceled"WorkspaceStatusDeletingWorkspaceStatus = "deleting"WorkspaceStatusDeletedWorkspaceStatus = "deleted")
func (WorkspaceStatus)Valid¶
func (sWorkspaceStatus) Valid()bool
typeWorkspaceTable¶added inv2.17.0
type WorkspaceTable struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`OwnerIDuuid.UUID `db:"owner_id" json:"owner_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`Deletedbool `db:"deleted" json:"deleted"`Namestring `db:"name" json:"name"`AutostartSchedulesql.NullString `db:"autostart_schedule" json:"autostart_schedule"`Ttlsql.NullInt64 `db:"ttl" json:"ttl"`LastUsedAttime.Time `db:"last_used_at" json:"last_used_at"`DormantAtsql.NullTime `db:"dormant_at" json:"dormant_at"`DeletingAtsql.NullTime `db:"deleting_at" json:"deleting_at"`AutomaticUpdatesAutomaticUpdates `db:"automatic_updates" json:"automatic_updates"`// Favorite is true if the workspace owner has favorited the workspace.Favoritebool `db:"favorite" json:"favorite"`NextStartAtsql.NullTime `db:"next_start_at" json:"next_start_at"`}
func (WorkspaceTable)DormantRBAC¶added inv2.17.0
func (wWorkspaceTable) DormantRBAC()rbac.Object
func (WorkspaceTable)RBACObject¶added inv2.17.0
func (wWorkspaceTable) RBACObject()rbac.Object
typeWorkspaceTransition¶
type WorkspaceTransitionstring
const (WorkspaceTransitionStartWorkspaceTransition = "start"WorkspaceTransitionStopWorkspaceTransition = "stop"WorkspaceTransitionDeleteWorkspaceTransition = "delete")
funcAllWorkspaceTransitionValues¶
func AllWorkspaceTransitionValues() []WorkspaceTransition
func (*WorkspaceTransition)Scan¶
func (e *WorkspaceTransition) Scan(src interface{})error
func (WorkspaceTransition)Valid¶
func (eWorkspaceTransition) Valid()bool
Source Files¶
Directories¶
Path | Synopsis |
---|---|
Package db2sdk provides common conversion routines from database types to codersdk types | Package db2sdk provides common conversion routines from database types to codersdk types |
Package dbauthz provides an authorization layer on top of the database. | Package dbauthz provides an authorization layer on top of the database. |
Code generated by coderd/database/gen/metrics. | Code generated by coderd/database/gen/metrics. |
Package dbmock is a generated GoMock package. | Package dbmock is a generated GoMock package. |
gen | |
Package gentest contains tests that are run at db generate time. | Package gentest contains tests that are run at db generate time. |
psmock package psmock contains a mocked implementation of the pubsub.Pubsub interface for use in tests | package psmock contains a mocked implementation of the pubsub.Pubsub interface for use in tests |