select
Retrieve data from SurrealDB tables by fetching all records or selecting specific records using their ID for display and processing.
Instructions
Select all records from a table or a specific record by ID.
This tool provides a simple way to retrieve data from SurrealDB tables. Use this when you need to:
Fetch all records from a table
Retrieve a specific record by its ID
Get data for display or further processing
Args: table: The name of the table to select from (e.g., "user", "product", "order") id: Optional ID of a specific record to select. Can be: - Just the ID part (e.g., "john") - will be combined with table name - Full record ID (e.g., "user:john") - will be used as-is - None/omitted - selects all records from the table
Returns: A dictionary containing: - success: Boolean indicating if the selection was successful - data: Array of records (even for single record selection) - count: Number of records returned - error: Error message if selection failed (only present on failure)
Examples: >>> await select("user") # Get all users {"success": true, "data": [...], "count": 42}
Input Schema
Name | Required | Description | Default |
---|---|---|---|
id | No | ||
table | Yes |