Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Remove unnecessary includeSystemSchemas, stay consistent with hosted (#35670)

Joshen Limbc4ca2e275f1
diff --git a/apps/studio/components/interfaces/Database/Triggers/TriggerSheet.tsx b/apps/studio/components/interfaces/Database/Triggers/TriggerSheet.tsx
index 78b68d7f8ed..8a357cc0b86 100644
--- a/apps/studio/components/interfaces/Database/Triggers/TriggerSheet.tsx
+++ b/apps/studio/components/interfaces/Database/Triggers/TriggerSheet.tsx
@@ -53,7 +53,7 @@ const FormSchema = z.object({
activation: z.string(),
enabled_mode: z.string(),
orientation: z.string(),
- function_name: z.string(),
+ function_name: z.string().min(1, 'Please select a database function for your trigger to call'),
function_schema: z.string(),
events: z.array(z.string()).min(1, 'Please select at least one event'),
@@ -374,46 +374,62 @@ export const TriggerSheet = ({ selectedTrigger, open, setOpen }: TriggerSheetPro
<Separator />
- <div className="px-5 flex flex-col gap-y-2">
- <p className="text-smn">Function to trigger</p>
- {function_name.length === 0 ? (
- <button
- type="button"
- className={cn(
- 'relative w-full rounded border border-default',
- 'bg-surface-200 px-5 py-1 shadow-sm transition-all',
- 'hover:border-strong hover:bg-overlay-hover'
- )}
- onClick={() => setShowFunctionSelector(true)}
- >
- <FormBoxEmpty
- icon={<Terminal size={14} strokeWidth={2} />}
- text="Choose a function to trigger"
- />
- </button>
- ) : (
- <div
- className={cn(
- 'relative w-full flex items-center justify-between',
- 'space-x-3 px-5 py-4 border border-default',
- 'rounded shadow-sm transition-shadow'
- )}
- >
- <div className="flex items-center gap-2">
- <div className="flex h-6 w-6 items-center justify-center rounded bg-foreground text-background focus-within:bg-opacity-10">
- <Terminal size="18" strokeWidth={2} width={14} />
+ <FormField_Shadcn_
+ name="function_name"
+ control={form.control}
+ render={() => (
+ <FormItemLayout layout="vertical" className="px-5">
+ <FormControl_Shadcn_>
+ <div className="flex flex-col gap-y-2">
+ <p className="text-smn">Function to trigger</p>
+ {function_name.length === 0 ? (
+ <button
+ type="button"
+ className={cn(
+ 'relative w-full rounded border border-default',
+ 'bg-surface-200 px-5 py-1 shadow-sm transition-all',
+ 'hover:border-strong hover:bg-overlay-hover'
+ )}
+ onClick={() => setShowFunctionSelector(true)}
+ >
+ <FormBoxEmpty
+ icon={<Terminal size={14} strokeWidth={2} />}
+ text="Choose a function to trigger"
+ />
+ </button>
+ ) : (
+ <div
+ className={cn(
+ 'relative w-full flex items-center justify-between',
+ 'space-x-3 px-5 py-4 border border-default',
+ 'rounded shadow-sm transition-shadow'
+ )}
+ >
+ <div className="flex items-center gap-2">
+ <div className="flex h-6 w-6 items-center justify-center rounded bg-foreground text-background focus-within:bg-opacity-10">
+ <Terminal size="18" strokeWidth={2} width={14} />
+ </div>
+ <p>
+ <span className="text-sm text-foreground-light">
+ {function_schema}
+ </span>
+ .
+ <span className="text-sm text-foreground">{function_name}</span>
+ </p>
+ </div>
+ <Button
+ type="default"
+ onClick={() => setShowFunctionSelector(true)}
+ >
+ Change function
+ </Button>
+ </div>
+ )}
</div>
- <p>
- <span className="text-sm text-foreground-light">{function_schema}</span>
- .<span className="text-sm text-foreground">{function_name}</span>
- </p>
- </div>
- <Button type="default" onClick={() => setShowFunctionSelector(true)}>
- Change function
- </Button>
- </div>
+ </FormControl_Shadcn_>
+ </FormItemLayout>
)}
- </div>
+ />
</>
)}
</form>
diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx
index 7a82772b5fa..3c696162ffd 100644
--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/ForeignKeySelector/ForeignKeySelector.tsx
@@ -293,7 +293,7 @@ export const ForeignKeySelector = ({
Select columns from{' '}
<code className="text-xs">
{fk.schema}.{fk.table}
- </code>
+ </code>{' '}
to reference to
</label>
<div className="grid grid-cols-10 gap-y-2">
diff --git a/apps/studio/pages/api/platform/pg-meta/[ref]/types.ts b/apps/studio/pages/api/platform/pg-meta/[ref]/types.ts
index 821152ed9cf..8adc18b77fc 100644
--- a/apps/studio/pages/api/platform/pg-meta/[ref]/types.ts
+++ b/apps/studio/pages/api/platform/pg-meta/[ref]/types.ts
@@ -1,8 +1,8 @@
-import { NextApiRequest, NextApiResponse } from 'next'
-import { PG_META_URL } from 'lib/constants'
-import apiWrapper from 'lib/api/apiWrapper'
import { constructHeaders } from 'lib/api/apiHelpers'
+import apiWrapper from 'lib/api/apiWrapper'
import { get } from 'lib/common/fetch'
+import { PG_META_URL } from 'lib/constants'
+import { NextApiRequest, NextApiResponse } from 'next'
export default (req: NextApiRequest, res: NextApiResponse) =>
apiWrapper(req, res, handler, { withAuth: true })
@@ -23,16 +23,9 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
const headers = constructHeaders(req.headers)
const response = await get(`${PG_META_URL}/types`, { headers })
- const includeSystemSchemas = req.query['include_system_schemas'] === 'true'
-
if (response.error) {
return res.status(400).json({ error: response.error })
}
- if (!includeSystemSchemas) {
- const types = response?.filter((x: any) => x.schema === 'public')
- return res.status(200).json(types)
- }
-
return res.status(200).json(response)
}