gen-table

Generate and execute DDL to create database tables from SQL queries or natural language.

1.5k|222|Updated Jul 4, 2025
One-click install
npx skills add https://github.com/Datus-ai/Datus-agent --skill gen-table
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gen-table
Source: https://github.com/Datus-ai/Datus-agent/tree/main/datus/resources/skills/gen-table
Command: npx skills add https://github.com/Datus-ai/Datus-agent --skill gen-table

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manually writing database DDL statements to create tables is time-consuming and error-prone, especially when materializing query results or translating natural language requirements into schema definitions. This Skill eliminates that manual work by automatically generating and executing valid table creation statements from either SQL queries or plain language descriptions.

Core Features & Use Cases

  • CTAS from SQL: Directly materialize JOIN, aggregate, or other SELECT queries as persistent tables without manual schema definition.
  • Natural Language to DDL: Convert plain language table requirements into valid CREATE TABLE statements without writing DDL manually.
  • Safety & Workflow Support: Interactive DDL confirmation for ad-hoc use, strict guardrails for batch/workflow mode to prevent unintended destructive operations, and automatic error recovery for failed creation attempts.
  • Use Case: A data analyst with a complex query joining multiple source tables to calculate customer lifetime value can use this Skill to instantly materialize the result as a reusable wide table, no manual DDL writing required.

Quick Start

Use the gen-table skill to create a persistent table named customer_lifetime_value from your SQL query that calculates total spend per customer.

Frequently Asked Questions about gen-table

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically generate DDL from SQL queries to materialize tables?

You can generate DDL from SQL queries by using CTAS to directly materialize JOIN, aggregate, or SELECT statements as persistent database tables without manual schema definition.

Can I convert natural language descriptions into database table creation statements?

Yes, natural language to DDL conversion translates plain language table requirements directly into valid CREATE TABLE statements without writing DDL manually.

What is the best way to create wide tables from complex SQL queries for data engineering?

Creating wide tables from complex SQL queries is best handled by materializing query results as persistent tables, instantly generating reusable structures like customer lifetime value calculations.

Does this table creation approach include safety guardrails for batch workflow execution?

Yes, strict guardrails prevent unintended destructive operations during batch workflow execution, while interactive DDL confirmation is provided for ad-hoc usage to ensure table creation safety.

How does error recovery work when database table creation fails during execution?

Automatic error recovery handles failed table creation operations by validating DDL and attempting to resolve execution errors automatically without manual intervention.

Do I need to manually define schemas when prototyping database tables from business requirements?

No, prototyping schemas from business requirements bypasses manual schema definition by automatically generating and executing valid table creation statements from natural language descriptions.