utils

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const AccessTokenKey = "access-token"
View Source
const SupagrateDirectory = "supagrate"

Variables

View Source
var (
	ErrMissingToken = errors.New("Access token not provided. Supply an access token by running " + Green("supabase login") + " or setting the SUPABASE_ACCESS_TOKEN environment variable.")
)
View Source
var Version string

Functions

func ConnectDatabase

func ConnectDatabase(c Connection) *sql.DB

func EnsureMigrationTable

func EnsureMigrationTable(db *sql.DB)

func EnsureSchema

func EnsureSchema(db *sql.DB)

func Get

func Get(project string) (string, error)

func GetCurrentTimestamp

func GetCurrentTimestamp() string

func GetSupabaseToken

func GetSupabaseToken(fs afero.Fs) (string, error)

func Green

func Green(str string) string

func MkdirIfNotExist

func MkdirIfNotExist(fs afero.Fs, path string) error

func ParseConnectionString

func ParseConnectionString(connectionString string) *dburl.URL

func ParseCount

func ParseCount(count string) int

func Red

func Red(str string) string

func ResetMigrationTable

func ResetMigrationTable(db *sql.DB)

func ResetPublicSchema

func ResetPublicSchema(db *sql.DB)

func Test

func Test(db *sql.DB)

func UseDBEnvironmentVariables

func UseDBEnvironmentVariables(cmd *cobra.Command)

func UseDBFlags

func UseDBFlags(cmd *cobra.Command)

func Yellow

func Yellow(str string) string

Types

type Connection

type Connection struct {
	Host     string
	Port     string
	User     string
	Password string
	Name     string
}

Local Supabase: postgresql://postgres:postgres@localhost:54322/postgres

func (Connection) ConnectionString

func (c Connection) ConnectionString() string

func (Connection) URL

func (c Connection) URL() *dburl.URL

type ConnectionEnv

type ConnectionEnv struct {
	Env  string
	Flag string
}

Jump to

Keyboard shortcuts

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