mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-23 06:27:57 +00:00
* list-tables * mongodb listcollections * changed listcollections to tables * ui changes * duplicate * updated invoke method * minor change * uichanges * twitching issue * bump version to 3.20.126-lts --------- Co-authored-by: gsmithun4 <gsmithun4@gmail.com>
507 lines
18 KiB
JSON
507 lines
18 KiB
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/ToolJet/ToolJet/develop/plugins/schemas/operations.schema.json",
|
|
"title": "Postgresql datasource",
|
|
"description": "A schema defining Postgresql datasource",
|
|
"type": "database",
|
|
"defaults": {
|
|
"mode": "sql"
|
|
},
|
|
"properties": {
|
|
"mode": {
|
|
"label": "",
|
|
"key": "mode",
|
|
"type": "dropdown-component-flip",
|
|
"description": "Single select dropdown for mode",
|
|
"list": [
|
|
{ "name": "SQL mode", "value": "sql" },
|
|
{ "name": "GUI mode", "value": "gui" }
|
|
],
|
|
"commonFields": {
|
|
"host": {
|
|
"label": "Host",
|
|
"placeholder": "Leave empty to use default",
|
|
"key": "host",
|
|
"type": "codehinter",
|
|
"description": "Enter host",
|
|
"height": "150px",
|
|
"shouldRenderTheProperty": "allow_dynamic_connection_parameters"
|
|
},
|
|
"database": {
|
|
"label": "Database",
|
|
"placeholder": "Leave empty to use default",
|
|
"key": "database",
|
|
"type": "codehinter",
|
|
"description": "Enter database name",
|
|
"height": "150px",
|
|
"shouldRenderTheProperty": "allow_dynamic_connection_parameters"
|
|
}
|
|
}
|
|
},
|
|
"sql": {
|
|
"query": {
|
|
"key": "query",
|
|
"type": "codehinter",
|
|
"description": "Enter query",
|
|
"height": "150px",
|
|
"editorType": "multiline",
|
|
"placeholder": "SELECT * FROM users"
|
|
},
|
|
"query_params": {
|
|
"key": "query_params",
|
|
"label": "SQL Parameters",
|
|
"type": "react-component-headers",
|
|
"description": "Parameters for the SQL query",
|
|
"buttonText": "Add SQL parameter",
|
|
"tooltip": "Use these parameters in the SQL query using name notation < :parameter_name >"
|
|
}
|
|
},
|
|
"gui": {
|
|
"operation": {
|
|
"label": "Operation",
|
|
"key": "operation",
|
|
"type": "dropdown-component-flip",
|
|
"description": "Single select dropdown for mode",
|
|
"list": [
|
|
{ "name": "List rows", "value": "list_rows" },
|
|
{ "name": "Create row", "value": "create_row" },
|
|
{ "name": "Update rows", "value": "update_rows" },
|
|
{ "name": "Delete rows", "value": "delete_rows" },
|
|
{ "name": "Upsert row", "value": "upsert_rows" },
|
|
{ "name": "Bulk insert", "value": "bulk_insert" },
|
|
{ "name": "Bulk update using primary key", "value": "bulk_update_pkey" },
|
|
{ "name": "Bulk upsert using primary key", "value": "bulk_upsert_pkey" }
|
|
]
|
|
},
|
|
"list_rows": {
|
|
"schema": {
|
|
"label": "Schema",
|
|
"key": "schema",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"operation": {
|
|
"invokeMethod": "listSchemas",
|
|
"label": "Fetch Schemas"
|
|
},
|
|
"description": "Select the database schema",
|
|
"placeholder": "Select schema"
|
|
},
|
|
"table": {
|
|
"label": "Table",
|
|
"key": "table",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"dependsOn": ["schema"],
|
|
"operation": {
|
|
"invokeMethod": "listTables",
|
|
"label": "Fetch Tables"
|
|
},
|
|
"pagination": true,
|
|
"pageSize": 6,
|
|
"description": "Select the table to query",
|
|
"placeholder": "Select table"
|
|
},
|
|
"where_filters": {
|
|
"label": "Filter",
|
|
"key": "where_filters",
|
|
"type": "react-component-sql-filters",
|
|
"parse_key": "list_rows.where_filters",
|
|
"description": "Filter conditions for the query",
|
|
"columnSelectorOperation": { "invokeMethod": "listColumns", "label": "Fetch Columns" },
|
|
"columnSelectorDependsOn": ["schema", "table"]
|
|
},
|
|
"order_filters": {
|
|
"label": "Sort",
|
|
"key": "order_filters",
|
|
"type": "react-component-sql-sort",
|
|
"parse_key": "list_rows.order_filters",
|
|
"description": "Sort conditions for the query",
|
|
"columnSelectorOperation": { "invokeMethod": "listColumns", "label": "Fetch Columns" },
|
|
"columnSelectorDependsOn": ["schema", "table"]
|
|
},
|
|
"aggregates": {
|
|
"label": "Aggregate",
|
|
"key": "aggregates",
|
|
"type": "react-component-sql-aggregate",
|
|
"parse_key": "list_rows.aggregates",
|
|
"description": "Aggregate functions for the query",
|
|
"columnSelectorOperation": { "invokeMethod": "listColumns", "label": "Fetch Columns" },
|
|
"columnSelectorDependsOn": ["schema", "table"]
|
|
},
|
|
"group_by": {
|
|
"label": "Group by",
|
|
"key": "group_by",
|
|
"type": "react-component-sql-groupby",
|
|
"parse_key": "list_rows.group_by",
|
|
"description": "Group by columns for the query",
|
|
"columnSelectorOperation": { "invokeMethod": "listColumns", "label": "Fetch Columns" },
|
|
"columnSelectorDependsOn": ["schema", "table"]
|
|
},
|
|
"limit": {
|
|
"label": "Limit",
|
|
"key": "limit",
|
|
"type": "codehinter",
|
|
"lineNumbers": false,
|
|
"description": "Maximum number of rows to return",
|
|
"height": "36px",
|
|
"className": "codehinter-plugins",
|
|
"placeholder": "Enter limit"
|
|
},
|
|
"offset": {
|
|
"label": "Offset",
|
|
"key": "offset",
|
|
"type": "codehinter",
|
|
"lineNumbers": false,
|
|
"description": "Number of rows to skip",
|
|
"height": "36px",
|
|
"className": "codehinter-plugins",
|
|
"placeholder": "Enter offset"
|
|
}
|
|
},
|
|
"create_row": {
|
|
"schema": {
|
|
"label": "Schema",
|
|
"key": "schema",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"operation": {
|
|
"invokeMethod": "listSchemas",
|
|
"label": "Fetch Schemas"
|
|
},
|
|
"description": "Select the database schema",
|
|
"placeholder": "Select schema"
|
|
},
|
|
"table": {
|
|
"label": "Table",
|
|
"key": "table",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"dependsOn": ["schema"],
|
|
"operation": {
|
|
"invokeMethod": "listTables",
|
|
"label": "Fetch Tables"
|
|
},
|
|
"pagination": true,
|
|
"pageSize": 6,
|
|
"description": "Select the table to insert into",
|
|
"placeholder": "Select table"
|
|
},
|
|
"columns": {
|
|
"label": "Columns",
|
|
"key": "columns",
|
|
"type": "react-component-sql-columns",
|
|
"parse_key": "create_row.columns",
|
|
"description": "Column name and value pairs to insert",
|
|
"columnSelectorOperation": { "invokeMethod": "listColumns", "label": "Fetch Columns" },
|
|
"columnSelectorDependsOn": ["schema", "table"]
|
|
}
|
|
},
|
|
"update_rows": {
|
|
"schema": {
|
|
"label": "Schema",
|
|
"key": "schema",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"operation": {
|
|
"invokeMethod": "listSchemas",
|
|
"label": "Fetch Schemas"
|
|
},
|
|
"description": "Select the database schema",
|
|
"placeholder": "Select schema"
|
|
},
|
|
"table": {
|
|
"label": "Table",
|
|
"key": "table",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"dependsOn": ["schema"],
|
|
"operation": {
|
|
"invokeMethod": "listTables",
|
|
"label": "Fetch Tables"
|
|
},
|
|
"pagination": true,
|
|
"pageSize": 6,
|
|
"description": "Select the table to update",
|
|
"placeholder": "Select table"
|
|
},
|
|
"where_filters": {
|
|
"label": "Filter",
|
|
"key": "where_filters",
|
|
"type": "react-component-sql-filters",
|
|
"parse_key": "update_rows.where_filters",
|
|
"description": "Filter conditions to target rows for update",
|
|
"columnSelectorOperation": { "invokeMethod": "listColumns", "label": "Fetch Columns" },
|
|
"columnSelectorDependsOn": ["schema", "table"]
|
|
},
|
|
"columns": {
|
|
"label": "Columns",
|
|
"key": "columns",
|
|
"type": "react-component-sql-columns",
|
|
"parse_key": "update_rows.columns",
|
|
"description": "Column name and value pairs to update",
|
|
"columnSelectorOperation": { "invokeMethod": "listColumns", "label": "Fetch Columns" },
|
|
"columnSelectorDependsOn": ["schema", "table"]
|
|
},
|
|
"allow_multiple_updates": {
|
|
"label": "Allow this query to update multiple rows",
|
|
"key": "allow_multiple_updates",
|
|
"type": "toggle",
|
|
"description": "When enabled, the query can modify multiple rows at once"
|
|
},
|
|
"zero_records_as_success": {
|
|
"label": "Consider query that updates zero records as success",
|
|
"key": "zero_records_as_success",
|
|
"type": "toggle",
|
|
"description": "When enabled, a query that matches no rows is still treated as successful"
|
|
}
|
|
},
|
|
"upsert_rows": {
|
|
"schema": {
|
|
"label": "Schema",
|
|
"key": "schema",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"operation": {
|
|
"invokeMethod": "listSchemas",
|
|
"label": "Fetch Schemas"
|
|
},
|
|
"description": "Select the database schema",
|
|
"placeholder": "Select schema"
|
|
},
|
|
"table": {
|
|
"label": "Table",
|
|
"key": "table",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"dependsOn": ["schema"],
|
|
"operation": {
|
|
"invokeMethod": "listTables",
|
|
"label": "Fetch Tables"
|
|
},
|
|
"pagination": true,
|
|
"pageSize": 6,
|
|
"description": "Select the table to upsert into",
|
|
"placeholder": "Select table"
|
|
},
|
|
"primary_key_columns": {
|
|
"label": "Primary key column(s)",
|
|
"key": "primary_key_columns",
|
|
"type": "codehinter",
|
|
"lineNumbers": false,
|
|
"description": "One or more primary key columns used to detect conflicts. Enter a single column name or an array for composite keys.",
|
|
"height": "36px",
|
|
"className": "codehinter-plugins",
|
|
"placeholder": "e.g. id or {{ [\"id\", \"tenant_id\"] }}"
|
|
},
|
|
"columns": {
|
|
"label": "Columns",
|
|
"key": "columns",
|
|
"type": "react-component-sql-columns",
|
|
"parse_key": "upsert_rows.columns",
|
|
"description": "Column name and value pairs to insert or update",
|
|
"columnSelectorOperation": { "invokeMethod": "listColumns", "label": "Fetch Columns" },
|
|
"columnSelectorDependsOn": ["schema", "table"]
|
|
},
|
|
"allow_multiple_updates": {
|
|
"label": "Allow this query to update multiple rows",
|
|
"key": "allow_multiple_updates",
|
|
"type": "toggle",
|
|
"description": "When enabled, the query can modify multiple rows at once"
|
|
},
|
|
"zero_records_as_success": {
|
|
"label": "Consider query that updates zero records as success",
|
|
"key": "zero_records_as_success",
|
|
"type": "toggle",
|
|
"description": "When enabled, a query that matches no rows is still treated as successful"
|
|
}
|
|
},
|
|
"delete_rows": {
|
|
"schema": {
|
|
"label": "Schema",
|
|
"key": "schema",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"operation": {
|
|
"invokeMethod": "listSchemas",
|
|
"label": "Fetch Schemas"
|
|
},
|
|
"description": "Select the database schema",
|
|
"placeholder": "Select schema"
|
|
},
|
|
"table": {
|
|
"label": "Table",
|
|
"key": "table",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"dependsOn": ["schema"],
|
|
"operation": {
|
|
"invokeMethod": "listTables",
|
|
"label": "Fetch Tables"
|
|
},
|
|
"pagination": true,
|
|
"pageSize": 6,
|
|
"description": "Select the table to delete from",
|
|
"placeholder": "Select table"
|
|
},
|
|
"where_filters": {
|
|
"label": "Filter",
|
|
"key": "where_filters",
|
|
"type": "react-component-sql-filters",
|
|
"parse_key": "delete_rows.where_filters",
|
|
"description": "Filter conditions to target rows for deletion",
|
|
"columnSelectorOperation": { "invokeMethod": "listColumns", "label": "Fetch Columns" },
|
|
"columnSelectorDependsOn": ["schema", "table"]
|
|
},
|
|
"limit": {
|
|
"label": "Limit",
|
|
"key": "limit",
|
|
"type": "codehinter",
|
|
"lineNumbers": false,
|
|
"description": "Maximum number of rows to delete",
|
|
"height": "36px",
|
|
"className": "codehinter-plugins",
|
|
"placeholder": "Enter limit"
|
|
},
|
|
"zero_records_as_success": {
|
|
"label": "Consider query that deletes zero records as success",
|
|
"key": "zero_records_as_success",
|
|
"type": "toggle",
|
|
"description": "When enabled, a query that matches no rows is still treated as successful"
|
|
}
|
|
},
|
|
"bulk_insert": {
|
|
"schema": {
|
|
"label": "Schema",
|
|
"key": "schema",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"operation": {
|
|
"invokeMethod": "listSchemas",
|
|
"label": "Fetch Schemas"
|
|
},
|
|
"description": "Select the database schema",
|
|
"placeholder": "Select schema"
|
|
},
|
|
"table": {
|
|
"label": "Table",
|
|
"key": "table",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"dependsOn": ["schema"],
|
|
"operation": {
|
|
"invokeMethod": "listTables",
|
|
"label": "Fetch Tables"
|
|
},
|
|
"pagination": true,
|
|
"pageSize": 6,
|
|
"description": "Select the table to insert into",
|
|
"placeholder": "Select table"
|
|
},
|
|
"records": {
|
|
"label": "Records to insert",
|
|
"key": "records",
|
|
"type": "codehinter",
|
|
"description": "Array of row objects to insert",
|
|
"height": "150px",
|
|
"editorType": "extendedSingleLine",
|
|
"placeholder": "{{ [ { id: 1, name: 'Alice' } ] }}"
|
|
}
|
|
},
|
|
"bulk_update_pkey": {
|
|
"schema": {
|
|
"label": "Schema",
|
|
"key": "schema",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"operation": {
|
|
"invokeMethod": "listSchemas",
|
|
"label": "Fetch Schemas"
|
|
},
|
|
"description": "Select the database schema",
|
|
"placeholder": "Select schema"
|
|
},
|
|
"table": {
|
|
"label": "Table",
|
|
"key": "table",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"dependsOn": ["schema"],
|
|
"operation": {
|
|
"invokeMethod": "listTables",
|
|
"label": "Fetch Tables"
|
|
},
|
|
"pagination": true,
|
|
"pageSize": 6,
|
|
"description": "Select the table to update",
|
|
"placeholder": "Select table"
|
|
},
|
|
"primary_key_columns": {
|
|
"label": "Primary key column(s)",
|
|
"key": "primary_key_columns",
|
|
"type": "codehinter",
|
|
"lineNumbers": false,
|
|
"description": "One or more primary key columns. Enter a single column name or an array for composite keys.",
|
|
"height": "36px",
|
|
"className": "codehinter-plugins",
|
|
"placeholder": "e.g. id or {{ [\"id\", \"tenant_id\"] }}"
|
|
},
|
|
"records": {
|
|
"label": "Records to update",
|
|
"key": "records",
|
|
"type": "codehinter",
|
|
"description": "Array of row objects to update. Each row must include all primary key column values.",
|
|
"height": "150px",
|
|
"editorType": "extendedSingleLine",
|
|
"placeholder": "{{ [ { id: 1, name: 'Alice' } ] }}"
|
|
}
|
|
},
|
|
"bulk_upsert_pkey": {
|
|
"schema": {
|
|
"label": "Schema",
|
|
"key": "schema",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"operation": {
|
|
"invokeMethod": "listSchemas",
|
|
"label": "Fetch Schemas"
|
|
},
|
|
"description": "Select the database schema",
|
|
"placeholder": "Select schema"
|
|
},
|
|
"table": {
|
|
"label": "Table",
|
|
"key": "table",
|
|
"type": "dynamic-selector",
|
|
"fxEnabled": true,
|
|
"dependsOn": ["schema"],
|
|
"operation": {
|
|
"invokeMethod": "listTables",
|
|
"label": "Fetch Tables"
|
|
},
|
|
"pagination": true,
|
|
"pageSize": 6,
|
|
"description": "Select the table to upsert into",
|
|
"placeholder": "Select table"
|
|
},
|
|
"primary_key_columns": {
|
|
"label": "Primary key column(s)",
|
|
"key": "primary_key_columns",
|
|
"type": "codehinter",
|
|
"lineNumbers": false,
|
|
"description": "One or more primary key columns used to detect conflicts. Enter a single column name or an array for composite keys.",
|
|
"height": "36px",
|
|
"className": "codehinter-plugins",
|
|
"placeholder": "e.g. id or {{ [\"id\", \"tenant_id\"] }}"
|
|
},
|
|
"records": {
|
|
"label": "Records to upsert",
|
|
"key": "records",
|
|
"type": "codehinter",
|
|
"description": "Array of row objects to insert or update. Each row must include all primary key column values.",
|
|
"height": "150px",
|
|
"editorType": "extendedSingleLine",
|
|
"placeholder": "{{ [ { id: 1, name: 'Alice' } ] }}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|