Versions in this module Expand all Collapse all v0 v0.22.0 Aug 26, 2026 Changes in this version + const AddonAI + const AddonNone + const AddonTimeSeries + const ExitAuthenticationError + const ExitGeneralError + const ExitInvalidParameters + const ExitPermissionDenied + const ExitServiceNotFound + const ExitSuccess + const ExitTimeout + const ExitUpdateAvailable + var ErrNotReady = errors.New("service is not ready") + var ErrPaused = errors.New("service is paused") + var ErrReadOnly = errors.New("this operation is not allowed in read-only mode") + var GetStoredCredentials = func(cfg *config.Config) (*config.Credentials, error) + func CheckReadOnly(cfg *config.Config) error + func CheckServiceReady(service api.Service) error + func ConnectTarget(ctx context.Context, cfg *config.Config, target *ConnectionTarget, ...) (*pgx.Conn, error) + func EnvAPIKey() (publicKey, secretKey string, ok bool) + func ExitWithCode(code int, err error) error + func ExitWithErrorFromStatusCode(statusCode int, err error) error + func FetchServiceLogs(ctx context.Context, args FetchServiceLogsArgs) ([]api.ServiceLogEntry, error) + func FormatSchema(schema *DatabaseSchema) string + func GenerateServiceName() string + func GetPassword(cfg *config.Config, service api.Service, role string) (string, error) + func GetService(ctx context.Context, client api.ClientWithResponsesInterface, ...) (*api.Service, error) + func IdentifyOAuthUser(ctx context.Context, cfg *config.Config, ...) + func IsReadReplica(service api.Service) bool + func IsValidAddon(addon string) bool + func NewAPIClient(ctx context.Context, cfg *config.Config) (*api.ClientWithResponses, string, error) + func ParseCPUMemory(cpuMemoryStr string) (string, string, error) + func ReplicaPoolerWarning(target *ConnectionTarget, pooled bool) string + func ValidAddons() []string + func ValidateAPIKey(ctx context.Context, cfg *config.Config, ...) (*api.AuthInfo, error) + func ValidateAddons(addons []string) ([]string, error) + func WaitForService(ctx context.Context, args WaitForServiceArgs) error + type App struct + Experimental bool + func (a *App) GetAll() (*config.Config, api.ClientWithResponsesInterface, string, error) + func (a *App) GetClient() (api.ClientWithResponsesInterface, string, error) + func (a *App) GetConfig() *config.Config + func (a *App) Load(ctx context.Context) (*config.Config, api.ClientWithResponsesInterface, string, error) + func (a *App) SetClient(client api.ClientWithResponsesInterface, projectID string) + func (a *App) SetClientFactory(f ClientFactory) + func (a *App) SetFlags(flags *pflag.FlagSet) + func (a *App) TryGetAll() (*config.Config, api.ClientWithResponsesInterface, string) + type CPUMemoryConfig struct + CPUMillis int + MemoryGBs int + Shared bool + func ValidateAndNormalizeCPUMemory(cpuMillis, memoryGBs string) (*CPUMemoryConfig, error) + func (c *CPUMemoryConfig) CPUMillisString() *string + func (c *CPUMemoryConfig) Matches(cpuMillis, memoryGBs string) bool + func (c *CPUMemoryConfig) MemoryGBsString() *string + func (c *CPUMemoryConfig) String() string + type CPUMemoryConfigs []CPUMemoryConfig + func GetAllowedCPUMemoryConfigs() CPUMemoryConfigs + func GetAllowedResizeCPUMemoryConfigs() CPUMemoryConfigs + func (c CPUMemoryConfigs) String() string + func (c CPUMemoryConfigs) Strings() []string + type CheckConstraint struct + Columns []string + Expression string + Name string + type ClientFactory func(ctx context.Context, cfg *config.Config) (api.ClientWithResponsesInterface, string, error) + type ConnectionDetails struct + Database string + Host string + IsPooler bool + Password string + Port int + Role string + func GetConnectionDetails(cfg *config.Config, service api.Service, opts ConnectionDetailsOptions) (*ConnectionDetails, error) + func GetConnectionDetailsFor(cfg *config.Config, connService, credService api.Service, ...) (*ConnectionDetails, error) + func (d *ConnectionDetails) RequirePooler(requested bool) error + func (d *ConnectionDetails) String() string + type ConnectionDetailsOptions struct + InitialPassword string + Pooled bool + ReadOnly bool + Role string + WithPassword bool + type ConnectionTarget struct + ConnectionService api.Service + CredentialService api.Service + IsReplica bool + func NewReplicaConnectionTarget(primary api.Service, replica api.ReadReplicaSet) *ConnectionTarget + func ResolveConnectionTarget(ctx context.Context, client api.ClientWithResponsesInterface, projectID string, ...) (*ConnectionTarget, error) + func ResolveConnectionTargetByID(ctx context.Context, client api.ClientWithResponsesInterface, ...) (*ConnectionTarget, error) + func (t *ConnectionTarget) Details(cfg *config.Config, opts ConnectionDetailsOptions) (*ConnectionDetails, error) + type ConstraintType string + const ConstraintForeignKey + const ConstraintPrimaryKey + const ConstraintUnique + type ContinuousAggregateInfo struct + CompressionEnabled bool + MaterializedOnly bool + type DatabaseSchema struct + ID string + Name string + Schemas []NamespacedSchema + func FetchSchemaFromConn(ctx context.Context, conn *pgx.Conn, ident SchemaIdent, opts SchemaOptions) (*DatabaseSchema, error) + func FetchServiceSchema(ctx context.Context, cfg *config.Config, target *ConnectionTarget, role string, ...) (*DatabaseSchema, error) + type DeletionWaitHandler struct + ServiceID string + func (h *DeletionWaitHandler) Check(resp *api.GetServiceResponse) (bool, error) + func (h *DeletionWaitHandler) InitialCheck() (bool, error) + func (h *DeletionWaitHandler) Message() string + type EnumSchema struct + Comment string + Name string + Values []string + type ExclusionConstraint struct + Definition string + Name string + type ExitCodeError struct + func (e ExitCodeError) Error() string + func (e ExitCodeError) ExitCode() int + func (e ExitCodeError) Unwrap() error + type FetchServiceLogsArgs struct + Client api.ClientWithResponsesInterface + Node *int + ProjectID string + ServiceID string + Since *time.Time + Tail int + Until *time.Time + type ForeignTableInfo struct + Options []string + Server string + Wrapper string + type HypertableInfo struct + CompressionEnabled bool + NumChunks int + type IndexSchema struct + Columns string + Definition string + IsUnique bool + Name string + WhereClause string + type KeyringStorage struct + func (k *KeyringStorage) Get(service api.Service, role string) (string, error) + func (k *KeyringStorage) GetStorageResult(err error, password string) PasswordStorageResult + func (k *KeyringStorage) Remove(service api.Service, role string) error + func (k *KeyringStorage) Save(service api.Service, password string, role string) error + type NamespacedSchema struct + Comment string + Enums []EnumSchema + Functions []Routine + MaterializedViews []ViewSchema + Name string + Procedures []Routine + Tables []TableSchema + Views []ViewSchema + type NoStorage struct + func (n *NoStorage) Get(service api.Service, role string) (string, error) + func (n *NoStorage) GetStorageResult(err error, password string) PasswordStorageResult + func (n *NoStorage) Remove(service api.Service, role string) error + func (n *NoStorage) Save(service api.Service, password string, role string) error + type PartitionInfo struct + Bound string + Name string + Schema string + type PasswordStorage interface + Get func(service api.Service, role string) (string, error) + GetStorageResult func(err error, password string) PasswordStorageResult + Remove func(service api.Service, role string) error + Save func(service api.Service, password string, role string) error + func GetPasswordStorage(cfg *config.Config) PasswordStorage + type PasswordStorageResult struct + Message string + Method string + Success bool + func SavePasswordWithResult(cfg *config.Config, service api.Service, password string, role string) (PasswordStorageResult, error) + type PgpassStorage struct + func (p *PgpassStorage) Get(service api.Service, role string) (string, error) + func (p *PgpassStorage) GetStorageResult(err error, password string) PasswordStorageResult + func (p *PgpassStorage) Remove(service api.Service, role string) error + func (p *PgpassStorage) Save(service api.Service, password string, role string) error + type Routine struct + Arguments string + Comment string + Definition string + Name string + Type RoutineType + type RoutineType string + const RoutineFunction + const RoutineProcedure + type SchemaIdent struct + ID string + Name string + type SchemaNotFoundError struct + Available []string + ListErr error + Schema string + func (e *SchemaNotFoundError) Error() string + func (e *SchemaNotFoundError) Unwrap() error + type SchemaOptions struct + IncludeComments bool + IncludeDefinitions bool + IncludeInternal bool + Schema string + type Spinner interface + Stop func() + Update func(message string) + func NewSpinner(args SpinnerArgs) Spinner + type SpinnerArgs struct + Cancel context.CancelFunc + Input io.Reader + Message string + Output io.Writer + type StatusWaitHandler struct + Service *api.Service + TargetStatus string + func (h *StatusWaitHandler) Check(resp *api.GetServiceResponse) (bool, error) + func (h *StatusWaitHandler) InitialCheck() (bool, error) + func (h *StatusWaitHandler) Message() string + type TableColumnSchema struct + Comment string + Default string + IdentityType string + IsSerial bool + Name string + NotNull bool + Type string + type TableConstraint struct + Columns []string + Name string + RefColumns []string + RefTable string + Type ConstraintType + type TableSchema struct + Checks []CheckConstraint + Columns []TableColumnSchema + Comment string + Constraints []TableConstraint + Exclusions []ExclusionConstraint + Foreign *ForeignTableInfo + Hypertable *HypertableInfo + Indexes []IndexSchema + Name string + Partitions []PartitionInfo + Triggers []TriggerSchema + type TriggerSchema struct + Manipulation string + Name string + Statement string + Timing string + type ViewColumnSchema struct + Comment string + Name string + Type string + type ViewSchema struct + Columns []ViewColumnSchema + Comment string + ContinuousAggregate *ContinuousAggregateInfo + Definition string + Indexes []IndexSchema + Name string + Triggers []TriggerSchema + type WaitForServiceArgs struct + Client api.ClientWithResponsesInterface + Handler WaitHandler + Input io.Reader + Output io.Writer + ProjectID string + ServiceID string + Timeout time.Duration + TimeoutMsg string + type WaitHandler interface + Check func(resp *api.GetServiceResponse) (bool, error) + InitialCheck func() (bool, error) + Message func() string