Versions in this module Expand all Collapse all v0 v0.1.18 Jul 10, 2026 Changes in this version + const AccessTokenKey + const CLI_LOGIN_PREFIX + const CLI_OWNER + const CLI_REPO + const CliProjectLabel + const DNS_GO_NATIVE + const DNS_OVER_HTTPS + const DenoVersion + const DinDHost + const DockerDenoDir + const DockerEszipDir + const HeaderGotrueID + const OutputEnv + const OutputJson + const OutputMetadata + const OutputPretty + const OutputToml + const OutputYaml + const SET_SESSION_ROLE + const SUPERUSER_ROLE + const SuggestDebugFlag + const SuggestEnvVar + var AccessTokenPattern = regexp.MustCompile(`^sbp_(oauth_)?[a-f0-9]{40}$`) + var AgentMode = EnumFlag + var BranchNamePattern = regexp.MustCompile(`[[:word:]-]+`) + var CliVersionPath = filepath.Join(TempDir, "cli-latest") + var ClusterDir = filepath.Join(SupabaseDirPath, "cluster") + var CmdSuggestion string + var Config = config.NewConfig(config.WithHostname(GetHostname())) + var ConfigPath = filepath.Join(SupabaseDirPath, "config.toml") + var CurrBranchPath = filepath.Join(SupabaseDirPath, ".branches", "_current_branch") + var CurrentDirAbs string + var CustomRolesPath = filepath.Join(SupabaseDirPath, "roles.sql") + var DNSResolver = EnumFlag + var DbAliases = []string + var DbId string + var DbTestsDir = filepath.Join(SupabaseDirPath, "tests") + var DeclarativeDir = filepath.Join(SupabaseDirPath, "database") + var DefaultApiHost = CurrentProfile.APIURL + var DenoPathOverride string + var DifferId string + var Docker = NewDocker() + var EdgeRuntimeAliases = []string + var EdgeRuntimeId string + var ErrContainerKilled = errors.New("exit 137") + var ErrEnvNotSupported = errors.New("--output env flag is not supported") + var ErrInvalidRef = errors.New("Invalid project ref format. Must be like `abcdefghijklmnopqrst`.") + var ErrInvalidSlug = errors.New(...) + var ErrInvalidToken = errors.New("Invalid access token format. Must be like `sbp_0102...1920`.") + var ErrMissingToken = errors.Errorf(...) + var ErrNotLinked = errors.Errorf("Cannot find project ref. Have you run %s?", Aqua("supabase link")) + var ErrNotLoggedIn = errors.New("You were not logged in, nothing to do.") + var ErrNotRunning = errors.Errorf("%s is not running.", Aqua("supabase start")) + var ErrPrimaryNotFound = errors.New("primary database not found") + var FallbackEnvFilePath = filepath.Join(FunctionsDir, ".env") + var FallbackImportMapPath = filepath.Join(FunctionsDir, "import_map.json") + var FuncSlugPattern = regexp.MustCompile(`^[A-Za-z][A-Za-z0-9_-]*$`) + var FunctionsDir = filepath.Join(SupabaseDirPath, "functions") + var GitIgnorePath = filepath.Join(SupabaseDirPath, ".gitignore") + var GlobalsSql string + var GotrueAliases = []string + var GotrueId string + var GotrueVersionPath = filepath.Join(TempDir, "gotrue-version") + var ImageNamePattern = regexp.MustCompile(`\/(.*):`) + var ImgProxyAliases = []string + var ImgProxyId string + var ImportMapsDir = filepath.Join(TempDir, "import_maps") + var InbucketAliases = []string + var InbucketId string + var InitialSchemaPg13Sql string + var InitialSchemaPg14Sql string + var InternalSchemas = migration.InternalSchemas + var KongAliases = []string + var KongId string + var LogflareAliases = []string + var LogflareId string + var MigrationsDir = filepath.Join(SupabaseDirPath, "migrations") + var NetId string + var NoBackupVolume = false + var OnGotrueID func(string) + var OutputFormat = EnumFlag + var PgDeltaVersionPath = filepath.Join(TempDir, "pgdelta-version") + var PgSchemas = migration.InternalSchemas[:2] + var PgmetaAliases = []string + var PgmetaId string + var PgmetaVersionPath = filepath.Join(TempDir, "pgmeta-version") + var PoolerAliases = []string + var PoolerId string + var PoolerUrlPath = filepath.Join(TempDir, "pooler-url") + var PoolerVersionPath = filepath.Join(TempDir, "pooler-version") + var PostHogAPIKey string + var PostHogEndpoint string + var PostgresVersionPath = filepath.Join(TempDir, "postgres-version") + var ProjectHostPattern = regexp.MustCompile(`^(db\.)([a-z]{20})\.supabase\.(co|red)$`) + var ProjectRefPath = filepath.Join(TempDir, "project-ref") + var ProjectRefPattern = regexp.MustCompile(`^[a-z]{20}$`) + var RealtimeAliases = []string + var RealtimeId string + var RealtimeVersionPath = filepath.Join(TempDir, "realtime-version") + var RestAliases = []string + var RestId string + var RestVersionPath = filepath.Join(TempDir, "rest-version") + var SchemasDir = filepath.Join(SupabaseDirPath, "schemas") + var SentryDsn string + var SnippetsDir = filepath.Join(SupabaseDirPath, "snippets") + var StorageAliases = []string + var StorageId string + var StorageMigrationPath = filepath.Join(TempDir, "storage-migration") + var StorageVersionPath = filepath.Join(TempDir, "storage-version") + var StudioAliases = []string + var StudioId string + var StudioVersionPath = filepath.Join(TempDir, "studio-version") + var SupabaseDirPath = "supabase" + var TempDir = filepath.Join(SupabaseDirPath, ".temp") + var UUIDPattern = regexp.MustCompile(`^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`) + var VectorAliases = []string + var VectorId string + var Version string + func Aqua(str string) string + func AssertProjectRefIsValid(projectRef string) error + func AssertServiceIsRunning(ctx context.Context, containerId string) error + func AssertSupabaseDbIsRunning() error + func AwsRegions() []string + func BindHostModules(cwd, relEntrypointPath, relImportMapPath string, fsys afero.Fs) ([]string, error) + func Bold(str string) string + func ChangeWorkDir(fsys afero.Fs) error + func CliProjectFilter(projectId string) filters.Args + func ConnectByConfig(ctx context.Context, config pgconn.Config, options ...func(*pgx.ConnConfig)) (*pgx.Conn, error) + func ConnectByConfigStream(ctx context.Context, config pgconn.Config, w io.Writer, ...) (*pgx.Conn, error) + func ConnectByUrl(ctx context.Context, url string, options ...func(*pgx.ConnConfig)) (*pgx.Conn, error) + func ConnectLocalPostgres(ctx context.Context, config pgconn.Config, options ...func(*pgx.ConnConfig)) (*pgx.Conn, error) + func DeleteAccessToken(fsys afero.Fs) error + func DockerExecOnce(ctx context.Context, containerId string, env []string, cmd []string) (string, error) + func DockerExecOnceWithStream(ctx context.Context, containerId, workdir string, env, cmd []string, ...) error + func DockerImagePull(ctx context.Context, imageTag string, w io.Writer) error + func DockerImagePullWithRetry(ctx context.Context, image string, retries int) error + func DockerNetworkCreateIfNotExists(ctx context.Context, mode container.NetworkMode, labels map[string]string) error + func DockerPullImageIfNotCached(ctx context.Context, imageName string) error + func DockerRemove(containerId string) + func DockerRemoveAll(ctx context.Context, w io.Writer, projectId string) error + func DockerRunJob(ctx context.Context, job DockerJob, stdout, stderr io.Writer) error + func DockerRunOnce(ctx context.Context, image string, env []string, cmd []string) (string, error) + func DockerRunOnceWithConfig(ctx context.Context, config container.Config, hostConfig container.HostConfig, ...) error + func DockerRunOnceWithStream(ctx context.Context, image string, env, cmd []string, stdout, stderr io.Writer) error + func DockerStart(ctx context.Context, config container.Config, hostConfig container.HostConfig, ...) (string, error) + func DockerStreamLogs(ctx context.Context, containerId string, stdout, stderr io.Writer, ...) error + func DockerStreamLogsOnce(ctx context.Context, containerId string, stdout, stderr io.Writer) error + func EncodeOutput(format string, w io.Writer, value any) error + func FallbackLookupIP(ctx context.Context, host string) ([]string, error) + func FormatRegion(region string) string + func FormatTime(t time.Time) string + func FormatTimestamp(timestamp string) string + func FormatTimestampVersion(timestamp string) string + func GetApiUrl(path string) string + func GetCurrentBranchFS(fsys afero.Fs) (string, error) + func GetCurrentTimestamp() string + func GetDebugLogger() io.Writer + func GetDeclarativeDir() string + func GetDenoPath() (string, error) + func GetDockerIds() []string + func GetGitBranch(fsys afero.Fs) string + func GetGitBranchOrDefault(def string, fsys afero.Fs) string + func GetGitHubClient(ctx context.Context) *github.Client + func GetHostname() string + func GetId(name string) string + func GetLatestRelease(ctx context.Context) (string, error) + func GetOrgBillingURL(orgSlug string) string + func GetOrgSlugFromProjectRef(ctx context.Context, projectRef string) (string, error) + func GetPoolerConfig(projectRef string) *pgconn.Config + func GetPoolerConfigPrimary(ctx context.Context, ref string) (api.SupavisorConfigResponse, error) + func GetRegistry() string + func GetRegistryAuth() string + func GetRegistryImageUrl(imageName string) string + func GetServices() types.Services + func GetSupabase() *supabase.ClientWithResponses + func GetSupabaseAPIHost() string + func GetSupabaseDashboardURL() string + func GetSupabaseDbHost(projectRef string) string + func GetSupabaseHost(projectRef string) string + func Green(str string) string + func InitConfig(params InitParams, fsys afero.Fs) error + func InstallOrUpgradeDeno(ctx context.Context, fsys afero.Fs) error + func IsAgentMode() bool + func IsBranchNameReserved(branch string) bool + func IsDockerRunning(ctx context.Context) bool + func IsGitIgnored(fp ...string) (bool, error) + func IsGitRepo() bool + func IsLocalDatabase(config pgconn.Config) bool + func IsPgDeltaEnabled() bool + func LoadAccessTokenFS(fsys afero.Fs) (string, error) + func LoadProfile(ctx context.Context, fsys afero.Fs) error + func MkdirIfNotExist(path string) error + func MkdirIfNotExistFS(fsys afero.Fs, path string) error + func NewBackoffPolicy(ctx context.Context) backoff.BackOffContext + func NewDocker() *client.Client + func NewErrorCallback(callbacks ...func(attempt uint) error) backoff.Notify + func NewRootFS(fsys afero.Fs) fs.FS + func ParsePoolerURL(connString string) (*pgconn.Config, error) + func ProcessDiffOutput(diffBytes []byte) ([]byte, error) + func ProcessDiffProgress(p Program, out io.Reader) error + func ProcessPullOutput(out io.ReadCloser, p Program) error + func Red(str string) string + func RemoveDuplicates[T comparable](slice []T) (result []T) + func RenderTable(markdown string) error + func ResolveCNAME(ctx context.Context, host string) (string, error) + func RunEdgeRuntimeScript(ctx context.Context, env []string, script string, binds []string, ...) error + func RunProgram(ctx context.Context, f func(p Program, ctx context.Context) error) error + func SaveAccessToken(accessToken string, fsys afero.Fs) error + func SaveProfileName(prof string, fsys afero.Fs) error + func SetConnectSuggestion(err error) + func ShortContainerImageName(imageName string) string + func SuggestClaudePlugin() string + func SuggestUpgradeOnError(ctx context.Context, projectRef, featureKey string, statusCode int) (orgSlug string, isGated bool) + func ToDockerPath(absHostPath string) string + func ToEnvMap(value any) (map[string]string, error) + func ToPostgresURL(config pgconn.Config) string + func ToRealtimeEnv(addr config.AddressFamily) string + func UpdateDockerIds() + func ValidateFunctionSlug(slug string) error + func WaitAll[T any](containers []T, exec func(container T) error) []error + func WriteConfig(fsys afero.Fs, _test bool) error + func WriteFile(path string, contents []byte, fsys afero.Fs) error + func Yellow(str string) string + type Console struct + IsTTY bool + func NewConsole() *Console + func (c *Console) PromptText(ctx context.Context, label string) (string, error) + func (c *Console) PromptYesNo(ctx context.Context, label string, def bool) (bool, error) + func (c *Console) ReadLine(ctx context.Context) string + type DenoScriptDir struct + BuildPath string + ExtractPath string + func CopyDenoScripts(ctx context.Context, fsys afero.Fs) (*DenoScriptDir, error) + type DialContextFunc func(context.Context, string, string) (net.Conn, error) + type DiffDependencies struct + Type string + type DiffEntry struct + Dependencies []DiffDependencies + DiffDdl string + GroupName string + SourceSchemaName *string + Status string + Type string + type DiffStream struct + func NewDiffStream(p Program) *DiffStream + func (c DiffStream) Collect() ([]byte, error) + func (c DiffStream) Stderr() io.Writer + func (c DiffStream) Stdout() io.Writer + type DockerJob struct + Cmd []string + Env []string + Image string + type EnumFlag struct + Allowed []string + Value string + func (a *EnumFlag) Set(p string) error + func (a *EnumFlag) Type() string + func (a EnumFlag) String() string + type InitParams struct + Overwrite bool + ProjectId string + UseOrioleDB bool + type Profile struct + APIURL string + AuthClientID string + DashboardURL string + DocsURL string + Name string + PoolerHost string + ProjectHost string + ProjectRegions []api.V1CreateProjectBodyRegion + StudioImage string + var CurrentProfile Profile + type Program interface + Quit func() + Send func(msg tea.Msg) + Start func() error + func NewProgram(model tea.Model, opts ...tea.ProgramOption) Program + type ProgressMsg *float64 + type PromptItem struct + Details string + Index int + Summary string + func PromptChoice(ctx context.Context, title string, items []PromptItem, ...) (PromptItem, error) + func (i PromptItem) Description() string + func (i PromptItem) FilterValue() string + func (i PromptItem) Title() string + type PsqlMsg *string + type StatusMsg string + type StatusWriter struct + func (t StatusWriter) Write(p []byte) (int, error)