Commit Graph

514 Commits

Author SHA1 Message Date
Julien Goux
b7057fa9d8 fix: move triggers requests to query route (#35667) 2025-05-20 15:41:43 +08:00
Han Qiao
b09440bd47 fix: move table create update delete to query route (#35662)
* fix: move table create update delete to query route

* chore: implement query to fetch a single table

* fix: retrieve table after update

* chore: assign type to update table payload

* chore: use updated table columns for edit

* chore: make executeSql castable with generic (#35685)

* Chore/refactor derivate more types from queries (#35687)

* chore: make executeSql castable with generic

* chore: derivate types from performed queries

- It allows to decouple more the frontend logic and the pg-meta/sql-query logic allowing to reduce the number of cast
and get closer types between what we do fetch and what we expect in our components

* fix: remove existing check

* chore: handle null comment and check

* fix: format check name as identifier

---------

Co-authored-by: avallete <andrew.valleteau@supabase.io>
Co-authored-by: Andrew Valleteau <avallete@users.noreply.github.com>
2025-05-20 10:34:59 +08:00
Ivan Vasilov
b94ca1d53b fix: Minor fixes for the Cron integration (#35674)
* Fix the CronJob type because its name is optional.

* The Job previous runs page should be identified by job id, not job name because it can be undefined. Fix the tabs to show the job name by using additional query param.

* Add a tooltip explaining that cron jobs without names can't be edited.

* The parser for cron jobs should handle URLS with query params or hashes.

* Remove the .only description from the tests.

* Show Unknown for cron jobs which have "" as name.

* Fix a crash when a cron job has "1 second" (singular) as schedule.

* Calculate the next run properly when the schedule is "1 second".

* Show a simplified confirm modal when deleting a cron job without a name.
2025-05-16 11:49:29 +02:00
Andrew Valleteau
45a239f1d5 fix: change the message for transient errors (#35691) 2025-05-15 09:03:59 -02:30
Han Qiao
dc2f1270db fix: move column delete and update to query route (#35497)
* fix: move column create request to query route

* chore: replace table id with fully qualified name

* chore: consolidate default column value tests

* chore: consolidate array column tests

* chore: test setting default value to null

* fix: move column delete and update to query route

* chore: remove unused code
2025-05-15 11:42:29 +08:00
Joshen Lim
227bb54853 Improve auth policies RLS warnings granularity (#35579) 2025-05-14 18:02:07 +08:00
Han Qiao
80791c01b5 fix: move column create request to query route (#35532)
* fix: move column create request to query route

* chore: replace table id with fully qualified name

* chore: consolidate default column value tests

* chore: consolidate array column tests

* chore: test setting default value to null

* chore: remove unused code

---------

Co-authored-by: Andrew Valleteau <avallete@users.noreply.github.com>
2025-05-14 13:23:31 +08:00
Han Qiao
5601bb3e9c fix: move publication create and update to query route (#35633)
* fix: move publication create and update to query route

* fix: update mutation should use query route
2025-05-14 12:54:58 +08:00
Andrew Valleteau
27f3257c42 chore: remove executeSql error leverage centralized pgMetaGuard instead (#35635) 2025-05-13 10:12:24 +02:00
Julien Goux
8b45671ff6 fix: move column privileges to query route (#35560)
* fix: move column privileges to query route

* add query keys

* chore: reverts read query for column privileges

---------

Co-authored-by: Qiao Han <qiao@supabase.io>
2025-05-13 12:56:21 +08:00
Han Qiao
ca06acef00 fix: move extension requests to query route (#35583)
* fix: move extension requests to query route

* chore: escape schema name as identifier
2025-05-13 00:31:18 +08:00
Han Qiao
e2fddfeeeb fix: move policy requests to query route (#35500) 2025-05-12 23:54:46 +08:00
Andrew Valleteau
71b261932e chore(refacto): throw error instances (#35617)
* chore: throw error instance for pgMetaGuard

* chore: throw error instance for Query utils

* chore: attempt to fix flawkyness
2025-05-12 10:53:15 +02:00
Raminder Singh
520428680d feat: call the new api endpoints to handle partial failures in pg_replicate (#35418)
* feat: use the new tenant-source api to atomically create the tenant and source in pg_replicate

* feat: use the new sink-pipeline api to atomically create the sink and pipeline in pg_replicate

* fix: remove some unused imports

* feat: use the new sink-pipeline api to atomically update the sink and pipeline in pg_replicate

* feat: deleting the sink cascades to delete the pipeline

* chore: update api types

* fix: revert accidental update to types

* remove unused code

* add a comment explaining why deleting only sink is enough
2025-05-10 12:04:37 +05:30
Etienne Stalmans
6d09404779 feat: add mfa enforcement toggle (#34307)
* feat: add mfa enforcement toggle

Allows toggling MFA enforcement on an organization level.

Depends on API change #22088

* fix: toggle and disable action for non-owner

* chore: disable for free plans

* chore: disable toggle for org MFA if current user doesn't have MFA enabled

* set initial state

* move org mfa to security page

* use zod resolver

* fix initial values

* useQueryClient in the organization-mfa-mutation

* chore: warn about losing access to mfa orgs

* Some refactors, fixes and improvements

* chore: feature flag mfa enforce page

* Tiny fix

* Leave comment

---------

Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-05-09 16:56:49 +02:00
Joshen Lim
232a26a68d Add custom error handler around fetch method (#35562)
* Add custom error handler for fetch error 'Failed to fetch'

* Refactor EdgeFunctionTesterSheet to use react query instead of manually calling fetch

* Use new fetchHandler for where we're calling fetch

* Revert
2025-05-09 15:22:55 +08:00
Andrew Valleteau
31aad403de fix(studio): early fail query when x-connection-encrypted is invalid (#35331)
* fix(studio): early fail query when x-connection-encrypted is invalid

* fix(studio): uniformize readDatabase and projectDetails connString handling

* chore: update api types

* chore: add connectionString null option

* fix: only enforce x-connection-encrypted on platform

* chore: refactor connString check in a single point

* chore: fix guard logic

* chore: fix pgMetaGuard

* chore: fix types
2025-05-08 12:11:03 +02:00
Ivan Vasilov
b93e9dfe0a chore: Only fetch overdue invoices if the user is logged in (#35545)
* Only fetch overdue invoices if the user is logged in.

* Remove ProjectList case.

* Move the check in the query. Use isLoggedIn.
2025-05-08 10:05:02 +02:00
Kevin Grüneberg
77d99e0f04 chore: branching compute hours copy (#35524) 2025-05-07 15:31:03 +00:00
Jonathan Summers-Muir
2815dac7e0 Feat/index suggestions inline (#35107)
* init

* hovercard

* adds button to install index advisor

* hover card now now insert indexes

* update

* moved hook

* align alert dialog to design syste,

* Update index-advisor.utils.ts

* shows all index statements now

* Update query-performance.tsx

* Some refactors

* Clean up

* Fix

* One last nit refactor

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-05-07 19:09:58 +08:00
Alaister Young
74101318ce Revert "fix: move column create request to query route" (#35503)
Revert "fix: move column create request to query route (#35491)"

This reverts commit 5e75276e9c.
2025-05-06 13:01:30 +00:00
Han Qiao
5e75276e9c fix: move column create request to query route (#35491) 2025-05-06 16:38:36 +08:00
Jordi Enric
785fcbacc8 Network Bans fixes (#35472)
* add loading and error states

* fix cmd k menu links

* Add hook for getting user's ip address

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-05-06 09:29:42 +02:00
Francesco Sansalvadore
a4cfcd9b2e global user dropdown in docs and www (#35063)
* docs: user nav dropdown

* www: user dropdown nav

* update menus

* chore: add complete local storage allowlist

* move all local-storage to common

* reload after logOut

* add local storage key changes from #35175

* fix errors

* add more keys

* fix merge bugs

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2025-05-05 11:48:06 +02:00
Alaister Young
2b419c70a1 chore: add usercentrics for consent management (#35384)
* chore: add usercentrics for consent management

* client component to make next.js happy

* address feedback

* move consent state to common

* fix import

* ensure page events are sent correctly

* add feature flag provider to ui library site

* fix ui lib 500 error

* skip in test env

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2025-05-05 13:18:48 +08:00
divit
691ab75cb1 feat: change default us region to us east 2 (#35452) 2025-05-04 16:08:01 +05:30
Jordi Enric
8e48426117 table exports: fix type, add tests (#35422)
fix type, add tests
2025-05-02 18:02:44 +08:00
Kevin Grüneberg
12ba4da4a5 feat: groundwork for larger instance sizes (#35373) 2025-05-02 15:45:03 +07:00
Jordi Enric
5a03fde0d6 fix table exports (#35420)
* fix table exports

* change return for removing square brackets
2025-05-02 16:12:55 +08:00
Saxon Fletcher
3aadc009e6 feat: billing address, name and tax id for org creation/upgrade (#34922)
We currently get support requests about adding or amending invoices due to no billing address being set. Changes in this PR:
- Unify tax id and billing address into a single form
- Add ability to set billing name that diverges from org name
- Add ability to set billing address & tax id during org creation (only paid plans)
- Add ability to set billing address & tax id during plan upgrade
2025-05-02 10:10:41 +08:00
angelico
14562e9c8a chore: init useIsOrioleDbInAws (#35325)
* chore: check for cloud provider in useIsOrioleDb

* chore: introduce useIsOrioleDbInAwsNew instead

* chore: consolidate to using useIsOrioleDb

* chore: selectively include useIsOrioleDbInAwsNew in conditionals

* fix: prettier

* fix: incorrect cloud provider

* fix: update conditional instead

* fix: prettier

* Simplify logic

* Smol fix

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-04-30 15:29:48 +08:00
Jonathan Summers-Muir
21bbc93afa Chore/table editor filter sorts logic moved to hooks (#35138)
* init

* update Popovers to use new hooks

* Update Header.tsx

* made primitive components for filter and sorts

* Delete FilterPopoverWrapper.tsx

* Delete SortPopoverWrapper.tsx

* remove

* Create README.md

* Update README.md

* fix sort popover issues

* Update SupabaseGrid.tsx

* move DeleteConfirmationDialogs into context

* fix issue with

* more stuff for alaister

* fix ts and tables pages

* First round of clean up

* Update README.md

* Smol fix

* Fix issues identified

* Smol fix

* Fix updating table name in database/tables not invalidating

* Improve SQL editor invalidation logic

* Add fix to reopen last opened table when landing on table editor

* Smol fix

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-04-30 14:19:21 +08:00
Alaister Young
f18b08d241 fix: multiple unique constraints on single column (#35326) 2025-04-28 16:38:58 +08:00
divit
634f86d2d6 feat: disable us east and change default to us west (#35296) 2025-04-26 07:15:11 +00:00
Raminder Singh
23ceb9072d Add replication UI in Studio (#30090)
* add dummy sinks and pipelines pages

* update api types

* show empty sources state

* show empty replication state at /replication

* create source when enable replication button is clicked

* improve replication page when replication is enabled

* replace sources page with publications page

* publications table

* show publications in table

* create publication wip

* show toast error instead of throwing an exception

* user can now delete a publication

* show empty sinks page

* create and list sinks

* add ui to delete a sink

* show pipelines on the pipelines page

* add ui to create and delete pipelines

* get pipeline status wip

* show pipeline status wip

* show correct label on action buttons

* start and stop pipelines

* remove a couple of console.logs

* fix error when deleting a pipeline

* only consider replication enabled when a source with name = ref is present

* add source and sink names

* correct colspan for 'no pipelines' row

* hide 'supabase_realtime' publication on ui

* move filtering to fetch query

* show sink name in ui

* show source/sink names on pipelines page

* fix start/stop status shown on ui

* fix prettier formatting

* update api types

* extract pipeline action button as a separate component

* fix a crashing page

* fixed publications page crash

* update to match with changes in api

* add new replication page under database

* hide replication page behind feature flag

* update types

* update api types

* show destinations empty state

* add destinations table

* factor out components from Destinations table

* show status dot

* move pipeline fetch query to parent component

* add ability to enable/disable a pipeline

* show loader when starting or stopping a pipeline

* fix a bug in which loading & empty states were shown together

* fix a bug in which error & empty states were shown together

* wrap in default layout

* add new destination panel

* add type field

* fix a forwardRef error

* fix layout

* create destination

* delete destination

* add ability to create or delete destinations with pipelines

* create source if missing

* show only a single error

* add an enable switch

* new layout

* add subsections

* comment out unused code

* show enabled switch only in the header

* close panel when destination is created

* disable buttons when api requests in flight

* reduce panel size

* remove commented out code

* treat max size and max fill secs as numbers

* use drop down to show publications

* simpler vertical layout

* add separators

* add form validation

* remove publications drop down padding

* add new publication button

* hide advanced settings behind an accordion

* add some margin between icon and text

* show publications panel on clicking new publication button

* add header to new publication panel

* fix validation not running for publication drop down

* create publication in the new publication panel

* add table selector in new publication panel

* update api types

* remove old code

* update platform.d.ts

* update navigation bar utils

* remove a redirect from replication page to publications page

* ask user for confirmation before deleting destination

* edit destination panel

* edit destination panel values fixed

* bug fixes

* fix prettier formatting

* enable/disable pipeline after editing

* rename snake_case params to camelCase

* loading button when editing

* remove merge markers

* update api types

* add max_staleness parameter in sinks for bigquery

* add read replicas flow diagram to replication page

* remove an unused import

* Revert "add read replicas flow diagram to replication page"

This reverts commit 8852d7847b457885603dba786141a8aaf8e99350.

* add panel to warn users about additional cost before creating a destination

* hide replication page contents behind a feature flag

* fix merge conflicts

* styling changes

* revert static flag

* styling updates

* fixes

* fix switch

* copy

* fix layout

---------

Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com>
2025-04-23 10:52:46 +05:30
Bobbie Soedirgo
bc6cca73bb fix: remove refs to pgsodium keys from vault & wrappers (#35168) 2025-04-22 20:49:18 +08:00
Joshen Lim
58a9db9db5 Chore/fix searching in table editor clearing tabs (#35198)
* Fix searching in table editor clears tabs

* Clean

* clean

* Make close button slightly bigger
2025-04-22 17:33:21 +07:00
Kevin Grüneberg
173cc56e71 feat: expose project perms to team plan (#35007) 2025-04-21 10:05:54 +08:00
Bobbie Soedirgo
b7e9b82a44 fix: handle new Wrappers in create server sql (#35075)
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-04-17 19:02:46 +08:00
Joshen Lim
fd10704cc1 Make feature preview available + Fix up Connect UI for local self-host (#35060)
* Make feature preview available for local self-host

* Fix up Connect UI for local / self-host

* Fix

* Fix

* Fix
2025-04-16 19:35:09 +08:00
Joshen Lim
a47c93c3d3 Fix joining an organization projects are not loaded initially (#35033) 2025-04-15 20:14:46 +08:00
Kevin Grüneberg
c0e1e02999 chore: make additional compute costs more prominent (#35010) 2025-04-15 15:54:23 +08:00
Bobbie Soedirgo
919b3e9225 fix: wrappers sql (#35012)
Make Wrappers queries handle old and new Vault/Wrappers. On new
Vault (0.3.0+) and Wrappers (0.4.6), pgsodium is not used, so queries
for mutations need to be adjusted.
2025-04-15 14:32:00 +08:00
Kevin Grüneberg
d05bbb669f perf: use subscription plan from org response (#34993) 2025-04-14 20:37:19 +08:00
Joshen Lim
ab2ac05f10 Fix re-rendering of Account AuditLogs (#34994)
* Temp

* Fix

* Remove conosle log

* Fix

* Fix
2025-04-14 18:05:20 +08:00
Francesco Sansalvadore
939e5c855a feat: reports infra o11y (#33310)
* test client connections charts

* add granularity to database dashboard

* add range selection

* add selection to area charts

* refactor ChartHeader

* fix default

* fix time preset selected label and add tooltip actions

* client connections stacked chart

* polish all new chartts

* change attribute

* fix

* add real queries

* memory stack

* cleanup

* precision 1

* update charts

* add endpoints

* tooltip

* format

* improve charts

* toggle max value

* show limit

* cleanup

* cleanup

* update api schema

* fix ram_usage_max_available

* remove pgbouncer and comments

* show total with percentage in chart header

* pretty

* hide

* update reports database

* remove client_connections

* revert

* fix connectionStrings error

* restore correct queries and conditions

* vertically zoom in to percentage data

* add feature flag logic on charts

* add feature flag logic to date picker

* chore: remove comment

* add tooltip to charts metrics

* chore: comment new pg endpoints

* feat: lazy load ComposedChartHandler queries

* feat: dim non-hovered chart values when hovering chart label item

* feat: improve dim styling

* chore: improve light mode stacked chart colors

* chore: remove 15s interval

* chore: sync types

* chore: remove type

* chore: restore type

* fix hook error

* show chart type toggle

* remove console log

* temp

* keep connections charts as before

* restore DateRangePicker

* show last aggregate value when not hovering

* clean up imports

* disk IOps read and write

* restore flag

* refactor queries

* clean up grafana promo banner

* Update database-charts.ts | updated language

* fix hook error

* fix hook error

* fix hook error

* attempt fix hook error

---------

Co-authored-by: TheOtherBrian1 <91111415+TheOtherBrian1@users.noreply.github.com>
2025-04-14 10:53:52 +02:00
Han Qiao
698e585a65 feat: fetch beta cli release version (#34923)
* feat: fetch beta cli release version

* Small refactors

* Fix

* Fix

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-04-14 16:20:03 +08:00
Joshen Lim
84f73bb675 Chore/use readonly connection string for queryblock (#34892)
* Use read only connection string in queryblock

* Add comments
2025-04-11 16:43:06 +08:00
Alaister Young
af462c0e57 chore: refactor role impersonation (#34827)
* chore: refactor role impersonation

* fix: handle undefined claims in role impersonation SQL generation
2025-04-11 08:17:13 +00:00
Kevin Grüneberg
3ce7e400a1 feat: revamped invoice breakdown (#34861)
- Read Replica and Branching Compute is now explicitly listed (previously Read Replica compute was not distinguishable)
- All usage items have a link to their respective docs
- Branching Compute is aggregated into a single line item to avoid listing dozens of branches (they are listed in the tooltip still)
- Displays basic discounts with a strike-through price
- For Replica+Compute, it specifically lists the projects as sub line items, whereas other line items are not broken down, it's shown on the tooltip
- Compute credits are a sub line item under compute, rather than having it separate 
- Pricing is displayed on the tooltip
- Breakdown focuses on costs, rather than mixing cost, usage and line item pricing descriptions
- Avoid confusing users in the breakdown with hourly usage (for add-ons)
- Fixed number formatting to properly work with negative number and 0 (use 2 decimals)
- Upcoming Invoice Section is hidden for Free Plan users
2025-04-11 12:40:59 +08:00