create_table
Define table names, columns, and their types to create new tables in CockroachDB. Streamline database setup and schema evolution using natural language inputs directly via the MCP server.
Instructions
Enable the creation of new tables in the current database. You can instruct the AI to define table names, columns, and their types, streamlining database setup and schema evolution directly through natural language.
Args: table_name (str): Name of the table. columns (List[Dict[str, str]]): List of dicts with keys: - 'name' (str): column name (required) - 'datatype' (str): column datatype (required) - 'constraint' (str): column constraint (optional)
Returns: A success message or an error message.
Example: columns = [ {"name": "id", "datatype": "SERIAL", "constraint": "PRIMARY KEY"}, {"name": "username", "datatype": "TEXT", "constraint": "NOT NULL"}, {"name": "created_at", "datatype": "TIMESTAMP"} ]
Input Schema
Name | Required | Description | Default |
---|---|---|---|
columns | Yes | ||
table_name | Yes |