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
2 changes: 0 additions & 2 deletions apps/docs/content/docs/en/tools/kalshi.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ Retrieve your account balance and portfolio value from Kalshi
| --------- | ---- | ----------- |
| `balance` | number | Account balance in cents |
| `portfolioValue` | number | Portfolio value in cents |
| `balanceDollars` | number | Account balance in dollars |
| `portfolioValueDollars` | number | Portfolio value in dollars |

### `kalshi_get_positions`

Expand Down
2 changes: 2 additions & 0 deletions apps/docs/content/docs/en/tools/supabase.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Query data from a Supabase table
| `projectId` | string | Yes | Your Supabase project ID \(e.g., jdrkgepadsdopsntdlom\) |
| `table` | string | Yes | The name of the Supabase table to query |
| `schema` | string | No | Database schema to query from \(default: public\). Use this to access tables in other schemas. |
| `select` | string | No | Columns to return \(comma-separated\). Defaults to * \(all columns\) |
| `filter` | string | No | PostgREST filter \(e.g., "id=eq.123"\) |
| `orderBy` | string | No | Column to order by \(add DESC for descending\) |
| `limit` | number | No | Maximum number of rows to return |
Expand Down Expand Up @@ -97,6 +98,7 @@ Get a single row from a Supabase table based on filter criteria
| `projectId` | string | Yes | Your Supabase project ID \(e.g., jdrkgepadsdopsntdlom\) |
| `table` | string | Yes | The name of the Supabase table to query |
| `schema` | string | No | Database schema to query from \(default: public\). Use this to access tables in other schemas. |
| `select` | string | No | Columns to return \(comma-separated\). Defaults to * \(all columns\) |
| `filter` | string | Yes | PostgREST filter to find the specific row \(e.g., "id=eq.123"\) |
| `apiKey` | string | Yes | Your Supabase service role secret key |

Expand Down
11 changes: 11 additions & 0 deletions apps/sim/blocks/blocks/supabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ export const SupabaseBlock: BlockConfig<SupabaseResponse> = {
value: ['query', 'get_row', 'insert', 'update', 'delete', 'upsert', 'count', 'text_search'],
},
},
{
id: 'select',
title: 'Select Columns',
type: 'short-input',
placeholder: '* (all columns) or id,name,email',
condition: {
field: 'operation',
value: ['query', 'get_row'],
},
},
{
id: 'apiKey',
title: 'Service Role Secret',
Expand Down Expand Up @@ -1044,6 +1054,7 @@ Return ONLY the PostgREST filter expression - no explanations, no markdown, no e
projectId: { type: 'string', description: 'Supabase project identifier' },
table: { type: 'string', description: 'Database table name' },
schema: { type: 'string', description: 'Database schema (default: public)' },
select: { type: 'string', description: 'Columns to return (comma-separated, defaults to *)' },
apiKey: { type: 'string', description: 'Service role secret key' },
// Data for insert/update operations
data: { type: 'json', description: 'Row data' },
Expand Down
9 changes: 8 additions & 1 deletion apps/sim/tools/supabase/get_row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ export const getRowTool: ToolConfig<SupabaseGetRowParams, SupabaseGetRowResponse
description:
'Database schema to query from (default: public). Use this to access tables in other schemas.',
},
select: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Columns to return (comma-separated). Defaults to * (all columns)',
},
filter: {
type: 'string',
required: true,
Expand All @@ -44,7 +50,8 @@ export const getRowTool: ToolConfig<SupabaseGetRowParams, SupabaseGetRowResponse
request: {
url: (params) => {
// Construct the URL for the Supabase REST API
let url = `https://${params.projectId}.supabase.co/rest/v1/${params.table}?select=*`
const selectColumns = params.select?.trim() || '*'
let url = `https://${params.projectId}.supabase.co/rest/v1/${params.table}?select=${encodeURIComponent(selectColumns)}`

// Add filters (required for get_row) - using PostgREST syntax
if (params.filter?.trim()) {
Expand Down
9 changes: 8 additions & 1 deletion apps/sim/tools/supabase/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ export const queryTool: ToolConfig<SupabaseQueryParams, SupabaseQueryResponse> =
description:
'Database schema to query from (default: public). Use this to access tables in other schemas.',
},
select: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Columns to return (comma-separated). Defaults to * (all columns)',
},
filter: {
type: 'string',
required: false,
Expand Down Expand Up @@ -56,7 +62,8 @@ export const queryTool: ToolConfig<SupabaseQueryParams, SupabaseQueryResponse> =
request: {
url: (params) => {
// Construct the URL for the Supabase REST API
let url = `https://${params.projectId}.supabase.co/rest/v1/${params.table}?select=*`
const selectColumns = params.select?.trim() || '*'
let url = `https://${params.projectId}.supabase.co/rest/v1/${params.table}?select=${encodeURIComponent(selectColumns)}`

// Add filters if provided - using PostgREST syntax
if (params.filter?.trim()) {
Expand Down
2 changes: 2 additions & 0 deletions apps/sim/tools/supabase/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface SupabaseQueryParams {
projectId: string
table: string
schema?: string
select?: string
filter?: string
orderBy?: string
limit?: number
Expand All @@ -23,6 +24,7 @@ export interface SupabaseGetRowParams {
projectId: string
table: string
schema?: string
select?: string
filter: string
}

Expand Down