create_table
Define and create new tables in CockroachDB by specifying table names, columns, and data types using natural language, simplifying database setup and schema management.
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 |