Skip to content

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

fixes updating wrappers

Alaister Young810ba1a54c2f
diff --git a/studio/components/interfaces/Database/Wrappers/WrapperTableEditor.tsx b/studio/components/interfaces/Database/Wrappers/WrapperTableEditor.tsx
index ecfd4122cbd..42d4f0c4a1a 100644
--- a/studio/components/interfaces/Database/Wrappers/WrapperTableEditor.tsx
+++ b/studio/components/interfaces/Database/Wrappers/WrapperTableEditor.tsx
@@ -109,7 +109,13 @@ export default WrapperTableEditor
const Option = ({ option }: { option: TableOption }) => {
if (option.type === 'select') {
return (
- <Listbox>
+ <Listbox
+ key={option.name}
+ id={option.name}
+ name={option.name}
+ label={option.label}
+ defaultValue={option.defaultValue ?? ''}
+ >
{[
...(!option.required
? [
diff --git a/studio/components/interfaces/Database/Wrappers/Wrappers.utils.ts b/studio/components/interfaces/Database/Wrappers/Wrappers.utils.ts
index 6bb28660cf5..3c83b64b9a9 100644
--- a/studio/components/interfaces/Database/Wrappers/Wrappers.utils.ts
+++ b/studio/components/interfaces/Database/Wrappers/Wrappers.utils.ts
@@ -48,14 +48,11 @@ export const makeValidateRequired = (options: { name: string; required: boolean
export const formatWrapperTables = (tables: any[]) => {
return tables.map((table, index: number) => {
- const object = table.options.find((option: string) => option.startsWith('object='))
- const objectValue = object !== undefined ? object.split('=')[1] : undefined
-
return {
+ ...Object.fromEntries(table.options.map((option: string) => option.split('='))),
index,
columns: table.columns,
is_new_schema: false,
- object: objectValue,
schema: table.schema,
schema_name: table.schema,
table_name: table.name,
diff --git a/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsx b/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsx
index deb9fb8ab91..66ff692aba7 100644
--- a/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsx
+++ b/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsx
@@ -16,7 +16,9 @@ interface Props {
const DatabaseLayout: FC<Props> = ({ title, children }) => {
const { meta, ui, vault, backups } = useStore()
- const { isLoading } = meta.schemas
+ const { isLoading: isSchemasLoading } = meta.schemas
+ const { isLoading: isVaultLoading } = vault
+
const { isInitialized, error } = meta.tables
const project = ui.selectedProject
@@ -27,6 +29,7 @@ const DatabaseLayout: FC<Props> = ({ title, children }) => {
const isVaultEnabled = vaultExtension !== undefined && vaultExtension.installed_version !== null
const foreignDataWrappersEnabled = useFlag('foreignDataWrappers')
+ const isLoading = isSchemasLoading || (isVaultEnabled && isVaultLoading)
const [loaded, setLoaded] = useState<boolean>(isInitialized)
useEffect(() => {