import Snippets from 'components/to-be-cleaned/Docs/Snippets' import CodeSnippet from 'components/to-be-cleaned/Docs/CodeSnippet' import Param from 'components/to-be-cleaned/Docs/Param' import Description from 'components/to-be-cleaned/Docs/Description' const ResourceContent = ({ autoApiService, resourceId, resources, definitions, paths, selectedLang, showApiKey, refreshDocs, }: any) => { if (!paths || !definitions) return null const keyToShow = !!showApiKey ? showApiKey : 'SUPABASE_KEY' const resourcePaths = paths[`/${resourceId}`] const resourceDefinition = definitions[resourceId] const resourceMeta = resources[resourceId] const description = resourceDefinition.description || null const methods = Object.keys(resourcePaths).map((x) => x.toUpperCase()) const properties = Object.entries(resourceDefinition.properties || []).map(([id, val]: any) => ({ ...val, id, required: resourceDefinition?.required?.includes(id), })) return ( <>

{resourceId}

{properties.length > 0 && (
{properties.map((x) => (
))}
)} {methods.includes('GET') && ( <>

Read rows

To read rows in {resourceId}, use the select method.

Learn more.

Filtering

Supabase provides a wide range of filters.

Learn more.

)} {methods.includes('POST') && ( <>

Insert rows

insert lets you insert into your tables. You can also insert in bulk and do UPSERT.

insert will also return the replaced values for UPSERT.

Learn more.

)} {methods.includes('PATCH') && ( <>

Update rows

update lets you update rows. update will match all rows by default. You can update specific rows using horizontal filters, e.g. eq , lt, and is.

update will also return the replaced values for UPDATE.

Learn more.

)} {methods.includes('DELETE') && ( <>

Delete rows

delete lets you delete rows. delete will match all rows by default, so remember to specify your filters!

Learn more.

)} <>

Subscribe to changes

Supabase provides realtime functionality and broadcasts database changes to authorized users depending on Row Level Security (RLS) policies.

Learn more.

<>

Much more

These docs are a work in progress! See our{' '} docs {' '} for the additional functionality Supabase has to offer.

) } export default ResourceContent