mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 22:59:11 +03:00
* Add react-query mutations for columns APIs. * Use the new delete column mutation. * Remove the column store and replace all its methods with mutations from react-query. * Fix type errors. * Move some the meta store methods to be pure functions in sidepanel.utils. * Move the createColumn and updateColumn out of the metaStore. * Some refactors and fixes * Shift query invalidation when deleting column to mutation file instead of component file * reorder some code for my sanity * remove some @ts-ignores * remove more @ts-ignores * Update apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ColumnEditor/ColumnEditor.utils.ts * Fix ForeignKeyFormatter crashing client --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> Co-authored-by: Alaister Young <a@alaisteryoung.com> Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
Store
Store structure
At the root, there are currently 3 top-level stores in use: app, meta and ui (content is WIP at the moment). Each of them store the following information:
app: Application level data (Projects and organizations)meta: Database information (e.g Tables, Columns, Policies)ui: UI states that are common globallycontent: User-specific content (e.g Saved SQL snippets)
Accessing the store
The useStore hook is the entry point to access the store in your pages and components.
import { useStore } from 'hooks'
const { app, meta, ui } = useStore()
What is the jsonSchema folder
The files here are used to populate form fields on the dashboard with the ajv library. We have in mind to move away from this way of rendering form fields due to its rigid nature but we've yet to decide.