create_table
Define and create database tables by specifying names, columns, and data types directly through natural language commands, streamlining schema setup and updates in CockroachDB.
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 |