utils

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FallbackGlobalsSql = `` /* 2354-byte string literal not displayed */

	ShadowDbName   = "supabase_shadow"
	PgbouncerImage = "edoburu/pgbouncer:1.15.0"
	KongImage      = "library/kong:2.1"
	GotrueImage    = "supabase/gotrue:v2.0.5"
	RealtimeImage  = "supabase/realtime:v0.15.0"
	PostgrestImage = "postgrest/postgrest:v7.0.1"
	DifferImage    = "supabase/pgadmin-schema-diff:cli-0.0.2"
	// Latest supabase/postgres image *on hosted platform*.
	LatestDbImage = "supabase/postgres:0.14.0"
)

pg_dumpall --dbname $DB_URL --globals-only --no-role-passwords | sed '/^CREATE ROLE postgres;/d' | sed '/^ALTER ROLE postgres WITH /d' | sed "/^ALTER ROLE .* WITH .* LOGIN /s/;$/ PASSWORD 'postgres';/"

Variables

View Source
var (
	Docker = func() *client.Client {
		docker, err := client.NewClientWithOpts(client.FromEnv)
		if err != nil {
			fmt.Fprintln(os.Stderr, "❌ Failed to initialize Docker client.")
			os.Exit(1)
		}
		return docker
	}()
	ApiPort     string
	DbPort      string
	DbImage     string
	ProjectId   string
	NetId       string
	DbId        string
	PgbouncerId string
	KongId      string
	GotrueId    string
	RealtimeId  string
	RestId      string
	DifferId    string
)

Functions

func AssertDockerIsRunning

func AssertDockerIsRunning()

func AssertSupabaseStartIsRunning

func AssertSupabaseStartIsRunning()

func DockerExec

func DockerExec(ctx context.Context, container string, cmd []string) (io.Reader, error)

func DockerRemoveAll

func DockerRemoveAll()

func DockerRun

func DockerRun(ctx context.Context, name string, config *container.Config, hostConfig *container.HostConfig) error

func GetCurrentBranch

func GetCurrentBranch() (*string, error)

func GetCurrentTimestamp

func GetCurrentTimestamp() string

func LoadConfig

func LoadConfig()

Types

type DiffEntry

type DiffEntry struct {
	Type             string  `json:"type"`
	Title            string  `json:"title"`
	Status           string  `json:"status"`
	SourceDdl        string  `json:"source_ddl"`
	TargetDdl        string  `json:"target_ddl"`
	DiffDdl          string  `json:"diff_ddl"`
	GroupName        string  `json:"group_name"`
	SourceSchemaName *string `json:"source_schema_name"`
}

Jump to

Keyboard shortcuts

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