Local Development and Database Branching // a more collaborative Supabase workflow 🚀

Поділитися
Вставка
  • Опубліковано 22 лип 2024
  • Day 2 - Supabase Local Dev: migrations, branching, and observability: supabase.com/blog/supabase-lo...
    Database Branching allows an ephemeral database to be created for every Git branch. This means entirely separate databases for Local Development, Preview, and Production.
    In this video, Jon Meyers shows off some new Supabase CLI commands that make database migrations simple - inspecting the difference between two databases and generating the SQL required to migrate. Additionally, he explains the theory behind the new Database Branching feature, which automates the cloning of databases for new features and demonstrates how changes can be merged into production.
    00:00 Introduction
    00:16 Overview of Production Supabase project
    00:30 Create Local Supabase project
    01:39 Clone structure of Production to Local database
    02:54 Clone seed data from Production to Local database
    03:47 Database Branching
    05:28 What are you going to build?
  • Наука та технологія

КОМЕНТАРІ • 63

  • @Supabase
    @Supabase  11 місяців тому +3

    Check out everything else that was shipped during Supabase Launch Week: supabase.com/launch-week
    Also watch how to use Hugging Face models with Supabase in Python or Typescript: ua-cam.com/video/RJccSbJ9Go4/v-deo.html

  • @psybitcoin
    @psybitcoin 11 місяців тому +28

    These videos make Supabase even better! Keep them up

    • @Supabase
      @Supabase  11 місяців тому +3

      Thanks a lot, we are very lucky to have Jon in our team!

    • @jonathansummers-muir1317
      @jonathansummers-muir1317 11 місяців тому +3

      @@Supabase Pixel density of Jon increases on every Launch Week video.

    • @JonMeyers
      @JonMeyers 11 місяців тому +1

      We will! 🚀

  • @ThugLifeModafocah
    @ThugLifeModafocah 10 місяців тому +1

    I cant wait to have it released to the public. This is a game changer. Very interesting. These toolings are next level.

  • @kamil_supabase_enjoyer
    @kamil_supabase_enjoyer 10 місяців тому +7

    I love this feature 😍😍😍😍😍😍😍😍 But we need more videos and tutorials to understand exactly how it works. Can you create DEV, STAGGING AND PROD?

  • @TheCRACKERNET
    @TheCRACKERNET 3 місяці тому

    Holy damn, these are some sick features and a very nice explanation!

  • @sunstryder
    @sunstryder 11 місяців тому

    Love your guides!! Awesome feature

  • @bustopher5837
    @bustopher5837 11 місяців тому

    Holy shit , an up to date supabase video

  • @eskelCz
    @eskelCz 11 місяців тому +4

    This is so cool, I wish I had this few months ago when I had to manually create a duplicate project for production

    • @JonMeyers
      @JonMeyers 11 місяців тому +4

      Good thing you have it for every future project! 🚀

  • @ThugLifeModafocah
    @ThugLifeModafocah 10 місяців тому

    this is really awesome.

  • @JulienReszka
    @JulienReszka 11 місяців тому +6

    ok that's pretty amazing
    😱

    • @JonMeyers
      @JonMeyers 11 місяців тому +1

      It sure is! ☝️

  • @kamil_supabase_enjoyer
    @kamil_supabase_enjoyer 4 місяці тому +1

    What about testing environment? How can I create one more env which is a copy of prod with different data and it can be used by testers before merge to production?

  • @hbela1000
    @hbela1000 7 місяців тому

    awesome feature..

  • @wata1991
    @wata1991 11 місяців тому +19

    so does this mean we can essentially get rid of having 2 supabase projects (prod + staging) and just use preview builds instead?

    • @codewrangler
      @codewrangler 11 місяців тому +12

      crossing my fingers that the answer to your question is yes

    • @JonathanSummersMuir
      @JonathanSummersMuir 11 місяців тому +4

      Yep 😁
      One of the main use cases we are building Branching for is so that you no longer need separate Supabase projects for different development environments.

    • @JonathanSummersMuir
      @JonathanSummersMuir 11 місяців тому +1

      @@codewrangler 🤞it’s a yes 👍

    • @wata1991
      @wata1991 11 місяців тому +3

      @@JonathanSummersMuir really good to hear. I’m kind of curious, was it partially inspired by vercel and how they have preview builds per branch?

    • @jonathansummers-muir1317
      @jonathansummers-muir1317 11 місяців тому +5

      ​@@wata1991 Yep, partly inspired by Vercel/Netlify as jam-stack developers will naturally want to connect their apps to preview based backends - Maybe they'll be some more news on that later this week 👀.

  • @supirman
    @supirman 9 місяців тому

    Great info here. For anyone trying to do db remote commit and then use it locally. For whatever reason, I ran into errors, I had to comment out several create schema lines for graphql, pgsodium, pg_temp_10, pg_toast_temp_10. I tried doing db reset and it tries to run this migration and fails because some of those schemas already existed. I then moved the migration file, did db reset, then moved file back and db reset, same error. So, just comment out the stuff that already exists I guess is the path forward.

  • @therhythmatic
    @therhythmatic 9 місяців тому

    Thanks for sharing!! Got pretty close with this one but I'm running into the following error when running `npx supabase db dump --data-only -f supabase/seed.sql`
    pg_dump: error: query failed: ERROR: permission denied for table hooks
    pg_dump: detail: Query was: LOCK TABLE "supabase_functions"."hooks" IN ACCESS SHARE MODE

  • @priyapal5529
    @priyapal5529 11 місяців тому +1

    can't able to paste token in vs code..
    so how I do it?

  • @ratul1125
    @ratul1125 8 місяців тому

    How do we work on multiple local projects on the same machine?

  • @maroxo79
    @maroxo79 8 місяців тому

    Hello @Supabase, could you give us clarity when database branching becomes available?

  • @sicario55
    @sicario55 10 місяців тому +1

    Bumped into migration errors between local & remote

  • @emjones8092
    @emjones8092 11 місяців тому +1

    Can’t wait for y’all to have a terraform provider so I can manage this along with the rest of my infra. Until then, I have to make do with neon 😢
    No shade.
    I just don’t think that it’s practical to try to buy in to outsourcing all of your concerns to SaaS’s if you can manage them all primarily through a unified control plane. Click-ops/cli ops gives you too many foot guns when you’ve outsourced your concerns to 15 different vendors.

  • @technicaldifficultysupport
    @technicaldifficultysupport 3 місяці тому

    Went real fast at the end there lol

  • @deepak.rocks.
    @deepak.rocks. 11 місяців тому +3

    Does this also grabs all the Postgres functions, triggers and ebge functions ?

    • @jonathansummers-muir1317
      @jonathansummers-muir1317 11 місяців тому +3

      I'm guessing your referring to Branching.
      Yep, Postgres functions and triggers will be in the Preview Branches if they are in the migration files.
      Edge functions is an interesting topic as the source code for those are probably in your git repository, so we _could_ provide some automation to deploy them automatically for you to the Preview Branch Supabase instance. The GitHub integration is a work in progress right now, but this was one of the ideas we had.

    • @deepak.rocks.
      @deepak.rocks. 11 місяців тому

      @@jonathansummers-muir1317 thanks

  • @pinheirobastos
    @pinheirobastos 11 місяців тому +2

    Is it possible to have that same workflow with self-hosted supabase?

  • @ShaneHoban
    @ShaneHoban 11 місяців тому +1

    Any idea on when/if bitbucket will be supported in the future?

    • @JonMeyers
      @JonMeyers 11 місяців тому

      We’re focusing on GitHub for alpha release, but will roll out to other providers as soon as we can!

  • @shashankphatkure
    @shashankphatkure 6 місяців тому

    We want a full tutorial with nextjs or nodejs

  • @dejoma.
    @dejoma. 11 місяців тому +1

    Too late bro, already switched to planetscale

    • @emjones8092
      @emjones8092 11 місяців тому

      Ohhhh. Do they have a terraform provider, too? 🎉

  • @Cdaprod
    @Cdaprod 11 місяців тому

    Vercel does this too

  • @nabinsaud4688
    @nabinsaud4688 11 місяців тому

    Logo changed green was better i think

    • @JonMeyers
      @JonMeyers 11 місяців тому +1

      Purple is our Launch Week brand! The green will return!

  • @RegalWK
    @RegalWK 26 днів тому

    So this is just migrations, you achieve something similar with code tbh

  • @AthensHorseParty
    @AthensHorseParty 11 місяців тому +5

    Lol come on, guys. This video is 11 days old. Following the instructions gives a "db commit is deprecated, use db pull instead." I got it to work fine after restarting but it's not a good look when your content team can't even get a heads up from the devs that they're putting out tutorials that are obsoleted within a fortnight.

    • @omarkarim9298
      @omarkarim9298 11 місяців тому +4

      Hardly, the command told you the fix

    • @bryjbry
      @bryjbry 7 місяців тому

      They’re moving fast, read the docs

  • @AW-pm7tr
    @AW-pm7tr 11 місяців тому

    Most people are building with nocode, so this video is not helpful.

    • @parvekefilosofi6492
      @parvekefilosofi6492 11 місяців тому +10

      Wouldn't be so sure about that 😄

    • @akiroha
      @akiroha 11 місяців тому

      "most" is a stretch. But I hope that something you find more useful is released soon!

    • @dinoscheidt
      @dinoscheidt 11 місяців тому +1

      Corrected: *people are building with no effort, so this video is not helpful.

    • @angus6858
      @angus6858 11 місяців тому +6

      Most people who use no code end up getting to a scenario where they need to write code.
      This is why platforms like Webflow, FlutterFlow and EditorX end up allowing you to write code. Because no-code sucks for anything that isn't generic boilerplate.

    • @AW-pm7tr
      @AW-pm7tr 11 місяців тому

      Like setting up a new db could have been done within supabase instead of command line.

  • @eskelCz
    @eskelCz 8 місяців тому

    supabase db dump --data-only -f supabase/seed.sql
    Dumping data from remote database...
    pg_dump: warning: there are circular foreign-key constraints on this table:
    pg_dump: detail: key
    In extension pgsodium 😕