Commit Graph
38 Commits
Author SHA1 Message Date
Joshen Lim fc7fb50aa2 Organize pg meta queries for studio (#43562)
## Context

We reached to a consensus that we'll keep manually written queries
within the `pg-meta` package

I'll shift queries over in several PRs but wanted to double check if the
changes here is a good folder structure

## Changes involved

- Am organizing dashboard queries in `pg-meta` based on product
  - So folder structure will be `/sql/studio/[product]/*.ts`
- Every constant will be exported directly from `pg-meta`'s index
- So consumption in dashboard will just be `import { xxx } from
'@supabase/pg-meta`

cc @avallete and @soedirgo on this one - lemme know if this is alright,
or if there's a preferred way to do this
2026-03-10 09:34:11 +07:00
Ivan Vasilov 1cd1ebfc7f chire: Sort imports in all packages, cms, design-system and ui-library apps (#41610)
Sorted all imports in all packages, `cms`, `design-system` and
`ui-library` apps by running `pnpm format` on them.

All changes in this PR are done by the script.
2026-02-05 13:54:10 +01:00
0e2c31bf60 feat: Stripe Sync Engine integration (#41317)
* add initial installation flow of stripe sync engine

* update docs link

* Add supabase_vault extension dep

* Add stripe logo to sync engine integration

* Move overview content to bottom of integration pages

* Add sync state to stripe sync page

* only check sync state if stripe integration is installed

* Use proper stripe-sync package and setup flows

* Improve sync engine installation ux

* Remove unused hardcoded dep

* Add alpha status to stripe sync engine integration

* fix typo

* run format

* fix types

* Rename the stripe-sync path to remove the 'integration". The path needs to have BASE_PATH to work on prod.

* Design tidy up (#41337)

UI tidy up

* update to latest sync engine package

* Add stripe key verification

* Remove noop try/catch

* Add integration isntallation telelemtry

* Add basic settings page

* Address coderabbit comments

* remove unused dep

* Remove state setting on render

* s/description/comment

* Cleanup settings screen UI

* Improve settings screen design

* update schema test snapshot

* Use latest stripe-sync-engine package

* Update repo url to new official location

* revert marketing change

* Update stripe sync engine package

* Add link to table from overview page

* Add feature flag and improve telemetry

* Fix missing useMemo dep

* add uninstall telemetry note

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com>
2025-12-20 00:42:10 +00:00
Andrew Valleteau 3221a38596 fix(pgmeta): table editor fails with reserved keyword column names (#41226)
* fix(pg-format): update reserved words list

* test: add more test

* fix: tests
2025-12-10 11:32:57 +01:00
Charis df63ce3658 fix(mssql foreign tables): disallow sort on columns filtered for equality (#40137)
There is an edge case interaction between the Postgres query parser and
MSSQL foreign tables, where the query parser may drop sort clauses that
are redundant with applied filters. This leads to invalid MSSQL syntax,
because the resulting query has a `limit` but no `sort`, and the user
sees a confusing error message.

This PR detects this edge case on MSSQL foreign tables. There are three
cases:
1. The user filters by a column, but there are still other columns
available for sorting. The default search for a sorting column will
leave out the filtered column.
2. The user filters by a column/several columns, and there are no more
columns that can be used for sorting. We stop the query and show an
admonition.
3. The user filters by a column, then tries to sort by the same column.
We stop the query and show an admonition.
2025-11-06 13:14:30 -05:00
7682bac0f3 Fix: Updated to use optimized search columns when getting user counts (#40107)
* Updated to use optimized search columns when getting user counts

* added unit tests for query builders

* minor

* Nit fix keywords URL param not getting loaded into search input field

* removed user footer

* updated tests for upstream

* updated integration tests

* updated tests to be int for paginated

* updated schema

* updated types

* updated type imports

* updated type imports

* Apply suggestion from @avallete

Co-authored-by: Andrew Valleteau <avallete@users.noreply.github.com>

* updated literal import

* refactor: use common escaping (#40186)

refactor: use utils for sql escaping

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Andrew Valleteau <avallete@users.noreply.github.com>
2025-11-06 15:32:34 +08:00
Charis 67c6ef6745 feat(pgmeta): filter by composite values (#39179)
* feat(pgmeta): filter by composite values

Current behavior:

Only single columns can be used as filters: `where version = 2`

New behavior:

Composite values can be used as filters: `where (id, version) = (1, 2)`

Motivation:

In order to correct an existing bug when fetching table rows, we need to
use cursor pagination on the primary key, but in order to handle
composite primary keys, we need to be able to filter by composite
values.

* refactor(pgmeta): allowlist in-tuple operators
2025-10-16 08:28:27 -04:00
Joshen LimandJordi Enric 011f6c3e87 Fix Table Editor not identifying truncated array column values properly (#37683)
* Fix Table Editor not identifying truncated array column values properly

* Add comment

* update tests

* Fix TS issues and shift test file to beside the file its testing

* Fix tests

---------

Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2025-08-06 11:11:14 +07:00
Joshen Lim b80e798ecd Table editor cast column type to text if filtering with like based filter (#37341)
* Table editor cast column type to text if filtering with like based filter

* Update pg-meta tests

* Fix test cases for ~~ in advanced-query.test

* Fix tests in table-row-query.test
2025-07-22 16:32:46 +08:00
Joshen LimandAlaister Young e70242f822 Chore/clean up assistant mcp feature flags (#36772)
* Clean up usage of newOrgAiOptIn and useBedrockAssistant feature flags

* Remove all OpenAI endpoints

* Fix for self-hosted

* Default isLimited to false

* Update PG meta tests

* Fix unit tests for model

* Revert pg meta tests

* Fix test

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2025-07-22 16:05:16 +08:00
Andrew ValleteauandJoshen Lim 2d0b321ec6 fix(table-editor): handle multi-dimentional array truncation and preview (#36108)
* fix(table-editor): handle multi-dimentional array truncation and preview

* fix(SidePanelEditor): fully load truncated input fields

* Small tweaks

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-06-05 10:52:47 +08:00
Andrew Valleteau 521979748b fix(studio): use null last order by default (#35794)
* fix(studio): use null last order by default

* chore(tests): update tests
2025-05-21 10:26:40 +02:00
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
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
Han QiaoandAndrew Valleteau 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
Han Qiao e2fddfeeeb fix: move policy requests to query route (#35500) 2025-05-12 23:54:46 +08:00
hallidayoandCharis Lam fbc48bf8f2 docs: ionic vue update (#35103)
* initial app without storage

* code tab typo

* format

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2025-04-17 22:53:28 +00:00
Andrew Valleteau c0bddbba9a fix(table-editor): use CTE optimization for table-editor selection (#35071)
* fix(table-editor): use CTE optimization for table-editor selection

* chore: add comments
2025-04-17 12:47:16 +08:00
Andrew Valleteau e36f1715b3 fix(studio): keep json formatting when truncating arrays (#34546) 2025-04-03 09:01:49 +02:00
Andrew Valleteau 23aec2190d fix(studio): update table-query-rows generated sql for truncation (#34237)
* chore(studio): move Query to pgMeta add tests

- Move the Query builder from studio to pgMeta
- Add e2e tests over the generated sql to ensure syntax and runtime
  result over pg database
- fix bug with orde by for table with undefined column

* chore: add table-row-query to pgMeta and tests

* chore: fix query import path

* chore: reduce maxArraySize

* chore: use pg-meta getTableRowsSql implementation in studio

* chore: add truncation on large array fields

* chore: set ES target for lint

* chore: update comment

* chore: reduce test size for CI
2025-03-25 16:51:55 +01:00
Charis 311232b3e1 feat(docs): ts hover annotations on code blocks (#34327) 2025-03-21 15:48:32 -04:00
Andrew Valleteau eb7efdef7f chore(studio): move Query to pgMeta add tests (#34232)
* chore(studio): move Query to pgMeta add tests

- Move the Query builder from studio to pgMeta
- Add e2e tests over the generated sql to ensure syntax and runtime
  result over pg database
- fix bug with orde by for table with undefined column

* chore: fix query import path

* chore: set ES target for lint

* chore: add github action for pg-meta test package

* chore: add tsconfig to sparse checkout
2025-03-20 19:04:58 +00:00
egor 3855a4170b docs: add status page rss guide (#34052) 2025-03-07 17:09:18 +00:00
Andrew Valleteau 791422b2d0 chore(pg-meta): migrate publications (#33732) 2025-03-06 10:34:08 +01:00
Andrew Valleteau 1413671941 chore(pg-meta): migrate extensions (#33702)
* chore(pg-meta): migrate extensions

* chore: use executeQuery for setup
2025-03-05 22:42:27 +01:00
Andrew Valleteau b79da1e59c chore(pg-meta): migrate config (#33698)
* chore(pg-meta): migrate config

Migrate config from: https://github.com/supabase/postgres-meta/blob/master/src/lib/PostgresMetaConfig.ts

* chore: use afterAll cleanup
2025-03-05 20:05:26 +01:00
Andrew Valleteau b5b9f975ba chore(pg-meta): migrate tests for roles (#33679)
* chore(pg-meta): migrate tests for roles

* chore: remove unused export
2025-03-05 19:54:48 +01:00
Andrew Valleteau e823a352a4 chore(pg-meta): migrate columns (#33724)
* chore(pg-meta): migrate columns wip migrate list

* chore(pg-meta): migrate columns

* chore(pg-meta): add test coverage

* chore: export pgcolumn array zod

* chore(pg-meta): migrate foreign-tables (#33703)

* chore(pg-meta): migrate foreign-tables

* chore: re-use columns zod definition

* chore(pg-meta): migrate tables logic and tests (#33758)

* chore(pg-meta): Migrate tables (wip)

* wip list

* chore(pg-meta): migrate tables test and code

* chore(pg-meta): migrate views (#33676)

* chore(pg-meta): migrate views

* fix: add includeColumsn return type conditionality

* chore(pg-meta): migrate materialized-views (#33694)

* chore(pg-meta): migrate materialized-views

* fix: add includeColumsn return type conditionality

* chore(pg-meta): migrate foreign-tables

* chore(pg-meta): Migrate tables (wip)

* chore: change columns

* Update pg-meta-tables.ts

* chore: fix merge
2025-03-05 19:39:03 +01:00
Andrew Valleteau 44e84ceab3 chore(pg-meta): migrate policies (#33680) 2025-03-04 11:46:19 +00:00
Andrew Valleteau 852ca11a8e chore(pg-meta): migrate triggers (#33675) 2025-03-04 11:28:20 +00:00
Andrew Valleteau ffddcab9b8 chore(pg-meta): migrate types sql (#33649) 2025-03-04 12:11:55 +01:00
Andrew Valleteau 585669a06d chore(pg-meta): migrate version (#33648) 2025-03-04 11:40:59 +01:00
Andrew Valleteau 06ef94a858 chore(pg-meta): migrate indexes (#33645)
* chore(pg-meta): migrate indexes

* chore(pg-meta): fix vector to array conversion

* chore: use common naming
2025-03-04 09:42:18 +00:00
Andrew Valleteau 82e72090f2 chore(pg-meta): migrate column-privileges (#33643)
chore(pg-meta): migrate column-privilges
2025-03-04 09:17:19 +00:00
Andrew Valleteau a6424164e5 chore(pg-meta): migrate table-privileges tests (#33506)
* chore(pg-meta): port functions tests

* chore: add new test for CURRENT arg creation

* chore: revert query style change

* chore: restore PGFunction type inference

* wip: remove type cast int8 on arg_types

* Revert "wip: remove type cast int8 on arg_types"

This reverts commit 6878a93bfb.

* wip: make tests work with both clients

* chore: use pg and type parser

* chore: use only pg

* chore: migrate table-privileges tests
2025-03-04 08:54:58 +00:00
Andrew Valleteau 0106c4b319 chore(pg-meta): port functions tests (#33480)
* chore(pg-meta): port functions tests
2025-02-14 16:11:07 +09:00
Andrew ValleteauandBobbie Soedirgo ff084444f0 chore: add tests pg meta package (#32849)
* chore: add basic tests structure and utils

* chore: add tests to pgMeta package

* chore: remove double default assignation

* chore: update pnpm-lock

* fix(pg-meta): don't convert oid to int8

---------

Co-authored-by: Bobbie Soedirgo <bobbie@soedirgo.dev>
2025-01-31 03:00:37 +00:00