import * as Tooltip from '@radix-ui/react-tooltip'
import { PostgresFunction } from '@supabase/postgres-meta'
import { PermissionAction } from '@supabase/shared-types/out/constants'
import { includes, map as lodashMap, noop, uniqBy } from 'lodash'
import { observer } from 'mobx-react-lite'
import { useState } from 'react'
import { Button, IconLoader, IconSearch, Input } from 'ui'
import ProductEmptyState from 'components/to-be-cleaned/ProductEmptyState'
import { useCheckPermissions, useStore } from 'hooks'
import SchemaTable from './SchemaTable'
interface FunctionsListProps {
createFunction: () => void
editFunction: (fn: PostgresFunction) => void
deleteFunction: (fn: PostgresFunction) => void
}
const FunctionsList = ({
createFunction = noop,
editFunction = noop,
deleteFunction = noop,
}: FunctionsListProps) => {
const { meta } = useStore()
const [filterString, setFilterString] = useState Loading functions...
Error connecting to API {`${meta.functions.error?.message ?? 'Unknown error'}`}
PostgreSQL functions, also known as stored procedures, is a set of SQL and procedural commands such as declarations, assignments, loops, flow-of-control, etc.
It's stored on the database server and can be invoked using the SQL interface.
No results match your filter query