ToolJet/marketplace/plugins/spanner/lib/operations.json
Priyansh Rai 12f0713e7d
Feat: Add google cloud spanner marketplace plugin (#13818)
* feat(spanner): add Google Cloud Spanner plugin with initial implementation

- Developed core functionality in lib/index.ts, including methods for running queries and testing connections.
- Defined manifest.json for plugin configuration and required properties.
- Created operations.json to specify query options and parameters.
- Introduced types.ts for source and query options definitions.
- Updated plugins.json to include the new Google Cloud Spanner plugin.

* chore(server): add @google-cloud/spanner dependency for Spanner plugin

* fix(DynamicForm): unify buttonText and editorType props for marketplace plugins

* fix(spanner): standardize error handling in index.ts

* refactor(spanner): simplify source options by removing client_email and project_id

* fix(spanner): standardize label casing in manifest and operations JSON files

* refactor(spanner): update parameters label

* refactor(spanner): update buttonText prop for query params

* refactor(spanner): change dialect type from dropdown-component-flip to dropdown to move it upwards in the frontend

* feat(DynamicForm): add HintText component to display hints for form fields

* refactor(spanner): rename hint to helpText for consistency in DynamicForm and manifest/operations JSON files

* Revert "feat(DynamicForm): add HintText component to display hints for form fields"

This reverts commit 79b48284f1.

* fix(Spanner): improve error handling for private key JSON parsing

* refactor(Spanner): rename getPrivateKey to parsePrivateKey for clarity

* fix(Spanner): enhance error handling with QueryError for better clarity and consistency

* refactor(Spanner): standardize label casing for consistency in manifest and operations JSON files

* feat(Spanner): add query mode support for executing queries and update operations schema
2025-08-14 17:18:52 +05:30

88 lines
No EOL
2.8 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/ToolJet/ToolJet/develop/plugins/schemas/operations.schema.json",
"title": "Google Cloud Spanner datasource",
"description": "A schema defining Google Cloud Spanner datasource",
"type": "database",
"defaults": {
"dialect": "standard",
"query_mode": "read"
},
"properties": {
"dialect": {
"key": "dialect",
"label": "SQL dialect",
"type": "dropdown",
"description": "Select the SQL dialect to use",
"list": [
{
"name": "Google Standard SQL",
"value": "standard"
},
{
"name": "PostgreSQL",
"value": "postgresql"
}
]
},
"query_mode": {
"key": "query_mode",
"label": "Query mode",
"type": "dropdown",
"description": "Choose how the query should be executed",
"list": [
{
"name": "Read-only (SELECT)",
"value": "read"
},
{
"name": "Write (INSERT, UPDATE, DELETE)",
"value": "write"
},
{
"name": "Schema changes (CREATE, ALTER, DROP)",
"value": "schema"
}
]
},
"database_id": {
"key": "database_id",
"label": "Database ID",
"type": "codehinter",
"description": "Enter the Google Cloud Spanner database ID",
"placeholder": "my-database"
},
"sql": {
"key": "sql",
"label": "SQL query",
"type": "codehinter",
"description": "Enter SQL query",
"height": "150px",
"editorType": "multiline",
"placeholder": "SELECT AlbumTitle FROM Albums WHERE ArtistId = @artistId",
"helpText": "As per database configuration, use @paramName for GoogleSQL or $1, $2, etc. for PostgreSQL."
},
"query_params": {
"key": "query_params",
"label": "SQL Parameters",
"type": "react-component-headers",
"description": "Parameters for the SQL query",
"buttonText": "Add an SQL parameter",
"tooltip": "Use these parameters in the query using < @parameterName > notation for GoogleSQL and < $1, $2, $3 > notation for PostgreSQL"
},
"param_types": {
"key": "param_types",
"label": "Types",
"type": "react-component-headers",
"description": "Define types for the SQL parameters",
"buttonText": "Add a type",
"tooltip": "Define the Spanner data type for each parameter, which is crucial for certain types like BYTES, NUMERIC, JSON, ARRAY types, or when the JavaScript type inference might be ambiguous (e.g., Number could be INT64 or FLOAT64)."
},
"options": {
"key": "options",
"label": "Options",
"type": "codehinter",
"description": "Additional options for the query execution",
"placeholder": "{ \"requestOptions\": { \"requestTag\": \"my-query\" }, \"json\": true }"
}
}
}