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

Поделиться
HTML-код
  • Опубликовано: 12 июл 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: ruclips.net/video/RJccSbJ9Go4/видео.html

  • @psybitcoin
    @psybitcoin 11 месяцев назад +26

    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! 🚀

  • @kamil_supabase_enjoyer
    @kamil_supabase_enjoyer 9 месяцев назад +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?

  • @ThugLifeModafocah
    @ThugLifeModafocah 9 месяцев назад +1

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

  • @sunstryder
    @sunstryder 10 месяцев назад

    Love your guides!! Awesome feature

  • @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! 🚀

  • @TheCRACKERNET
    @TheCRACKERNET 2 месяца назад

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

  • @JulienReszka
    @JulienReszka 11 месяцев назад +6

    ok that's pretty amazing
    😱

    • @JonMeyers
      @JonMeyers 11 месяцев назад +1

      It sure is! ☝️

  • @bustopher5837
    @bustopher5837 11 месяцев назад

    Holy shit , an up to date supabase video

  • @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 👀.

  • @ThugLifeModafocah
    @ThugLifeModafocah 9 месяцев назад

    this is really awesome.

  • @hbela1000
    @hbela1000 7 месяцев назад

    awesome feature..

  • @kamil_supabase_enjoyer
    @kamil_supabase_enjoyer 3 месяца назад +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?

  • @technicaldifficultysupport
    @technicaldifficultysupport 2 месяца назад

    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

  • @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.

  • @emjones8092
    @emjones8092 10 месяцев назад +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.

  • @maroxo79
    @maroxo79 8 месяцев назад

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

  • @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

  • @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!

  • @priyapal5529
    @priyapal5529 10 месяцев назад +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?

  • @sicario55
    @sicario55 10 месяцев назад +1

    Bumped into migration errors between local & remote

  • @shashankphatkure
    @shashankphatkure 5 месяцев назад

    We want a full tutorial with nextjs or nodejs

  • @dejoma.
    @dejoma. 11 месяцев назад +1

    Too late bro, already switched to planetscale

    • @emjones8092
      @emjones8092 10 месяцев назад

      Ohhhh. Do they have a terraform provider, 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!

  • @Cdaprod
    @Cdaprod 11 месяцев назад

    Vercel does this too

  • @RegalWK
    @RegalWK 16 дней назад

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

  • @AthensHorseParty
    @AthensHorseParty 10 месяцев назад +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 10 месяцев назад +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 7 месяцев назад

    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 😕