Files
supabase/apps/studio/components/grid
Joshen Lim 26c838a433 Joshenlim/fe 4590 studio sql export can silently swap values for numeric (#51382)
## Context

Resolves https://github.com/supabase/supabase/issues/51330

Odd bug on the Table Editor where "Copy as SQL" CTA would misalign
column names to values if the columns had numerical like names such as
`2024` for example.

Also added an unrelated fix for "Copy as JSON":
- Was adding an `idx` column to the output even if the table didn't have
(was a react data grid internal detail)
- Column name ordering didn't match the table

## To reproduce:

1. Create and populate a table:
```
create table public.yearly_totals (id bigint, "2024" bigint, "2023" bigint);
insert into public.yearly_totals values (7, 99, 42);
```

2. Select the row in the Table Editor, then "Copy as SQL" -> The output
will turn out to be
```INSERT INTO public.yearly_totals (id, "2024", "2023") VALUES (42, 99, 7);```
instead of 
```INSERT INTO public.yearly_totals (id, "2024", "2023") VALUES (7,
99,42);```

## To test
- [ ] Verify that the Copy to SQL output matches the intended as per the
set up above
2026-10-08 11:41:16 +08:00
..