2023-06-20 06:57:10 +00:00
|
|
|
{
|
|
|
|
|
"$schema": "https://raw.githubusercontent.com/ToolJet/ToolJet/develop/plugins/schemas/operations.schema.json",
|
|
|
|
|
"title": "HarperDB datasource",
|
|
|
|
|
"description": "A schema defining HarperDB 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"
|
2023-06-28 12:17:15 +00:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "NoSQL mode",
|
|
|
|
|
"value": "nosql"
|
2023-06-20 06:57:10 +00:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"sql": {
|
|
|
|
|
"sql_query": {
|
|
|
|
|
"key": "sql_query",
|
|
|
|
|
"type": "codehinter",
|
2023-06-28 12:17:15 +00:00
|
|
|
"description": "Enter your SQL query",
|
2023-06-20 06:57:10 +00:00
|
|
|
"height": "150px"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"nosql": {
|
|
|
|
|
"operation": {
|
|
|
|
|
"label": "Operation",
|
|
|
|
|
"key": "operation",
|
|
|
|
|
"type": "dropdown-component-flip",
|
2023-06-28 12:17:15 +00:00
|
|
|
"description": "Single select dropdown for operation",
|
2023-06-20 06:57:10 +00:00
|
|
|
"list": [
|
|
|
|
|
{
|
|
|
|
|
"name": "Insert",
|
|
|
|
|
"value": "insert"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Update",
|
|
|
|
|
"value": "update"
|
2023-06-28 12:17:15 +00:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Delete",
|
|
|
|
|
"value": "delete"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Search By Hash",
|
|
|
|
|
"value": "search_by_hash"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Search By Value",
|
|
|
|
|
"value": "search_by_value"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Search By Conditions",
|
|
|
|
|
"value": "search_by_conditions"
|
2023-06-20 06:57:10 +00:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"insert": {
|
|
|
|
|
"schema": {
|
|
|
|
|
"label": "Schema",
|
|
|
|
|
"key": "schema",
|
2023-06-28 12:17:15 +00:00
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Enter schema",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
2023-06-20 06:57:10 +00:00
|
|
|
},
|
|
|
|
|
"table": {
|
|
|
|
|
"label": "Table",
|
|
|
|
|
"key": "table",
|
2023-06-28 12:17:15 +00:00
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Enter table name",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
2023-06-20 06:57:10 +00:00
|
|
|
},
|
|
|
|
|
"records": {
|
|
|
|
|
"label": "Records",
|
|
|
|
|
"key": "records",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"mode": "javascript",
|
|
|
|
|
"description": "Enter records to insert",
|
2023-06-28 12:17:15 +00:00
|
|
|
"placeholder": "[{id: 1, name: 'Jose', age: 24}]",
|
|
|
|
|
"height": "150px"
|
2023-06-20 06:57:10 +00:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"update": {
|
|
|
|
|
"schema": {
|
|
|
|
|
"label": "Schema",
|
|
|
|
|
"key": "schema",
|
2023-06-28 12:17:15 +00:00
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Enter schema",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
2023-06-20 06:57:10 +00:00
|
|
|
},
|
|
|
|
|
"table": {
|
|
|
|
|
"label": "Table",
|
|
|
|
|
"key": "table",
|
2023-06-28 12:17:15 +00:00
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Enter table name",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
2023-06-20 06:57:10 +00:00
|
|
|
},
|
|
|
|
|
"records": {
|
2023-06-28 12:17:15 +00:00
|
|
|
"label": "Records",
|
2023-06-20 06:57:10 +00:00
|
|
|
"key": "records",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"mode": "javascript",
|
|
|
|
|
"description": "Enter records to update",
|
2023-06-28 12:17:15 +00:00
|
|
|
"placeholder": "[{id: 1, age: 25}]",
|
|
|
|
|
"height": "150px"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"delete": {
|
|
|
|
|
"schema": {
|
|
|
|
|
"label": "Schema",
|
|
|
|
|
"key": "schema",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Enter Schema",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
|
|
|
|
},
|
|
|
|
|
"table": {
|
|
|
|
|
"label": "Table",
|
|
|
|
|
"key": "table",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Enter table name",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
|
|
|
|
},
|
|
|
|
|
"hash_values": {
|
|
|
|
|
"label": "Hash Values",
|
|
|
|
|
"key": "hash_values",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"mode": "javascript",
|
|
|
|
|
"description": "Enter hash attribute - primary key to delete records",
|
|
|
|
|
"placeholder": "[123, 65]",
|
|
|
|
|
"height": "150px"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"search_by_hash": {
|
|
|
|
|
"schema": {
|
|
|
|
|
"label": "Schema",
|
|
|
|
|
"key": "schema",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Enter Schema",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
|
|
|
|
},
|
|
|
|
|
"table": {
|
|
|
|
|
"label": "Table",
|
|
|
|
|
"key": "table",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Enter table name",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
|
|
|
|
},
|
|
|
|
|
"hash_values": {
|
|
|
|
|
"label": "Hash Values",
|
|
|
|
|
"key": "hash_values",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"mode": "javascript",
|
|
|
|
|
"description": "Enter hash attribute - primary key to search records",
|
|
|
|
|
"placeholder": "[123, 66]",
|
|
|
|
|
"height": "70px"
|
|
|
|
|
},
|
|
|
|
|
"attributes": {
|
|
|
|
|
"label": "Table Attributes",
|
|
|
|
|
"key": "attributes",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"mode": "javascript",
|
|
|
|
|
"description": "Enter table attributes to be queried",
|
|
|
|
|
"placeholder": "['name', 'age']",
|
|
|
|
|
"height": "70px"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"search_by_value": {
|
|
|
|
|
"schema": {
|
|
|
|
|
"label": "Schema",
|
|
|
|
|
"key": "schema",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Enter Schema",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
|
|
|
|
},
|
|
|
|
|
"table": {
|
|
|
|
|
"label": "Table",
|
|
|
|
|
"key": "table",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Enter table name",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
|
|
|
|
},
|
|
|
|
|
"search_attribute": {
|
|
|
|
|
"label": "Search Attribute",
|
|
|
|
|
"key": "search_attribute",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Attribute you wish to search",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
|
|
|
|
},
|
|
|
|
|
"search_value": {
|
|
|
|
|
"label": "Search Value",
|
|
|
|
|
"key": "search_value",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Value you wish to search",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
|
|
|
|
},
|
|
|
|
|
"attributes": {
|
|
|
|
|
"label": "Table Attributes",
|
|
|
|
|
"key": "attributes",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"mode": "javascript",
|
|
|
|
|
"description": "Enter Table Attributes to be queried",
|
|
|
|
|
"placeholder": "['name', 'age']",
|
|
|
|
|
"height": "100px"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"search_by_conditions": {
|
|
|
|
|
"schema": {
|
|
|
|
|
"label": "Schema",
|
|
|
|
|
"key": "schema",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Enter Schema",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
|
|
|
|
},
|
|
|
|
|
"table": {
|
|
|
|
|
"label": "Table",
|
|
|
|
|
"key": "table",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Enter table name",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
|
|
|
|
},
|
|
|
|
|
"operator": {
|
|
|
|
|
"label": "Operator Inbetween Each condition",
|
|
|
|
|
"key": "operator",
|
|
|
|
|
"type": "dropdown",
|
|
|
|
|
"description": "Choose a operator to be used in between each condition",
|
|
|
|
|
"list": [
|
|
|
|
|
{
|
|
|
|
|
"name": "And",
|
|
|
|
|
"value": "and"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "Or",
|
|
|
|
|
"value": "or"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"offset": {
|
|
|
|
|
"label": "Offset",
|
|
|
|
|
"key": "offset",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Enter Offset",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
|
|
|
|
},
|
|
|
|
|
"limit": {
|
|
|
|
|
"label": "Limit",
|
|
|
|
|
"key": "limit",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"lineNumbers": false,
|
|
|
|
|
"description": "Enter Limit",
|
|
|
|
|
"height": "36px",
|
|
|
|
|
"className": "codehinter-plugins"
|
|
|
|
|
},
|
|
|
|
|
"attributes": {
|
|
|
|
|
"label": "Table Attributes",
|
|
|
|
|
"key": "attributes",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"mode": "javascript",
|
|
|
|
|
"description": "Enter Table Attributes to be queried",
|
|
|
|
|
"placeholder": "['name', 'age']",
|
|
|
|
|
"height": "70px"
|
|
|
|
|
},
|
|
|
|
|
"conditions": {
|
|
|
|
|
"label": "Conditions to filter",
|
|
|
|
|
"key": "conditions",
|
|
|
|
|
"type": "codehinter",
|
|
|
|
|
"mode": "javascript",
|
|
|
|
|
"description": "Enter Conditions to Filter",
|
|
|
|
|
"height": "150px",
|
|
|
|
|
"placeholder": "[{'search_attribute': 'age', 'search_type': 'between', 'search_value': [25, 29]}, {'search_attribute': 'weight_lbs', 'search_type': 'greater_than', 'search_value': 40}]"
|
2023-06-20 06:57:10 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-06-28 12:17:15 +00:00
|
|
|
},
|
|
|
|
|
"required": [
|
|
|
|
|
"schema",
|
|
|
|
|
"table",
|
|
|
|
|
"mode",
|
|
|
|
|
"records",
|
|
|
|
|
"hash_values",
|
|
|
|
|
"attributes",
|
|
|
|
|
"search_attribute",
|
|
|
|
|
"search_value",
|
|
|
|
|
"conditions"
|
|
|
|
|
]
|
2023-06-20 06:57:10 +00:00
|
|
|
}
|