Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cmd/db.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ import (
"github.com/supabase/cli/internal/db/changes"
"github.com/supabase/cli/internal/db/commit"
"github.com/supabase/cli/internal/db/push"
remoteChanges "github.com/supabase/cli/internal/db/remote/changes"
remoteCommit "github.com/supabase/cli/internal/db/remote/commit"
"github.com/supabase/cli/internal/db/remote/set"
"github.com/supabase/cli/internal/db/reset"
Expand DownExpand Up@@ -88,6 +89,14 @@ var (
},
}

dbRemoteChangesCmd = &cobra.Command{
Use: "changes",
Short: "Print changes on the remote database since the last pushed migration.",
RunE: func(cmd *cobra.Command, args []string) error {
return remoteChanges.Run()
},
}

dbRemoteCommitCmd = &cobra.Command{
Use: "commit",
Short: "Commit changes on the remote database since the last pushed migration.",
Expand DownExpand Up@@ -123,6 +132,7 @@ func init() {
dbCmd.AddCommand(dbCommitCmd)
dbCmd.AddCommand(dbPushCmd)
dbRemoteCmd.AddCommand(dbRemoteSetCmd)
dbRemoteCmd.AddCommand(dbRemoteChangesCmd)
dbRemoteCmd.AddCommand(dbRemoteCommitCmd)
dbCmd.AddCommand(dbRemoteCmd)
dbCmd.AddCommand(dbResetCmd)
Expand Down
18 changes: 18 additions & 0 deletions cmd/stop.go
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
package cmd

import (
"github.com/spf13/cobra"
"github.com/supabase/cli/internal/stop"
)

var stopCmd = &cobra.Command{
Use: "stop",
Short: "Stop the Supabase local development setup.",
RunE: func(cmd *cobra.Command, args []string) error {
return stop.Run()
},
}

func init() {
rootCmd.AddCommand(stopCmd)
}
150 changes: 78 additions & 72 deletions examples/tour/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions internal/db/changes/changes.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,11 +50,14 @@ func Run() error {
return err
}

fmt.Println(diff)
return nil
}

var (
ctx, cancelCtx = context.WithCancel(context.Background())

diff string
)

func run(p *tea.Program) error {
Expand DownExpand Up@@ -99,10 +102,6 @@ func run(p *tea.Program) error {
}
}

if err := utils.RunServicesMigrations(ctx, utils.NetId, utils.DbId, utils.ShadowDbName); err != nil {
return err
}

{
extensionsSql, err := os.ReadFile("supabase/extensions.sql")
if errors.Is(err, os.ErrNotExist) {
Expand DownExpand Up@@ -186,7 +185,7 @@ func run(p *tea.Program) error {
return err
}

fmt.Println(string(diffBytes))
diff = string(diffBytes)
}

return nil
Expand Down
4 changes: 0 additions & 4 deletions internal/db/commit/commit.go
Original file line numberDiff line numberDiff line change
Expand Up@@ -106,10 +106,6 @@ func run(p *tea.Program, name string) error {
}
}

if err := utils.RunServicesMigrations(ctx, utils.NetId, utils.DbId, utils.ShadowDbName); err != nil {
return err
}

{
extensionsSql, err := os.ReadFile("supabase/extensions.sql")
if errors.Is(err, os.ErrNotExist) {
Expand Down
Loading