Create new database tables using the Akron CLI with customizable schemas across SQLite, MySQL, PostgreSQL, and MongoDB.
The create-table
command allows you to create new database tables with custom schemas directly from the command line. It supports all Akron-compatible databases and provides a unified interface for table creation across different database systems.
akron create-table <table_name> --db <database_url> --schema <schema_json>
Type: str (required)
Name of the table to create. Must be a valid identifier for the target database.
Type: str (required)
Database connection URL. Supports sqlite://, mysql://, postgres://, and mongodb:// schemes.
Type: JSON string (required)
Table schema definition as JSON. Keys are column names, values are data types.
✓ Table 'users' created successfully in SQLite database ✓ Columns: id (int), name (str), email (str)
✓ Table 'products' created successfully in MySQL database ✓ Columns: id (int), name (varchar), price (float), in_stock (boolean)
✓ Table 'orders' created successfully in PostgreSQL database ✓ Columns: id (integer), customer_id (integer), total (decimal), created_at (timestamp)
✓ Collection 'users' created successfully in MongoDB database ✓ Schema validation enabled for: _id (objectid), username (str), profile (object), tags (array)
"int"
- Integer numbers"str"
- String/text data"bool"
- Boolean true/false"float"
- Floating point numbers"datetime"
- Date and time"date"
- Date only"time"
- Time only"text"
- Large text fields"decimal"
- Precise decimal numbers"json"
- JSON data (where supported)"blob"
- Binary data"array"
- Array data (MongoDB)"object"
- Nested objects (MongoDB)"objectid"
- MongoDB ObjectId