run_sql_plus_plus_query
Execute SQL++ queries on a Couchbase scope and return JSON results. Use named parameters to bind values securely and avoid injection.
Instructions
Run a SQL++ query on a scope and return the results as a list of JSON objects.
The query will be run on the specified scope in the specified bucket. The query should use collection names directly without bucket/scope prefixes, as the scope context is automatically set.
Use named_parameters to bind values to $name placeholders in the
query instead of concatenating user input into the statement. This prevents
SQL++ injection
Example: query = "SELECT * FROM users WHERE age > 18" # Incorrect: "SELECT * FROM bucket.scope.users WHERE age > 18"
For creating a new index, prefer the create_index tool over a raw CREATE INDEX statement here — it defers the build by default and tells you the recommended next step. Use list_indexes to check whether an index is online before relying on it in a query plan.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| scope_name | Yes | ||
| bucket_name | Yes | ||
| named_parameters | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |