Generating Base Models

Analytics engineers need to create base models with readable column names, consistent naming conventions, and appropriate transformations. This repetitive process can be tedious, especially with tables containing many columns.

DinoAI Agent can automatically generate well-structured base models that transform raw source data into more user-friendly formats.

Example Prompt

I want you to create a set of base dbt models. These base models should rename columns that are confusing.

Optional: You can add context by selecting your sources.yml file or existing base models. Context allows DinoAI to understand your naming conventions and maintain consistency with your existing files.

How It Works

After you enter your prompt:

  1. DinoAI analyzes your sources.yml file and any provided context

  2. It creates appropriate folder structure for base models

  3. For each source table, it generates a model with readable column names

  4. If configured, DinoAI will apply your .dinorules preferences

Note: If you've already established naming patterns in your project, adding context helps DinoAI maintain those patterns in new models

Example Output

DinoAI will generate base models like this:

WITH source AS (
    SELECT * FROM {{ source('formula_one', 'CIRCUITS') }}
)

SELECT
    circuitid AS circuit_id,
    circuitref AS circuit_reference,
    name AS circuit_name,
    location AS location,
    country AS country,
    lat AS latitude,
    lng AS longitude,
    alt AS altitude,
    url AS circuit_url
FROM source

Key Benefits

  • Consistency: Ensures all base models follow the same patterns and conventions

  • Readability: Makes column names more user-friendly and easier to understand

  • Efficiency: Creates dozens of models in seconds rather than hours

  • Standards: Applies your team's SQL formatting and naming conventions automatically

When to Use This

  • When setting up initial base models for a new project

  • After adding new source tables to your project

  • When standardizing naming conventions across your project

  • When needing to improve the readability of your raw data

Last updated

Was this helpful?