Turn any CREATE TABLE into a complete dbt scaffold in one click. Paste a CREATE TABLE statement - from Snowflake, PostgreSQL, Redshift, BigQuery, or ANSI SQL - and get three artifacts: a schema.yml with inferred unique and not_null tests, a staging SQL model using the canonical with source, renamed pattern, and a sources.yml entry with freshness checks. No warehouse connection, no dbt codegen, no account required.
Writing schema.yml files by hand is tedious and error-prone. dbt codegen does this against a live warehouse connection, but sometimes you don't have one yet - you're reviewing a CREATE TABLE in a pull request, designing a new staging layer from a data-contract doc, or bootstrapping a dbt project offline. This tool solves the offline case. Feed it any CREATE TABLE and get a schema.yml starting point in seconds.
unique and not_null tests. PK enforces both invariants.id -> both unique and not_null by convention - treated as surrogate keys.not_null test. DDL explicitly requires a value.accepted_values, relationships, or dbt_utils.expression_is_true manually based on business logic.A dbt YAML doc with version: 2, a single models: entry, column list with descriptions and tests. Column descriptions are inferred from naming conventions (_id columns become foreign-key descriptions, _at columns become event timestamps, status/amount/email get intuitive descriptions). Always review and rewrite with business context - good column documentation is the single highest-ROI item in a dbt project.
A .sql file using the dbt style-guide pattern: with source as (...), renamed as (...) select * from renamed. The source CTE pulls from {{ source('...', '...') }}; the renamed CTE is where you add column casts, renames, or surrogate keys like {{ dbt_utils.generate_surrogate_key(['order_id']) }}.
A sources.yml entry with loaded_at_field and freshness thresholds (warn after 12 hours, error after 24 hours - tune to your SLA). Lets you run dbt source freshness to detect stale ingestion.
models/staging/<source>/stg_<table>.sqlmodels/staging/<source>/schema.yml (one file per source folder is the dbt style-guide convention)models/staging/<source>/sources.ymldbt build --select stg_<table>+ to compile, test, and materialize the model.Need a CREATE TABLE first? Use the JSON to SQL DDL Generator or the CSV to SQL Converter, then pipe the output here. Price your dbt Cloud usage with the dbt Cloud Cost Calculator. For dbt command syntax see the dbt Commands Reference.
← Back to Home