Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/docs/content/guides/self-hosting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ The following third-party providers have shown consistent support for the self-h
description: 'Deploys using Kubernetes.',
href: 'https://stackgres.io/blog/running-supabase-on-top-of-stackgres/',
},
{
name: 'Pigsty',
description: 'Deploys using Ansible.',
href: 'https://pigsty.io/blog/db/supabase/',
},
].map((x) => (
<div className="md:col-span-6" key={x.href}>
<Link href={x.href} passHref>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const WrapperDynamicColumns = ({
<div className="flex flex-col gap-4">
{columns.map((column, idx) => (
<div key={column.id} className="flex flex-col">
<div className="flex items-center gap-2">
<div className="flex items-center gap-x-2">
<Input
className="flex-1 [&_label]:!p-0"
layout="vertical"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const WrapperRow = ({ wrapper }: WrapperRowProps) => {
</TableCell>
</TableRow>
<Sheet open={editWrapperShown} onOpenChange={() => setisClosingEditWrapper(true)}>
<SheetContent size="default" tabIndex={undefined}>
<SheetContent size="lg" tabIndex={undefined}>
<EditWrapperSheet
wrapper={wrapper}
wrapperMeta={integration.meta}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const WRAPPER_HANDLERS = {
REDIS: 'redis_fdw_handler',
PADDLE: 'wasm_fdw_handler',
SNOWFLAKE: 'wasm_fdw_handler',
CAL: 'wasm_fdw_handler',
}

export const WRAPPERS: WrapperMeta[] = [
Expand Down Expand Up @@ -2084,4 +2085,211 @@ export const WRAPPERS: WrapperMeta[] = [
},
],
},
{
name: 'cal_wrapper',
description: 'Cal.com is a scheduling platform',
handlerName: WRAPPER_HANDLERS.CAL,
validatorName: 'wasm_fdw_validator',
icon: `${BASE_PATH}/img/icons/cal-com-icon.svg`,
extensionName: 'calFdw',
label: 'Cal.com',
docsUrl: 'https://supabase.com/docs/guides/database/extensions/wrappers/cal',
minimumExtensionVersion: '0.4.0',
server: {
options: [
{
name: 'fdw_package_url',
label: 'FDW Package URL',
required: true,
encrypted: false,
secureEntry: false,
defaultValue:
'https://github.com/supabase/wrappers/releases/download/wasm_cal_fdw_v0.1.0/cal_fdw.wasm',
hidden: true,
},
{
name: 'fdw_package_name',
label: 'FDW Package Name',
required: true,
encrypted: false,
secureEntry: false,
defaultValue: 'supabase:cal-fdw',
hidden: true,
},
{
name: 'fdw_package_version',
label: 'FDW Package Version',
required: true,
encrypted: false,
secureEntry: false,
defaultValue: '0.1.0',
hidden: true,
},
{
name: 'fdw_package_checksum',
label: 'FDW Package Checksum',
required: true,
encrypted: false,
secureEntry: false,
defaultValue: 'bca8a82d6c5f8da0aa58011940c4ddb40bb2c909c02dd89b488289c4fff890c1',
hidden: true,
},
{
name: 'api_url',
label: 'API URL',
required: false,
encrypted: false,
secureEntry: false,
defaultValue: 'https://api.cal.com/v2',
},
{
name: 'api_key_id',
label: 'API Key ID',
required: true,
encrypted: true,
secureEntry: true,
},
],
},
tables: [
{
label: 'My Profile',
description: 'Shows your Cal profile',
availableColumns: [
{
name: 'id',
type: 'bigint',
},
{
name: 'username',
type: 'text',
},
{
name: 'email',
type: 'text',
},
{
name: 'attrs',
type: 'jsonb',
},
],
options: [
{
name: 'object',
defaultValue: 'my_profile',
editable: false,
required: true,
type: 'text',
},
],
},
{
label: 'Event Types',
description: 'Shows your Event Types',
availableColumns: [
{
name: 'attrs',
type: 'jsonb',
},
],
options: [
{
name: 'object',
defaultValue: 'event-types',
editable: false,
required: true,
type: 'text',
},
],
},
{
label: 'Bookings',
description: 'Shows your Bookings',
availableColumns: [
{
name: 'attrs',
type: 'jsonb',
},
],
options: [
{
name: 'object',
defaultValue: 'bookings',
editable: false,
required: true,
type: 'text',
},
],
},
{
label: 'Calendars',
description: 'Shows your Calendars',
availableColumns: [
{
name: 'attrs',
type: 'jsonb',
},
],
options: [
{
name: 'object',
defaultValue: 'calendars',
editable: false,
required: true,
type: 'text',
},
],
},
{
label: 'Schedules',
description: 'Shows your Schedules',
availableColumns: [
{
name: 'id',
type: 'bigint',
},
{
name: 'name',
type: 'text',
},
{
name: 'attrs',
type: 'jsonb',
},
],
options: [
{
name: 'object',
defaultValue: 'schedules',
editable: false,
required: true,
type: 'text',
},
],
},
{
label: 'Conferencing',
description: 'Shows conferencing',
availableColumns: [
{
name: 'id',
type: 'bigint',
},
{
name: 'attrs',
type: 'jsonb',
},
],
options: [
{
name: 'object',
defaultValue: 'conferencing',
editable: false,
required: true,
type: 'text',
},
],
},
],
},
]
120 changes: 67 additions & 53 deletions apps/studio/components/interfaces/SQLEditor/MonacoEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import { useLocalStorageQuery } from 'hooks/misc/useLocalStorage'
import { useSelectedProject } from 'hooks/misc/useSelectedProject'
import { LOCAL_STORAGE_KEYS } from 'lib/constants'
import { useProfile } from 'lib/profile'
import { useAppStateSnapshot } from 'state/app-state'
import { useSqlEditorV2StateSnapshot } from 'state/sql-editor-v2'
import { cn } from 'ui'
import { Admonition } from 'ui-patterns'
import { useIsAssistantV2Enabled } from '../App/FeaturePreview/FeaturePreviewContext'
import { untitledSnippetTitle } from './SQLEditor.constants'
import type { IStandaloneCodeEditor } from './SQLEditor.types'
import { createSqlSnippetSkeletonV2 } from './SQLEditor.utils'
import { useIsAssistantV2Enabled } from '../App/FeaturePreview/FeaturePreviewContext'
import { useAppStateSnapshot } from 'state/app-state'

export type MonacoEditorProps = {
id: string
Expand Down Expand Up @@ -50,6 +51,8 @@ const MonacoEditor = ({
)

const snippet = snapV2.snippets[id]
const disableEdit =
snippet?.snippet.visibility === 'project' && snippet?.snippet.owner_id !== profile?.id

const executeQueryRef = useRef(executeQuery)
executeQueryRef.current = executeQuery
Expand Down Expand Up @@ -152,57 +155,68 @@ const MonacoEditor = ({
}, [])

return (
<Editor
className={cn(className, 'monaco-editor')}
theme={'supabase'}
onMount={handleEditorOnMount}
onChange={handleEditorChange}
defaultLanguage="pgsql"
defaultValue={snippet?.snippet.content.sql}
path={id}
options={{
tabSize: 2,
fontSize: 13,
minimap: { enabled: false },
wordWrap: 'on',
// [Joshen] Commenting the following out as it causes the autocomplete suggestion popover
// to be positioned wrongly somehow. I'm not sure if this affects anything though, but leaving
// comment just in case anyone might be wondering. Relevant issues:
// - https://github.com/microsoft/monaco-editor/issues/2229
// - https://github.com/microsoft/monaco-editor/issues/2503
// fixedOverflowWidgets: true,
suggest: {
showMethods: intellisenseEnabled,
showFunctions: intellisenseEnabled,
showConstructors: intellisenseEnabled,
showDeprecated: intellisenseEnabled,
showFields: intellisenseEnabled,
showVariables: intellisenseEnabled,
showClasses: intellisenseEnabled,
showStructs: intellisenseEnabled,
showInterfaces: intellisenseEnabled,
showModules: intellisenseEnabled,
showProperties: intellisenseEnabled,
showEvents: intellisenseEnabled,
showOperators: intellisenseEnabled,
showUnits: intellisenseEnabled,
showValues: intellisenseEnabled,
showConstants: intellisenseEnabled,
showEnums: intellisenseEnabled,
showEnumMembers: intellisenseEnabled,
showKeywords: intellisenseEnabled,
showWords: intellisenseEnabled,
showColors: intellisenseEnabled,
showFiles: intellisenseEnabled,
showReferences: intellisenseEnabled,
showFolders: intellisenseEnabled,
showTypeParameters: intellisenseEnabled,
showIssues: intellisenseEnabled,
showUsers: intellisenseEnabled,
showSnippets: intellisenseEnabled,
},
}}
/>
<>
{disableEdit && (
<Admonition
type="default"
className="m-0 py-2 rounded-none border-0 border-b [&>h5]:mb-0.5"
title="This snippet has been shared to the project and is only editable by the owner who created this snippet"
description='You may duplicate this snippet into a personal copy by right clicking on the snippet and selecting "Duplicate personal copy"'
/>
)}
<Editor
className={cn(className, 'monaco-editor')}
theme={'supabase'}
onMount={handleEditorOnMount}
onChange={handleEditorChange}
defaultLanguage="pgsql"
defaultValue={snippet?.snippet.content.sql}
path={id}
options={{
tabSize: 2,
fontSize: 13,
readOnly: disableEdit,
minimap: { enabled: false },
wordWrap: 'on',
// [Joshen] Commenting the following out as it causes the autocomplete suggestion popover
// to be positioned wrongly somehow. I'm not sure if this affects anything though, but leaving
// comment just in case anyone might be wondering. Relevant issues:
// - https://github.com/microsoft/monaco-editor/issues/2229
// - https://github.com/microsoft/monaco-editor/issues/2503
// fixedOverflowWidgets: true,
suggest: {
showMethods: intellisenseEnabled,
showFunctions: intellisenseEnabled,
showConstructors: intellisenseEnabled,
showDeprecated: intellisenseEnabled,
showFields: intellisenseEnabled,
showVariables: intellisenseEnabled,
showClasses: intellisenseEnabled,
showStructs: intellisenseEnabled,
showInterfaces: intellisenseEnabled,
showModules: intellisenseEnabled,
showProperties: intellisenseEnabled,
showEvents: intellisenseEnabled,
showOperators: intellisenseEnabled,
showUnits: intellisenseEnabled,
showValues: intellisenseEnabled,
showConstants: intellisenseEnabled,
showEnums: intellisenseEnabled,
showEnumMembers: intellisenseEnabled,
showKeywords: intellisenseEnabled,
showWords: intellisenseEnabled,
showColors: intellisenseEnabled,
showFiles: intellisenseEnabled,
showReferences: intellisenseEnabled,
showFolders: intellisenseEnabled,
showTypeParameters: intellisenseEnabled,
showIssues: intellisenseEnabled,
showUsers: intellisenseEnabled,
showSnippets: intellisenseEnabled,
},
}}
/>
</>
)
}

Expand Down
Loading
Loading