### Adapter Configuration Example Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/guides/adapter-creation-v2.md Document the profiles.yml configuration for your warehouse, detailing required and optional fields with example values. Follow the format of existing adapter setup guides. ```yaml type: \"exasol\" host: \"127.0.0.1\" port: \"8563\" user: \"sys\" password: \"exasol\" database: \"EXASOL\" # schema: \"my_schema\" ``` -------------------------------- ### dbt init Interactive Setup Example Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/reference/commands/init.md An example of the interactive prompts and output when running dbt init to set up a new profile. ```bash $ dbt init Running with dbt=1.0.0 Setting up your profile. user (yourname@jaffleshop.com): summerintern@jaffleshop.com schema (usually dbt_): dbt_summerintern threads (your favorite number, 1-10) [8]: 6 Profile internal-snowflake written to /Users/intern/.dbt/profiles.yml using project's profile_template.yml and your supplied values. Run 'dbt debug' to validate the connection. ``` -------------------------------- ### Install Rust, Go, and Clone dbt Core Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/contribute-core-adapters-v2.md Initial setup for development includes installing Rust and Go, then cloning the dbt-core repository. Verify installations and build capabilities. ```bash # Rust rustup # install from https://rustup.rs rustup show # verify # Go (needed for driver builds) go version # verify # Clone the repo git clone https://github.com/dbt-labs/dbt-core cd dbt-core # Verify you can build cargo build --bin dbt ``` -------------------------------- ### Install a dbt adapter from source Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/local/install-dbt.md Install a dbt adapter from its source repository after installing dbt-core. Example shown for Redshift. ```shell git clone https://github.com/dbt-labs/dbt-redshift.git cd dbt-redshift python -m pip install . ``` -------------------------------- ### Example: Add a local filesystem MCP server Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/dbt-ai/wizard-mcp.md This example demonstrates adding a local filesystem MCP server using npx. No environment variables are needed for this specific setup. ```bash wizard mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /Users/you/my-project ``` -------------------------------- ### Setup Python Virtual Environment Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/local/connect-data-platform/glue-setup.md Installs git, creates a virtual environment, activates it, and upgrades pip to manage project dependencies in isolation. ```bash sudo yum install git python3 -m venv dbt_venv source dbt_venv/bin/activate python3 -m pip install --upgrade pip ``` -------------------------------- ### Rust Development Machine Setup Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/guides/adapter-creation-v2.md Installs Rust, Go, clones the dbt-core repository, and verifies the build. Includes commands for resolving Z3 errors and cleaning build artifacts. ```shell # Rust rustup # install from https://rustup.rs rustup show # verify # Go (needed for driver builds) go version # verify # Clone the repo git clone https://github.com/dbt-labs/dbt-core cd dbt-core # Verify you can build cargo build --bin dbt ``` ```shell brew install pkg-config z3 ``` ```shell cargo clean # frees old build artifacts; you'll do this often ``` -------------------------------- ### Sample flyctl launch output Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/guides/serverless-pagerduty.md This is an example of the output you might see when running the `flyctl launch` command during the setup wizard. ```shell joel@Joel-Labes dbt-cloud-webhooks-pagerduty % flyctl launch
An existing fly.toml file was found for app dbt-cloud-webhooks-pagerduty
? Would you like to copy its configuration to the new app? Yes
Creating app in /Users/joel/Documents/GitHub/dbt-cloud-webhooks-pagerduty
Scanning source code
Detected a Dockerfile app
? Choose an app name (leave blank to generate one): demo-dbt-cloud-webhook-pagerduty
automatically selected personal organization: Joel Labes
Some regions require a paid plan (fra, maa).
See https://fly.io/plans to set up a plan.
? Choose a region for deployment: [Use arrows to move, type to filter]
? Choose a region for deployment: Sydney, Australia (syd)
Created app dbtlabs-dbt-cloud-webhook-pagerduty in organization personal
Admin URL: https://fly.io/apps/demo-dbt-cloud-webhook-pagerduty
Hostname: demo-dbt-cloud-webhook-pagerduty.fly.dev
? Would you like to set up a Postgresql database now? No
? Would you like to set up an Upstash Redis database now? No
Wrote config file fly.toml
? Would you like to deploy now? Yes ``` -------------------------------- ### Verify dbt Wizard Installation and Start Session Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/snippets/_wizard-cli-install-by-version.md Confirm the dbt Wizard installation by checking the version and start an interactive session. ```bash wizard --version # confirm the install ``` ```bash wizard # start an interactive session ``` -------------------------------- ### Example: Serve dbt docs with an empty host (v1.8.2+) Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/reference/commands/cmd-docs.md This example shows how to use the `--host ""` flag with `dbt docs serve` starting from version 1.8.2. Note that this flag is specific to dbt Core and not available in the dbt Cloud CLI. ```shell dbt docs serve --host "" ``` -------------------------------- ### Developer setup: Copying .env.example to .env Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/guides/fusion-platform-local-workflow.md Developers should copy the .env.example file to a local .env file and populate it with their specific environment variable values. ```shell # Developer setup: copy the example and fill in your values cp .env.example .env ``` -------------------------------- ### Install dbt-cloud-cli Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/blog/2022-05-03-making-dbt-cloud-api-calls-using-dbt-cloud-cli.md Install the dbt-cloud-cli package in your Python environment to start using its features. ```python python -m pip install dbt-cloud-cli ``` -------------------------------- ### Example Airflow Output Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/guides/airflow-and-dbt-cloud.md This is an example of the output you will see after successfully starting the Airflow development environment. ```text Airflow is starting up! This might take a few minutes… Project is running! All components are now available. Airflow Webserver: http://localhost:8080 Postgres Database: localhost:5432/postgres The default Airflow UI credentials are: admin:admin The default Postgres DB credentials are: postgres:postgres ``` -------------------------------- ### Webhook payload for a run that started Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/deploy/webhooks.md Example JSON payload for a webhook event when a dbt job run has started. ```json { "accountId": 1, "webhookId": "wsu_12345abcde", "eventId": "wev_2L6Z3l8uPedXKPq9D2nWbPIip7Z", "timestamp": "2023-01-31T19:28:15.742843678Z", "eventType": "job.run.started", "webhookName": "test", "data": { "jobId": "123", "jobName": "Daily Job (dbt build)", "runId": "12345", "environmentId": "1234", "environmentName": "Production", "dbtVersion": "1.0.0", "projectName": "Snowflake Github Demo", "projectId": "167194", "runStatus": "Running", "runStatusCode": 3, "runStatusMessage": "None", "runReason": "Kicked off from the UI by test@test.com", "runStartedAt": "2023-01-31T19:28:07Z" } } ``` -------------------------------- ### Example Project Structure with requirements.txt Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/guides/duckdb-qs.md Illustrates a typical dbt project layout including the requirements.txt file for dependency management. ```shell /my_dbt_project/ ├── dbt_project.yml ├── models/ │ ├── my_model.sql ├── tests/ │ ├── my_test.sql └── requirements.txt ``` -------------------------------- ### Use a Macro from an Installed Package Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/build/jinja-macros.md Call a macro from an installed package, such as `dbt-utils`, by prefixing it with the package name. This example uses the `dimensions` macro. ```sql select field_1, field_2, field_3, field_4, field_5, count(*) from my_table {{ dbt_utils.dimensions(5) }} ``` -------------------------------- ### Example dbt Commands for Scheduling Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/guides/duckdb-qs.md These are example dbt commands that can be included in a script for scheduling. Ensure dbt core is installed and configured to connect to your DuckDB instance. ```shell dbt run dbt test ``` -------------------------------- ### Install dbt Core without an Adapter Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/faqs/Core/install-pip-best-practices.md Install dbt Core without an adapter for tooling that does not require a warehouse connection. This keeps the setup lean and easier to maintain. ```bash python -m pip install ``` -------------------------------- ### Serve dbt Documentation Locally (v1.99 and earlier) Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/build/documentation.md Use this command to start a local website for viewing your dbt documentation. This command utilizes the generated manifest.json and catalog.json files. ```bash dbt docs serve ``` -------------------------------- ### Delegate Adapter Implementation (Exasol Example) Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/contribute-core-adapters-v2.md Shows how to delegate adapter implementations for common functionalities like column building and schema column names. This Exasol example delegates to a postgres-like builder. ```rust // Column builder — delegate to postgres-like builder Exasol => Ok(Self::build_postgres_like(field, type_ops)), ``` ```rust // Schema column name for listing relations Exasol => "name", ``` ```rust // DATA_TYPE column name in information schema AdapterType::Exasol => "DATA_TYPE", // in src/sql_types.rs ``` -------------------------------- ### Fusion Engine Version Output Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/guides/fusion-qs.md This is an example of the expected output when verifying the Fusion Engine installation. ```text dbt 2.0.0-preview.178 ``` -------------------------------- ### Configure and Enable OpenAI Provider Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/dbt-ai/wizard-byok.md Example commands to configure and then enable the OpenAI provider for use with the dbt Wizard CLI. ```bash wizard providers configure openai wizard providers enable openai ``` -------------------------------- ### Install Boto3 and dbt-glue Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/local/connect-data-platform/glue-setup.md Installs necessary system development headers and the boto3 library, followed by the dbt-glue adapter package. ```bash sudo yum install gcc krb5-devel.x86_64 python3-devel.x86_64 -y pip3 install —upgrade boto3 pip3 install dbt-glue ``` -------------------------------- ### Use Custom Strategy from a Package Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/build/incremental-strategy.md To use a custom incremental strategy from an installed package, define a macro in your project that calls the package's macro. This example uses `merge_null_safe` from the `example` package. ```sql {% macro get_incremental_merge_null_safe_sql(arg_dict) %} {% do return(example.get_incremental_merge_null_safe_sql(arg_dict)) %} {% endmacro %} ``` -------------------------------- ### Example dbt AI Skill File Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/dbt-ai/wizard-platform-skills.md A basic example of a dbt AI skill file, demonstrating the required YAML frontmatter and Markdown body structure. Use this as a starting point for creating your own skills. ```markdown --- name: my-team-style description: Apply Santi Corp's modeling conventions when editing or creating dbt models. Use when the user asks for refactors, new models, or YAML in this project. --- # My team style ## When to use Use this skill whenever you are changing SQL or YAML under `models/` and the user did not override these rules. ## Conventions - Staging models use prefix `stg_` and live in `models/staging/`. - Facts and dimensions use `fct_` and `dim_` prefixes respectively. - Document new columns in the same PR as the model change. ``` -------------------------------- ### Serve dbt Documentation Locally Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/blog/2023-05-04-generating-dynamic-docs.md These commands initiate the dbt documentation server, allowing you to preview your dbt project's documentation in a web browser. `dbt docs` generates the necessary documentation artifacts, and `dbt docs serve` starts the local web server. ```bash $ dbt docs && dbt docs serve ``` -------------------------------- ### Verify dbt MCP Setup from Command Line Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/snippets/_mcp-qs-local.md Run this command to confirm your dbt MCP installation and configuration are correct. If the command executes without errors, your setup is valid. Press Ctrl+C to stop the server. ```bash uvx dbt-mcp ``` -------------------------------- ### Implementing create_table_as Macro with Dispatch Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/guides/adapter-creation.md Demonstrates how dbt's adapter dispatch pattern works for the `create_table_as` macro. It shows the generic call, the default implementation, and adapter-specific overrides for Redshift and BigQuery. ```jinja2 {# dbt will call this macro by name, providing any arguments #} {% macro create_table_as(temporary, relation, sql) -%} {# dbt will dispatch the macro call to the relevant macro #} {{ return( adapter.dispatch('create_table_as')(temporary, relation, sql) ) }} {%- endmacro %} {# If no macro matches the specified adapter, "default" will be used #} {% macro default__create_table_as(temporary, relation, sql) -%} ... {%- endmacro %} {# Example which defines special logic for Redshift #} {% macro redshift__create_table_as(temporary, relation, sql) -%} ... {%- endmacro %} {# Example which defines special logic for BigQuery #} {% macro bigquery__create_table_as(temporary, relation, sql) -%} ... {%- endmacro %} ``` -------------------------------- ### Example dbt-athena Profile Configuration Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/local/connect-data-platform/athena-setup.md An example of a `profiles.yml` file demonstrating a concrete setup for connecting dbt to Amazon Athena. This includes specific values for S3 paths, region, database, schema, AWS profile, thread count, and number of retries. ```yaml default: outputs: dev: type: athena s3_staging_dir: s3://dbt_demo_bucket/athena-staging/ s3_data_dir: s3://dbt_demo_bucket/dbt-data/ s3_data_naming: schema_table region_name: us-east-1 database: warehouse schema: dev aws_profile_name: demo threads: 4 num_retries: 3 target: dev ``` -------------------------------- ### Install Dependencies on Windows (cmd.exe) Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/guides/duckdb-qs.md Sets up a virtual environment and installs dbt Core and DuckDB using pip for Windows command prompt users. ```shell python -m venv venv virtual\Scripts\activate.bat python -m pip install --upgrade pip python -m pip install -r requirements.txt virtual\Scripts\activate.bat ``` -------------------------------- ### Create a new skill folder and file Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/dbt-ai/wizard-skills.md Use these bash commands to set up the directory structure and the main skill file for a new wizard skill. ```bash mkdir -p .agents/skills/my-team-style touch .agents/skills/my-team-style/SKILL.md ``` -------------------------------- ### Serve dbt Project Documentation Locally Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/guides/duckdb-qs.md Run this command to create a local website for viewing your dbt project's documentation. It uses the generated JSON files. ```shell dbt docs serve ``` -------------------------------- ### SQL LIKE Operator Example Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/sql-reference/operators/sql-like.md This example demonstrates how to use the SQL LIKE operator to filter records where the 'first_name' field starts with an uppercase 'J'. It selects 'user_id' and 'first_name' from the 'customers' table. Note that LIKE is case-sensitive. ```sql select user_id, first_name from {{ ref('customers') }} where first_name like 'J%' order by 1 ``` -------------------------------- ### Example profiles.yml Configuration Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/fusion/connect-data-platform-fusion/profiles.yml.md This is an example of a profiles.yml file. It shows how to configure connection details for different data warehouses. Ensure sensitive information like passwords are not committed to version control. ```yaml config: # These settings are global and will be applied to all profiles # unless overridden in a specific profile. send_anonymous_usage_stats: true use_colors: true snowflake_project: target: dev outputs: dev: type: snowflake account: "{{ env_var('SNOWFLAKE_ACCOUNT') }}" user: "{{ env_var('SNOWFLAKE_USER') }}" password: "{{ env_var('SNOWFLAKE_PASSWORD') }}" role: "{{ env_var('SNOWFLAKE_ROLE') }}" database: "{{ env_var('SNOWFLAKE_DATABASE') }}" warehouse: "{{ env_var('SNOWFLAKE_WAREHOUSE') }}" schema: "{{ env_var('SNOWFLAKE_SCHEMA') }}" threads: 4 prod: type: snowflake account: "{{ env_var('SNOWFLAKE_ACCOUNT') }}" user: "{{ env_var('SNOWFLAKE_USER') }}" password: "{{ env_var('SNOWFLAKE_PASSWORD') }}" role: "{{ env_var('SNOWFLAKE_ROLE') }}" database: "{{ env_var('SNOWFLAKE_PROD_DATABASE') }}" warehouse: "{{ env_var('SNOWFLAKE_PROD_WAREHOUSE') }}" schema: "{{ env_var('SNOWFLAKE_PROD_SCHEMA') }}" threads: 8 ci: type: snowflake account: "{{ env_var('SNOWFLAKE_ACCOUNT') }}" user: "{{ env_var('SNOWFLAKE_USER') }}" password: "{{ env_var('SNOWFLAKE_PASSWORD') }}" role: "{{ env_var('SNOWFLAKE_ROLE') }}" database: "{{ env_var('SNOWFLAKE_CI_DATABASE') }}" warehouse: "{{ env_var('SNOWFLAKE_CI_WAREHOUSE') }}" schema: "{{ env_var('SNOWFLAKE_CI_SCHEMA') }}" threads: 1 bigquery_project: target: dev outputs: dev: type: bigquery method: service-account project: "{{ env_var('GOOGLE_PROJECT') }}" dataset: "{{ env_var('GOOGLE_DATASET') }}" keyfile: "{{ env_var('GOOGLE_KEYFILE') }}" threads: 4 prod: type: bigquery method: service-account project: "{{ env_var('GOOGLE_PROJECT') }}" dataset: "{{ env_var('GOOGLE_PROD_DATASET') }}" keyfile: "{{ env_var('GOOGLE_KEYFILE') }}" threads: 8 ci: type: bigquery method: service-account project: "{{ env_var('GOOGLE_PROJECT') }}" dataset: "{{ env_var('GOOGLE_CI_DATASET') }}" keyfile: "{{ env_var('GOOGLE_KEYFILE') }}" threads: 1 ``` -------------------------------- ### Example dbt Project Source Configuration Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/reference/source-configs.md Provides a comprehensive example of a `dbt_project.yml` file demonstrating source configuration for a project named 'jaffle_shop' and a package 'events'. It includes enabling/disabling specific sources and tables. This serves as a practical guide for setting up sources. ```yaml name: jaffle_shop config-version: 2 ... sources: # project names jaffle_shop: +enabled: true events: # source names clickstream: # table names pageviews: +enabled: false link_clicks: +enabled: true ``` -------------------------------- ### Wildcard Examples Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/reference/node-selection/methods.md Demonstrates the use of Unix-style wildcards for flexible node selection. ```bash dbt list --select "*.folder_name.*" dbt list --select "package:*_source" ``` -------------------------------- ### Example: Serve dbt docs on a specific port Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/reference/commands/cmd-docs.md This example demonstrates how to run the `dbt docs serve` command and specify a custom port (8001) for the documentation webserver. ```shell dbt docs serve --port 8001 ``` -------------------------------- ### Create dbt CLI Alias Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/platform/cloud-cli-installation.md Example of creating a shell alias to differentiate between dbt CLI and dbt Core commands. This is useful when both are installed and you need to specify which one to use. ```bash alias dbt-cli="/opt/homebrew/bin/dbt" ``` -------------------------------- ### Example function configuration in dbt_project.yml Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/reference/function-configs.md This example demonstrates configuring multiple functions and subdirectories within a project. Note how a subdirectory's schema configuration takes precedence over the project-level schema for functions within that subdirectory. ```yaml name: jaffle_shop ... functions: jaffle_shop: +enabled: true +schema: udf_schema # This configures functions/is_positive_int.sql is_positive_int: +tags: ['validation'] marketing: +schema: marketing_udfs # this will take precedence ``` -------------------------------- ### Sample flyctl launch output Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/guides/serverless-datadog.md This is an example of the output you might see when running the `flyctl launch` command, including app name selection, region choice, and deployment confirmation. ```text joel@Joel-Labes dbt-cloud-webhooks-datadog % flyctl launch
An existing fly.toml file was found for app dbt-cloud-webhooks-datadog
? Would you like to copy its configuration to the new app? Yes
Creating app in /Users/joel/Documents/GitHub/dbt-cloud-webhooks-datadog
Scanning source code
Detected a Dockerfile app
? Choose an app name (leave blank to generate one): demo-dbt-cloud-webhook-datadog
automatically selected personal organization: Joel Labes
Some regions require a paid plan (fra, maa).
See https://fly.io/plans to set up a plan.
? Choose a region for deployment: [Use arrows to move, type to filter]
? Choose a region for deployment: Sydney, Australia (syd)
Created app dbtlabs-dbt-cloud-webhook-datadog in organization personal
Admin URL: https://fly.io/apps/demo-dbt-cloud-webhook-datadog
Hostname: demo-dbt-cloud-webhook-datadog.fly.dev
? Would you like to set up a Postgresql database now? No
? Would you like to set up an Upstash Redis database now? No
Wrote config file fly.toml
? Would you like to deploy now? Yes ``` -------------------------------- ### Initialize dbt Project for Fusion Upgrade Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/upgrade-to-fusion-extension.md Use this command to start the manual upgrade process for your dbt project to enable Fusion compatibility. This command will guide you through a series of prompts. ```shell dbt init --fusion-upgrade ``` -------------------------------- ### Configure Insecure Connection in dbt profiles.yml Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/local/connect-data-platform/hive-setup.md Example configuration for a local Hive installation using insecure authentication. This is intended for testing purposes only. ```yaml your_profile_name: target: dev outputs: dev: type: hive host: localhost port: PORT # default value: 10000 schema: SCHEMA_NAME ``` -------------------------------- ### Format LLM Prompt Example with Training Data Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/blog/2024-05-02-semantic-layer-llm.md An example of how to structure training data for an LLM, including metrics, dimensions, a user question, and the desired SQL output. This helps the LLM understand query patterns. ```python { "metrics": "revenue, costs, profit", "dimensions": "department, salesperson, cost_center, metric_time, product__product_category", "question": "Give me YTD revenue by department?", "result": Query.model_validate( { "metrics": [{"name": "revenue"}], "groupBy": [{"name": "department"}], "where": [ { "sql": "{{ TimeDimension('metric_time', 'DAY') }} >= date_trunc('year', current_date)" } ], } ) .model_dump_json() .replace("{{", "{{") .replace("}}", "}}") } ``` -------------------------------- ### Run dbt MCP Server Locally Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/dbt-ai/mcp-quickstart-cli.md This snippet shows the command to start the dbt MCP server in a local environment. Ensure you have dbt installed and configured correctly before running this command. ```bash dbt mcp run ``` -------------------------------- ### SQLFluff Configuration Example Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/best-practices/how-we-style/2-how-we-style-our-sql.md This is an example of how to configure SQLFluff to enforce styling rules. Customize the .sqlfluff configuration file to your needs. ```yaml linelength: 80 max_line_length: 80 ``` -------------------------------- ### Configure 'begin' in dbt_project.yml Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/reference/resource-configs/begin.md This example demonstrates how to set the 'begin' configuration for a specific model within the dbt_project.yml file. It defines the starting timestamp for microbatch incremental model processing. ```yaml models: my_project: user_sessions: +begin: "2024-01-01 00:00:00" ``` -------------------------------- ### Install dbt Wizard CLI Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/dbt-ai/wizard-cli.md Install the dbt Wizard CLI using the provided command. This is the primary command for setting up the CLI. ```bash wizard install ``` -------------------------------- ### Get Current Timestamp Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/reference/dbt-jinja-functions/cross-database-macros.md Use this macro to retrieve the current date and time for the system. The result may be an aware or naive timestamp, and may correspond to the start of the statement or transaction depending on the adapter. It requires no arguments. ```sql {{ dbt.current_timestamp() }} ``` -------------------------------- ### Example config.toml for dbt-wizard Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/dbt-ai/wizard-config.md A sample configuration file demonstrating how to set the default AI model, project trust level, and MCP server command. Changes require a restart. ```toml model = "claude-sonnet-4-6" [projects."/Users/you/jaffle-shop"] trust_level = "trusted" [mcp_servers.dbt] command = "DBT_MCP_ENDPOINT" ``` -------------------------------- ### Environment Endpoint Pagination Example Source: https://github.com/dbt-labs/docs.getdbt.com/blob/current/website/docs/docs/dbt-apis/discovery-querying.md This example demonstrates how to query for the first 500 models after a specific cursor using the `PageInfo` object to manage pagination. ```APIDOC ## Querying with PageInfo ### Description This example shows how to retrieve a page of data using cursor-based pagination for environment endpoints. It utilizes the `PageInfo` object to manage the cursor and check for the next page. ### Method POST ### Endpoint /graphql ### Query ```graphql query EnvironmentModelsPage($first: Int!, $after: String) { environments { edges { node { id name } cursor } pageInfo { startCursor endCursor hasNextPage } } } ``` ### Variables #### First Page ```json { "first": 500, "after": null } ``` #### Subsequent Pages ```json { "first": 500, "after": "" } ``` ### Response Example (Success) ```json { "data": { "environments": { "edges": [ { "node": { "id": "some-environment-id", "name": "production" }, "cursor": "some-cursor-string" } ], "pageInfo": { "startCursor": "start-cursor-string", "endCursor": "end-cursor-string", "hasNextPage": true } } } } ``` ```