Commit Graph

58 Commits

Author SHA1 Message Date
Kevin Grüneberg
4532286e04 fix: align with API types (#34821)
* fix: align with API types

* Update new-project.constants.ts
2025-04-08 17:17:35 +08:00
Kamil Ogórek
b06e0aa0cd ref: Remove redundant payload for backup download (#34541) 2025-03-31 16:33:00 +02:00
Alaister Young
b3f0cc7630 fix: pgbouncer ignore_startup_parameters field getting overridden (#34475) 2025-03-27 15:34:18 +01:00
Kevin Grüneberg
2b94dd7430 feat: Dedicated Pooler rollout (#34240) 2025-03-21 14:46:58 +01:00
Joshen Lim
548afeb2e0 Hide pool mode field in connection pooling (#33962)
* Hide pool mode field in connection pooling

* Add comment
2025-03-04 08:28:53 +08:00
Joshen Lim
0a4166a587 Support for Dedicated Pooler in Connection Pooling Part 2 (#33829)
* Init

* Initial set up for hooking up supavisor and pgbouncer

* Hook up pgbouncer status check after swapping pooler type

* Add check for nano compute for switching to pg bouncer

* Add check for ipv4 addon

* Remove expect error tag

* Update copy in IPv4SidePanel

* Add badge to select options for pooler types

* Hook up pgbouncer config for connect UI

* Refactor pooling-configuration react queries to supavisor-configuration

* Update Ipv4 compatability UI indicators in Connect UI when on pgbouncer

* Remove statement mode

* Resolve undefined problem with react hook form

* Fix

* Update UI texts from PgBouncer to Dedicated Pooler

* Feature flag changes

* Add pooler settings link in Connect UI

* Smol update

* Update session pooler description for pgbouncer
2025-02-28 16:26:47 +08:00
Joshen Lim
cb32aa9579 Use TimestampInfo for scheduled backups (#33892)
* Use TimestampInfo for scheduled backups

* Fix

* Update TimestampInfo

* Fix

* Fix
2025-02-28 15:55:30 +08:00
Joshen Lim
a458977e2d Support for Dedicated Pooler in Connection Pooling (#33817)
* Init

* Initial set up for hooking up supavisor and pgbouncer

* Hook up pgbouncer status check after swapping pooler type

* Add check for nano compute for switching to pg bouncer

* Add check for ipv4 addon

* Remove expect error tag

* Add badge to select options for pooler types

* Remove statement mode

* Resolve undefined problem with react hook form

* Fix

* Update UI texts from PgBouncer to Dedicated Pooler

* Feex

* FEEX

* Fix

* Small update to UI

* Smol update
2025-02-28 11:14:42 +08:00
Jordi Enric
d10db0f735 add pgbouncer config and status queries (#33772)
* add queries

* use different keys

* move folder

* rm old files

* Small refactoir

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-02-24 11:41:35 +08:00
Alaister Young
e1eaa9844c fix: indexes in use (#33672)
* fix: indexes in use

* add error state for indexes in use

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-02-18 18:06:06 +08:00
Joshen Lim
559236dbd0 Chore/query performance fixes and improvements (#32747)
* Show tab max value in seconds if > 1000ms

* Fix incorrect sort option in initial state with no URL state

* Fix trim of undefined in Query Performance when retrieving index
2025-01-13 23:29:28 +08:00
Joshen Lim
9d6cf3ee51 Add contextual invalidation in SQL Editor (#32675) 2025-01-09 18:06:31 +08:00
Alaister Young
c26a1a7e63 chore(studio): remove unused files (#32623) 2025-01-08 12:39:00 +08:00
Joshen Lim
a4243f438f Add restrictions for orioledb technical preview (#30410)
* Add restrictions for orioledb technical preview

* Add callouts to pgvector and postgis if orioledb

* Restrict restore to new project for orioledb

* Scaffold client side validation for preventing org upgrade if org has oriole db present

* Hook up proper logic for oriole

* Fix

* Remove console log

* Fix type

* Disable version selector if only one version is available

* chore: oriole badges

* UI updates based on requests

* Update copy

* Fix

* Dont open assistant if opt is selected

* Fix

* Fix

* Update badge

* Add feature flag for orioleDB

* Feature flag oriole check in plan update

---------

Co-authored-by: Paul Cioanca <paul.cioanca@supabase.io>
2024-11-30 17:36:15 +08:00
Joshen Lim
12d92aed99 Assistant V2 (#30523)
* start

* added panels

* remove stuff

* fixes and refinements

* clean up

* remove old assistant panel

* resizable assistant kinda

* use icon

* Add missing package

* remove canvas

* add suggestions

* updated empty state if no tables exist

* fix table condition

* Implement diffing if using assistant in sql editor

* Reinstate old assistant in SQL editor if feature preview is off

* pane size adjustment

* assistant button corners

* Add SQL snippet content to assistant if opening assistant in sql editor

* Add the necessary checks for opt in and hipaa

* revert adding snippet to assistant when opening assistant in sql editor

* Add cmd i shortcut

* Add admonitions for when disablePrompt is toggled on, and if no api key is set. Add footer note RE rate limitation

* Bump ai package in packages

* some fixes for backwards compability depending on feature preview toggled

* Rename feature preview property for new assistant

* Smol fix

* Prevent SQL snippet from running until message is finished

* only loading last message

* fix z-index

* save chat state to global state

* add debug to failed ai queries

* Add basic contextual invalidation

* Add explain code action to SQL editor

* Add link to abort ongoing queries from SqlSnippet

* Update feature preview content

* Fix

* Fix

* Fix

* Te4st

* Fix tests

* ONly show ai button within a project

* Fix PH tracking

* Beef up a bit more event tracking

* Rough fix to padding when assistant is open

* A bit more telemetry stuff

* Update prompts

* fix rls editing via assistant

* Update generate-v3.ts

prompt to get auth schema too

* Add policy satement to assistant when editing

* Address all comments

* fixc

* Fix SqlSnippet not taking full width on larger viewports

* Adjust max width

---------

Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com>
2024-11-25 18:50:56 +08:00
Alaister Young
6c592dec99 chore: remove useExecuteSqlQuery() part 2 (#30467)
* foreign-key-constraints

* update entity-types stale time

* schemas query

* deprecate useExecuteSqlQuery

* users count query

* database size query

* indexes query

* keywords query

* migrations query

* table columns

* database functions

* database roles query

* fdws query

* replication lag query

* ongoing queries query

* vault secrets query

* remove unneeded staleTime: 0

* max connections query

* fix entity types key in tests

* Some fixes

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-11-18 05:15:37 +00:00
Alaister Young
0e3bc5804b chore: remove useExecuteSqlQuery (part 1) (#30437)
* chore: remove useExecuteSqlQuery part 1

* fix invalidation

* fixes

* more fixes

* I fixed it, but tested on preview instead of local 🤦🏻

* only refetch table rows and not count on row updates

* removed unneeded invalidations and prefetched new table after create
2024-11-14 15:21:29 +08:00
Joshen Lim
225d461381 Hook up RLS to new assistant if feature flag is enabled (#30357)
* Hook up RLS to new assistant if feature flag is enabled

* Reset conversation if opening a different entity

* Add prompt to use alter policy if policy definition is provided

* Remove console log
2024-11-08 18:03:30 +08:00
Joshen Lim
01e81fd400 Chore/assistant tweaks 281024 (#30134)
* Add alpha notice

* Close assistant via cmd i if not focused on monaco

* Add edit with assistant CTA for database functions

* Attach existing function definition when editing a function to prompt

* Leave comments

* Small refactor
2024-10-29 15:10:00 +08:00
Alaister Young
5781937739 chore: aggressive prefetching (#29987)
* chore: aggressive prefetching

* use abort signals in prefetchers

* move encrypted columns to react-query

* prefetching for filter and sort applied

* prefetch remaining entity types

* prefetch tables in more places

* prefetch editor page on project panel

* add feature flag

* fix typescript

* nit

* Nit

* fix imports

* remove views check on encrypted schemas

* use fetchQuery instead of prefetchQuery

* fix useEncryptedColumnsQuery ts error

* filter by schema on encrypted columns

* don't use pg_get_tabledef for foreign tables

* Remove unnecesary import

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-10-24 20:59:35 +08:00
Joshen Lim
f521109ce2 Chore/database functions v2 (#29969)
* Init AiAssistantPanel

* Temp

* Temp

* iterating on assistant ux

* More spiking

* Tweaking...

* Moar tweaking..

* Even more tweaking

* Tweek

* More tweaks

* Final tweaking...

* TWEAK

* Spelling

* Fix

* Assistant error handling and small bug fix in context for message

* Add feature flag

* Fix

* Address all feedback

* Minor
2024-10-23 16:43:38 +08:00
Joshen Lim
d586346e27 Chore/sentry fixes 211024 (#30003)
* Resolve https://supabase.sentry.io/issues/5808689343

* Fix SecurityStatus map key prop issue

* Fix FileExplorerHeader to use ButtonTooltip

* Fix https://supabase.sentry.io/issues/5998687405

* Fix https://supabase.sentry.io/issues/5414129652

* Fix https://supabase.sentry.io/issues/5414129652

* Fix map key issue in QueryPerformanceGrid

* Add whitelist error for sign up mutation

* Fix map key in DiskUsage

* Fix prop name in info-tooltip
2024-10-22 15:21:06 +08:00
Joshen Lim
743bcb7e3c Ensure that backup is always available for download in restoring, restore failed or pause failed state (#29361) 2024-09-19 10:12:29 +08:00
Ivan Vasilov
df52ea7ee0 feat: Replace all toasts with sonner (#28250)
* Update the design of the sonner toasts. Add the close button by default.

* Migrate studio and www apps to use the SonnerToaster.

* Migrate all toasts from studio.

* Migrate all leftover toasts in studio.

* Add a new toast component with progress. Use it in studio.

* Migrate the design-system app.

* Refactor the consent toast to use sonner.

* Switch docs to use the new sonner toasts.

* Remove toast examples from the design-system app.

* Remove all toast-related components and old code.

* Fix the progress bar in the toast progress component. Also make the bottom components vertically centered.

* Fix the width of the toast progress.

* Use text-foreground-lighter instead of muted for ToastProgress text

* Rename ToastProgress to SonnerProgress.

* Shorten the text in sonner progress.

* Use the correct classes for the close button. Add a const var for the default toast duration. Remove the custom width class from sonner.

* Set the position for all progress toasts to bottom right. Set the duration for all toasts to the default (when reusing a toast id from loading/progress toast, the duration is set to infinity).

* Fix the playwright tests.

* Refactor imports to use ui instead of @ui.

* Change all imports of react-hot-toast with sonner. These components were merged since the last commit to this branch.

* Remove react-hot-toast lib.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2024-08-31 07:50:51 +08:00
Ivan Vasilov
6a29cd2bec feat: Choose which schemas to share with OpenAI (#28594)
* Change the getEntityDefinitions query to accept list of schemas instead of being hardcoded to public schema.

* Add a schema combo box for selecting schemas.

* Use the combobox in the SQL editor to select which schemas should be sent to the AI when asking a question.

* Add configurable schemas to AiPolicyEditor.

* Remove unneeded hook.

* Fix the AI settings modal.

* Add keys to the entity definitions query.

* Fix the AI settings modal which is used by cmdk flow.

* Minor fixes.

* Address feedback

* Some fixes

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-08-15 14:38:19 +08:00
Alaister Young
eb9ab2a7ab chore: update table def (#28278)
* chore: update table def

* fix double not null

* update test
2024-07-30 09:45:19 -02:30
Monica Khoury
4c6f0dd8b6 Fix: escape single quotes in queries to prevent syntax errors (#27417)
* Fix: escape single quotes in queries to prevent syntax errors

* Update apps/studio/data/database/retrieve-index-advisor-result-query.ts

* Update apps/studio/data/database/retrieve-index-advisor-result-query.ts

* Cleanup

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
2024-07-04 12:43:40 +03:00
Terry Sutton
6fa71c6c8e Chore/allow index advisor for postgrest queries (#27364)
* Run index advisor on postgrest queries

* Fix loading state
2024-06-20 17:47:30 +03:00
Alaister Young
8e47d317fa chore: pg-meta functions (#26881)
* start pg-meta functions

* pg meta create function

* pg meta database functions update and delete

* fix ts

* update execute sql error type

* update execute sql error type

* remove duplicate database functions query
2024-06-03 23:21:19 +08:00
Joshen Lim
163263c3c5 First round of wrapping RQ errors with handleError (#26384)
* First round of wrapping RQ errors with handleError

* Remove the throw before the handleError usage.

* Make the handling of an API error more versatile. Add logging in Sentry if the error is of unknown type.

* Remove throwing of the handleError function.

* Add return type to the handleError function to be never so that we're sure it always throws.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-05-17 16:30:55 +08:00
Bobbie Soedirgo
1d58f2a11b chore: use @supabase/pg-meta for role queries (#22821)
* chore: use @supabase/pg-meta for role queries

* chore: prettier

* fix: typo
2024-04-17 16:19:49 +07:00
Bobbie Soedirgo
f327f2b234 chore: use @supabase/pg-meta for schema mutation (#22619)
* chore: use @supabase/pg-meta for schema mutation

* fix schemas query invalidation

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
2024-04-17 11:04:21 +07:00
Joshen Lim
05eac4af51 Chore/switch index advisor installation to db extension (#22773)
* Switch installing index advisor to via db extension rather than direct sql

* Add CTA if index advisor is not available

* Update language

* Update copy

* Fix checking index advisor ext

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-04-16 21:27:11 +07:00
Joshen Lim
b07f8304e0 Feat/integrate index advisor (#22641)
* Update

* Clean up + fix UI

* Add data values to tab

* Add comment

* Format sql query in query details

* Clean uo

* Deprecate old files

* Address comments

* chore: update styles (#22591)

* Midway integrating index advisor

* Add feature flag, reinstate old UI for feature flag

* First iteration of integrating index advisor

* Add more details in index advisor and add feature flag

* Shift explain_query function into pg_temp

* Clean uo

* fix padding

* Update apps/studio/components/interfaces/QueryPerformanceV2/QueryPanel.tsx

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>

* Update UI

* Address some feedback

* Moar addressing feedback

* Update docs url

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-04-11 23:27:34 +08:00
Joshen Lim
ec59752bc0 Query Performance Facelift (#22568)
* Update

* Clean up + fix UI

* Add data values to tab

* Add comment

* Format sql query in query details

* Clean uo

* Deprecate old files

* Address comments

* chore: update styles (#22591)

* Add feature flag, reinstate old UI for feature flag

* Update apps/studio/components/interfaces/QueryPerformanceV2/QueryPerformance.tsx

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>

* Update apps/studio/components/interfaces/QueryPerformance/QueryPerformance.tsx

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>

* Address feedback

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2024-04-11 12:57:46 +08:00
Joshen Lim
1f388cc98e Set different colors for RLS templates UPDATE and ALL, and add placeholders with using and with check monaco fields (#22401) 2024-04-02 14:51:35 +02:00
Bobbie Soedirgo
8888bb0023 feat: initial version of @supabase/pg-meta (#22307)
* feat: initial version of @supabase/pg-meta

Unlike supabase/postgres-meta, this will be a pure-JS SQL & Zod schema builder

* chore: typescript 5.4

* fix: typescript errors
2024-04-01 18:07:34 +08:00
Joshen Lim
2fe00724a9 Read replicas support enabling physical backups (#22330)
* Read replicas support enabling physical backups rather than forcing a PITR addon

* Update

* Update endpoint

* Add missing warning for compute size on read replicas

* Update text

* Address feedback
2024-04-01 16:08:36 +07:00
Joshen Lim
5e5586d0ad Remove the check for connection string in create schema mutation (#22229) 2024-03-26 15:42:35 +07:00
Kevin Grüneberg
136728f6ab perf: reorganize a few imports to improve bundle size (#21743) 2024-03-05 12:49:58 +08:00
Kevin Grüneberg
f9a55935f5 chore: use type imports for types/interfaces (#21738) 2024-03-04 20:48:22 +08:00
Joshen Lim
0ddd1b4711 Remove duplicated types-query, use enumerated-types-query instead (#21632)
* Remove duplicated types-query, use enumerated-types-query instead

* Fix type
2024-02-29 11:29:57 +08:00
Joshen Lim
95991e3135 Fix view definition query (#21590) 2024-02-27 15:18:07 +08:00
Joshen Lim
dcdc3cd230 Fix table editor unable to update PK after renaming table (#21285)
* Fix table editor unable to update PK after renaming table

* Lint
2024-02-26 06:21:42 +00:00
Joshen Lim
7556a3181c Update error handling for table editor RQs (#21443) 2024-02-22 16:29:10 +08:00
Joshen Lim
632f8f95f4 Chore/pooler strings for read replicas (#21383)
* Midway

* Show respective pooler parameters based on selected database

* Add optional params to DatabaseSelector to de-async state between connection string and connection params on database settings page

* remove badge
2024-02-21 14:50:53 +08:00
Joshen Lim
0ee75935f7 Support for composite foreign keys in table editor (#21078)
* Init foreign keys manage

* Midway

* Midway

* Implement functionality for new foreign key management flow in table editor

* Deprecate old add and remove foreign key queries

* Lint

* Set editor dirty when managing foreign keys

* Add basic validation in new ForeignKeySelector

* Remove FK management in column editor, deprecate old foreign key selector components

* Add validation on columnm types for foreign keys

* Set column type to foreign key type if new column

* Show appropriate notices for when referenced column doesnt match source column type

* fix

* Remove comment

* Lint

* ColumnEditor swap position of data type and Fk
2024-02-13 10:42:06 +08:00
Ivan Vasilov
a18c11807d fix: Refetch project details when reseting the database password (#21053)
Invalidate the project details (and refetch the connection string) when the user resets the DB password.
2024-02-06 17:15:07 +01:00
Joshen Lim
351fa698ce Update GET and PATCH pooling config to use supavisor endpoints (#20944)
* Update GET and PATCH pooling config to use supavisor endpoints

* Fix TS warning

* Small fix

* Remove unused import
2024-02-06 15:03:10 +08:00
Alaister Young
a4f86bce8f chore: increase react-query stale time (#19465)
* chore: increase react-query stale time

* keep staleTime: 0 for table rows

* use staleTime: 0 for all user sql queries

* use staleTime: 0 for all pg-meta queries

* Some fixes

* fix updating tables

* fix bug while editing column names

* Fix deleting column in database/tables column list not revalidating UI

* Fix updating column in database/tables column list throwing ane rror

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-02-06 13:47:05 +08:00