{"id":18571,"date":"2026-09-10T01:46:35","date_gmt":"2026-09-10T01:46:35","guid":{"rendered":"https:\/\/techtrendfeed.com\/?p=18571"},"modified":"2026-09-10T01:46:36","modified_gmt":"2026-09-10T01:46:36","slug":"getting-began-with-dbt-in-the-direction-of-knowledge-science","status":"publish","type":"post","link":"https:\/\/techtrendfeed.com\/?p=18571","title":{"rendered":"Getting began with\u00a0dbt | In the direction of Knowledge Science"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p class=\"mt-6 text-xl leading-8\">As a contract knowledge engineer<!-- -->, I typically expertise \u2014 ahem \u2014 let&#8217;s simply say, durations of inactivity. Once I browse the web marketplace for appropriate roles throughout these instances, some of the in-demand expertise I preserve seeing is expertise with a instrument known as <strong class=\"font-bold\">dbt<\/strong>.\u00a0<\/p>\n<p class=\"mt-6 text-xl leading-8\">So, to present myself the very best probability of acquiring work, I made a decision to be taught as a lot about dbt as I assumed I wanted to, to at the least be assured sufficient to speak about it on the whole phrases to a fellow techie at an interview stage ought to the necessity come up. This text distils that course of and what I\u2019ve learnt. In fact you may&#8217;t be taught a topic simply by studying about it, in order traditional, I am going to present loads of sensible code and real-world examples.<\/p>\n<blockquote class=\"mt-6 border-l-4 border-brand pl-6 italic text-brand-muted  [&amp;&gt;p]:mt-3 [&amp;&gt;p]:first:mt-0\">\n<p class=\"mt-6 text-xl leading-8\"><em class=\"italic\"><strong class=\"font-bold\">To be clear, I&#8217;ve no affiliation or business affiliation with dbt, DuckDB, or their creators. <\/strong><\/em><\/p>\n<p class=\"mt-6 text-xl leading-8\"><em class=\"italic\"><strong class=\"font-bold\">dbt Core is a free <\/strong><\/em><strong class=\"font-bold\">open-source software program launched underneath the Apache 2.0 licence, and you may run it regionally and not using a dbt account. DuckDB can also be free to make use of underneath the permissive MIT licence.<\/strong><\/p>\n<\/blockquote>\n<p class=\"mt-6 text-xl leading-8\">dbt supplies a broad vary of capabilities, however as that is an introduction to the subject, I\u2019m concentrating on explaining the fundamentals. This contains utilizing dbt fashions and sources, and utilizing it to check knowledge and create documentation. Extra about all of those later.<\/p>\n<p class=\"mt-6 text-xl leading-8\">For those who\u2019ve labored on any moderately sized analytics or knowledge engineering undertaking, you\u2019ve most likely ended up with a folder stuffed with SQL scripts.<\/p>\n<p class=\"mt-6 text-xl leading-8\">When your undertaking first begins up, every part feels manageable. You run the scripts manually or schedule them in no matter orchestration instrument your organization makes use of. Every thing is nice.<\/p>\n<p class=\"mt-6 text-xl leading-8\">Then the undertaking grows.<\/p>\n<p class=\"mt-6 text-xl leading-8\">A column will get renamed in a single desk, and all of a sudden some downstream report or dashboard stops working or, worse nonetheless, your nightly 10 million report knowledge ingestion job fails, and your entire system grinds to a halt. The checklist of points {that a} wrongly utilized little bit of SQL or a desk change can do to a database system is horrifying. And you recognize what, it <em class=\"italic\"><strong class=\"font-bold\">occurs on a regular basis.<\/strong><\/em><\/p>\n<p class=\"mt-6 text-xl leading-8\">A part of the issue is that, historically, SQL has been handled as a set of remoted scripts relatively than as a software program undertaking.<\/p>\n<p class=\"mt-6 text-xl leading-8\">If this sounds all too acquainted, the parents behind dbt suppose they&#8217;ve an answer.<\/p>\n<nav class=\"mt-6\">\n<p class=\"mb-4 font-bold text-3xl leading-9\">Desk of contents<\/p>\n<ol class=\"m-0 list-disc space-y-2 pl-5 marker:text-gray-400 marker:font-medium\">\n<li class=\"m-0 p-0 pl-1\"><a rel=\"nofollow\" target=\"_blank\" href=\"#what-is-dbt\" class=\"transition-colors hover:text-brand hover:underline text-xl leading-relaxed\">What&#8217;s\u00a0dbt?<\/a><\/li>\n<li class=\"m-0 p-0 pl-1\"><a rel=\"nofollow\" target=\"_blank\" href=\"#why-do-data-teams-use-dbt\" class=\"transition-colors hover:text-brand hover:underline text-xl leading-relaxed\">Why do knowledge groups use\u00a0dbt?<\/a><\/li>\n<li class=\"m-0 p-0 pl-1\"><a rel=\"nofollow\" target=\"_blank\" href=\"#prerequisites\" class=\"transition-colors hover:text-brand hover:underline text-xl leading-relaxed\">Stipulations<\/a><\/li>\n<li class=\"m-0 p-0 pl-1\"><a rel=\"nofollow\" target=\"_blank\" href=\"#installing-dbt\" class=\"transition-colors hover:text-brand hover:underline text-xl leading-relaxed\">Putting in dbt<\/a><\/li>\n<li class=\"m-0 p-0 pl-1\"><a rel=\"nofollow\" target=\"_blank\" href=\"#setting-up-a-dbt-project\" class=\"transition-colors hover:text-brand hover:underline text-xl leading-relaxed\">Establishing a dbt\u00a0undertaking<\/a><\/li>\n<li class=\"m-0 p-0 pl-1\"><a rel=\"nofollow\" target=\"_blank\" href=\"#creating-our-duckdb-database\" class=\"transition-colors hover:text-brand hover:underline text-xl leading-relaxed\">Creating our DuckDB\u00a0database<\/a><\/li>\n<li class=\"m-0 p-0 pl-1\"><a rel=\"nofollow\" target=\"_blank\" href=\"#creating-and-running-a-dbt-model-with-a-source\" class=\"transition-colors hover:text-brand hover:underline text-xl leading-relaxed\">Creating and working a dbt mannequin with a\u00a0supply<\/a><\/li>\n<li class=\"m-0 p-0 pl-1\"><a rel=\"nofollow\" target=\"_blank\" href=\"#using-dbt-for-testing-your-data\" class=\"transition-colors hover:text-brand hover:underline text-xl leading-relaxed\">Utilizing dbt for\u00a0testing your knowledge<\/a>\n<ol class=\"mt-1 list-disc space-y-1 pl-5 marker:text-gray-300 marker:font-normal\">\n<li class=\"m-0 p-0 pl-1\"><a rel=\"nofollow\" target=\"_blank\" href=\"#not-null-test\" class=\"text-brand-muted transition-colors hover:text-brand hover:underline text-xl leading-relaxed\">Not null\u00a0check<\/a><\/li>\n<li class=\"m-0 p-0 pl-1\"><a rel=\"nofollow\" target=\"_blank\" href=\"#accepted-values-test\" class=\"text-brand-muted transition-colors hover:text-brand hover:underline text-xl leading-relaxed\">Accepted values\u00a0check<\/a><\/li>\n<\/ol>\n<\/li>\n<li class=\"m-0 p-0 pl-1\"><a rel=\"nofollow\" target=\"_blank\" href=\"#using-dbt-to-document-your-system\" class=\"transition-colors hover:text-brand hover:underline text-xl leading-relaxed\">Utilizing dbt to doc your\u00a0system<\/a><\/li>\n<li class=\"m-0 p-0 pl-1\"><a rel=\"nofollow\" target=\"_blank\" href=\"#next-stages\" class=\"transition-colors hover:text-brand hover:underline text-xl leading-relaxed\">Subsequent levels<\/a><\/li>\n<\/ol>\n<\/nav>\n<h2 id=\"what-is-dbt\" class=\"mt-12 text-3xl leading-9 font-bold\">What&#8217;s\u00a0dbt?<\/h2>\n<p class=\"mt-6 text-xl leading-8\"><strong class=\"font-bold\">dbt (knowledge construct instrument)<\/strong> was created within the mid 2010s by a gaggle now referred to as dbt Labs<strong class=\"font-bold\">. <\/strong>It grew from an inner analytics workflow right into a broadly used open-source, free (on the developer plan) CLI instrument known as <strong class=\"font-bold\">dbt Core<\/strong>, alongside a totally managed, paid model known as <strong class=\"font-bold\">dbt Platform<\/strong>. I\u2019ll be utilizing the free model.<\/p>\n<p class=\"mt-6 text-xl leading-8\">dbt is used to<strong class=\"font-bold\"> remodel<\/strong> knowledge <strong class=\"font-bold\">already saved<\/strong> in a database, warehouse or lakehouse. It does this by creating tables or views primarily based on user-supplied SQL, but it surely additionally handles the next:<\/p>\n<ul class=\"mt-6 list-disc pl-10 text-xl leading-8\">\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\">Testing knowledge high quality<\/p>\n<\/li>\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\">Documenting datasets and lineage<\/p>\n<\/li>\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\">Reusing SQL by macros<\/p>\n<\/li>\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\">Managing growth, testing and manufacturing environments<\/p>\n<\/li>\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\">Working transformations by scheduled jobs or CI\/CD pipelines<\/p>\n<\/li>\n<\/ul>\n<p class=\"mt-6 text-xl leading-8\">dbt is broadly utilized by groups working enterprise-grade knowledge storage platforms akin to Snowflake, BigQuery, Redshift and Databricks. However for my examples, I\u2019m going to be utilizing an area DuckDB database.<\/p>\n<h2 id=\"why-do-data-teams-use-dbt\" class=\"mt-12 text-3xl leading-9 font-bold\">Why do knowledge groups use\u00a0dbt?<\/h2>\n<p class=\"mt-6 text-xl leading-8\">Primarily as a result of it\u2019s good at what it does.\u00a0<\/p>\n<p class=\"mt-6 text-xl leading-8\">Think about you\u2019re constructing a gross sales reporting platform. Uncooked order knowledge lands in your knowledge warehouse each hour, say. You write one SQL script to wash the info, one other to calculate buyer totals, one other to construct every day gross sales figures, and one other to generate govt dashboards.<\/p>\n<p class=\"mt-6 text-xl leading-8\">At first, the undertaking has 4 or 5 SQL recordsdata, and it\u2019s straightforward to maintain monitor of them. Six months later, there are fifty, and the order by which they run is now not apparent.<\/p>\n<ul class=\"mt-6 list-disc pl-10 text-xl leading-8\">\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\">Which script runs by which order?\u00a0<\/p>\n<\/li>\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\">What breaks if somebody renames a column?\u00a0<\/p>\n<\/li>\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\">How do you verify that the info continues to be legitimate?\u00a0<\/p>\n<\/li>\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\">May a brand new developer perceive the undertaking with out opening each SQL file?<\/p>\n<\/li>\n<\/ul>\n<p class=\"mt-6 text-xl leading-8\">Usually, analytics groups solved these issues with naming conventions, handwritten notes handed round and plenty of shared methods information.<\/p>\n<p class=\"mt-6 text-xl leading-8\">As organisations turned extra data-driven, analytics tasks began wanting increasingly like software program tasks. Groups wanted model management, automated testing, documentation and dependency administration as a result of they have been writing hundreds of traces of SQL.<\/p>\n<p class=\"mt-6 text-xl leading-8\">Relatively than treating SQL scripts as unbiased recordsdata, dbt treats them as elements of a single undertaking, the place each transformation has an outlined function, and each dependency is known.<\/p>\n<h2 id=\"prerequisites\" class=\"mt-12 text-3xl leading-9 font-bold\"><strong class=\"font-bold\">Stipulations<\/strong><\/h2>\n<p class=\"mt-6 text-xl leading-8\">I\u2019m utilizing Home windows as my working system and have Python 3.13 put in. Every thing ought to work in the identical manner in the event you&#8217;re on Linux or macOS however you positively must have Python put in. You\u2019ll additionally want entry to an appropriate database for dbt to behave on. Every database could have variations in the way you set it up to make use of dbt. I will be utilizing DuckDB as my database and can present you the arrange for that. Seek the advice of the dbt docs (linked on the finish) in the event you&#8217;re utilizing a distinct knowledge retailer.<\/p>\n<h2 id=\"installing-dbt\" class=\"mt-12 text-3xl leading-9 font-bold\"><strong class=\"font-bold\">Putting in dbt<\/strong><\/h2>\n<p class=\"mt-6 text-xl leading-8\">Now that we have now a greater understanding of dbt, in the remainder of this text I\u2019ll present you the right way to set up it and, by means of instance code, reveal the commonest dbt instructions you\u2019ll use in your day-to-day job.<\/p>\n<p class=\"mt-6 text-xl leading-8\">The very first thing we must always do is about up a separate Python growth atmosphere to maintain our tasks siloed.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">PS C:Usersthoma&gt; cd tasks<\/span><span class=\"line\">PS C:Usersthomaprojects&gt; mkdir dbt-demo<\/span><span class=\"line\"\/><span class=\"line\">    Listing: C:Usersthomaprojects<\/span><span class=\"line\"\/><span class=\"line\">Mode                 LastWriteTime         Size Title<\/span><span class=\"line\">----                 -------------         ------ ----<\/span><span class=\"line\">d-----        03\/08\/2026     16:21                dbt-demo<\/span><span class=\"line\"\/><span class=\"line\">PS C:Usersthomaprojects&gt; cd dbt-demo<\/span><span class=\"line\">PS C:Usersthomaprojectsdbt-demo&gt; python3 -m venv .venv<\/span><span class=\"line\">Precise atmosphere location could have moved attributable to redirects, hyperlinks or junctions.<\/span><span class=\"line\">  Requested location: \"C:Usersthomaprojectsdbt-demo.venvScriptspython3.exe\"<\/span><span class=\"line\">  Precise location:    \"D:Usersthomaprojectsdbt-demo.venvScriptspython3.exe\"<\/span><span class=\"line\">PS C:Usersthomaprojectsdbt-demo&gt; ..venvScriptsActivate.ps1<\/span><span class=\"line\">(.venv) PS C:Usersthomaprojectsdbt-demo&gt;<\/span><span class=\"line\">(.venv) PS C:Usersthomaprojectsdbt-demo&gt;<\/span><span class=\"line\">(.venv) PS C:Usersthomaprojectsdbt-demo&gt;<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">You may set up dbt utilizing a easy pip command just like the one proven under. To attach dbt to a knowledge supply, we use one thing known as an adapter. dbt has many several types of adapters, for instance, BigQuery, AWS Redshift, Snowflake, and so forth. For this demo, I\u2019m going to be utilizing an area DuckDB database.\u00a0<\/p>\n<p class=\"mt-6 text-xl leading-8\">Most adapters must be put in individually from the dbt-core product, however for DuckDB, dbt supplies a one-file set up.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">(.venv) PS C:Usersthomaprojectsdbt-demo&gt; python3 -m pip set up dbt-duckdb<\/span><span class=\"line\"\/><span class=\"line\">Gathering dbt-duckdb<\/span><span class=\"line\">  Downloading dbt_duckdb-1.10.1-py3-none-any.whl.metadata (38 kB)<\/span><span class=\"line\">Gathering dbt-common&lt;2,&gt;=1 (from dbt-duckdb)<\/span><span class=\"line\">  Utilizing cached dbt_common-1.38.0-py3-none-any.whl.metadata (5.0 kB)<\/span><span class=\"line\">Gathering dbt-adapters&lt;2,&gt;=1 (from dbt-duckdb)<\/span><span class=\"line\">  Utilizing cached dbt_adapters-1.24.5-py3-none-any.whl.metadata (4.6 kB)<\/span><span class=\"line\">Gathering duckdb&gt;=1.0.0 (from dbt-duckdb)<\/span><span class=\"line\">  Downloading duckdb-1.5.5-cp313-cp313-win_amd64.whl.metadata (4.2 kB)<\/span><span class=\"line\">Gathering dbt-core&gt;=1.8.0 (from dbt-duckdb)<\/span><span class=\"line\">  Utilizing cached dbt_core-1.12.0-py3-none-any.whl.metadata (4.5 kB)<\/span><span class=\"line\">Gathering agate&lt;2.0,&gt;=1.0 (from dbt-adapters&lt;2,&gt;=1-&gt;dbt-duckdb)<\/span><span class=\"line\">  Utilizing cached agate-1.14.2-py3-none-any.whl.metadata (3.1 kB)<\/span><span class=\"line\">Gathering dbt-protos&lt;2.0,&gt;=1.0.291 (from dbt-adapters&lt;2,&gt;=1-&gt;dbt-duckdb)<\/span><span class=\"line\">  Utilizing cached dbt_protos-1.0.541-py3-none-any.whl.metadata (859 bytes)<\/span><span class=\"line\">Gathering mashumaro&lt;3.18,&gt;=3.9 (from mashumaro[msgpack]&lt;3.18,&gt;=3.9-&gt;dbt-adapters&lt;2,&gt;=1-&gt;dbt-duckdb)<\/span><span class=\"line\">...<\/span><span class=\"line\">...<\/span><span class=\"line\">...<\/span><span class=\"line\"\/><span class=\"line\">Utilizing cached typing_inspection-0.4.2-py3-none-any.whl (14 kB)<\/span><span class=\"line\">Utilizing cached tzdata-2026.3-py2.py3-none-any.whl (348 kB)<\/span><span class=\"line\">Utilizing cached zipp-4.1.0-py3-none-any.whl (10 kB)<\/span><span class=\"line\">Putting in collected packages: text-unidecode, pytz, pytimeparse, parsedatetime, leather-based, daff, zipp, urllib3, tzdata, typing-extensions, tabulate, sqlparse, sqlglot, six, rpds-py, rapidfuzz, pyyaml, python-slugify, python-dotenv, protobuf, pathspec, packaging, orderly-set, networkx, msgpack, more-itertools, MarkupSafe, isodate, idna, duckdb, dbt-extractor, dbt-core-experimental-parser, colorama, charset_normalizer, certifi, Babel, attrs, annotated-types, typing-inspection, requests, referencing, python-dateutil, pydantic-core, mashumaro, jinja2, importlib-metadata, deepdiff, dbt-protos, click on, agate, snowplow-tracker, pydantic, jsonschema-specifications, jsonschema, metricflow, dbt-common, dbt-adapters, dbt-core, dbt-duckdb<\/span><span class=\"line\">Efficiently put in Babel-2.18.0 MarkupSafe-3.0.3 agate-1.9.1 annotated-types-0.8.0 attrs-26.1.0 certifi-2026.7.22 charset_normalizer-3.4.9 click-8.4.2 colorama-0.4.6 daff-1.4.2 dbt-adapters-1.24.5 dbt-common-1.38.0 dbt-core-1.12.0 dbt-core-experimental-parser-2.0.0a5 dbt-duckdb-1.10.1 dbt-extractor-0.6.0 dbt-protos-1.0.541 deepdiff-8.6.2 duckdb-1.5.5 idna-3.18 importlib-metadata-9.0.0 isodate-0.7.2 jinja2-3.1.6 jsonschema-4.26.0 jsonschema-specifications-2025.9.1 leather-0.4.1 mashumaro-3.17 metricflow-0.211.0 more-itertools-10.8.0 msgpack-1.2.1 networkx-3.6.1 orderly-set-5.5.0 packaging-26.2 parsedatetime-2.6 pathspec-1.0.4 protobuf-6.33.6 pydantic-2.13.4 pydantic-core-2.46.4 python-dateutil-2.9.0.post0 python-dotenv-1.2.2 python-slugify-8.0.4 pytimeparse-1.1.8 pytz-2026.3.post1 pyyaml-6.0.3 rapidfuzz-3.14.5 referencing-0.37.0 requests-2.34.2 rpds-py-2026.6.3 six-1.17.0 snowplow-tracker-1.1.0 sqlglot-30.14.0 sqlparse-0.5.5 tabulate-0.10.0 text-unidecode-1.3 typing-extensions-4.16.0 typing-inspection-0.4.2 tzdata-2026.3 urllib3-2.7.0 zipp-4.1.0<\/span><span class=\"line\"\/><span class=\"line\">[notice] A brand new launch of pip is out there: 26.1.2 -&gt; 26.2<\/span><span class=\"line\">[notice] To replace, run: python3.exe -m pip set up --upgrade pip<\/span><span class=\"line\">(.venv) PS C:Usersthomaprojectsdbt-demo&gt;<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<h2 id=\"setting-up-a-dbt-project\" class=\"mt-12 text-3xl leading-9 font-bold\">Establishing a dbt\u00a0undertaking<\/h2>\n<p class=\"mt-6 text-xl leading-8\">The following factor we wish to do is initialise a dbt undertaking. We do that utilizing the <strong class=\"font-bold\">dbt init <\/strong>command.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">(.venv-core) PS C:Usersthomaprojectsdbt-demo&gt; dbt init<\/span><span class=\"line\">15:48:36  Working with dbt=1.12.0<\/span><span class=\"line\">Enter a reputation on your undertaking (letters, digits, underscore): my-dbt-demo<\/span><span class=\"line\">my-dbt-demo shouldn't be a legitimate undertaking identify.<\/span><span class=\"line\">Enter a reputation on your undertaking (letters, digits, underscore): my_dbt_demo<\/span><span class=\"line\">15:49:02  Establishing your profile.<\/span><span class=\"line\">Which database would you want to make use of?<\/span><span class=\"line\">[1] duckdb<\/span><span class=\"line\"\/><span class=\"line\">(Do not see the one you need? https:\/\/docs.getdbt.com\/docs\/available-adapters)<\/span><span class=\"line\">Enter a quantity: 1<\/span><span class=\"line\">15:49:05  Profile my_dbt_demo written to C:Usersthoma.dbtprofiles.yml utilizing goal's pattern configuration. As soon as up to date, you'll begin growing with dbt.<\/span><span class=\"line\">15:49:05  Working dbt debug to validate the undertaking...<\/span><span class=\"line\">15:49:05  dbt model: 1.12.0<\/span><span class=\"line\">15:49:05  python model: 3.13.14<\/span><span class=\"line\">15:49:05  python path: C:Usersthomaprojectsdbt-demo.venv-coreScriptspython3.exe<\/span><span class=\"line\">15:49:05  os data: Home windows-11-10.0.22621-SP0<\/span><span class=\"line\">15:49:05  Utilizing profiles dir at C:Usersthoma.dbt<\/span><span class=\"line\">15:49:05  Utilizing profiles.yml file at C:Usersthoma.dbtprofiles.yml<\/span><span class=\"line\">15:49:05  Utilizing dbt_project.yml file at C:Usersthomaprojectsdbt-demomy_dbt_demodbt_project.yml<\/span><span class=\"line\">15:49:05  adapter sort: duckdb<\/span><span class=\"line\">15:49:05  adapter model: 1.10.1<\/span><span class=\"line\">15:49:05  Configuration:<\/span><span class=\"line\">15:49:05    profiles.yml file [OK found and valid]<\/span><span class=\"line\">15:49:05    dbt_project.yml file [OK found and valid]<\/span><span class=\"line\">15:49:05  Required dependencies:<\/span><span class=\"line\">15:49:05   - git [OK found]<\/span><span class=\"line\">15:49:05  Connection:<\/span><span class=\"line\">15:49:05    database: dev<\/span><span class=\"line\">15:49:05    schema: major<\/span><span class=\"line\">15:49:05    path: dev.duckdb<\/span><span class=\"line\">15:49:05    config_options: None<\/span><span class=\"line\">15:49:05    extensions: None<\/span><span class=\"line\">15:49:05    settings: {}<\/span><span class=\"line\">15:49:05    external_root: .<\/span><span class=\"line\">15:49:05    use_credential_provider: None<\/span><span class=\"line\">15:49:05    connect: None<\/span><span class=\"line\">15:49:05    filesystems: None<\/span><span class=\"line\">15:49:05    distant: None<\/span><span class=\"line\">15:49:05    plugins: None<\/span><span class=\"line\">15:49:05    disable_transactions: False<\/span><span class=\"line\">15:49:05  Registered adapter: duckdb=1.10.1<\/span><span class=\"line\">15:49:05    Connection check: [OK connection ok]<\/span><span class=\"line\">15:49:05  All checks handed!<\/span><span class=\"line\">15:49:05  Your new dbt undertaking \"my_dbt_demo\" was created!<\/span><span class=\"line\">Initialized new undertaking in C:Usersthomaprojectsdbt-demomy_dbt_demomy_dbt_demo<\/span><span class=\"line\">For extra data on the right way to configure the profiles.yml file,<\/span><span class=\"line\">please seek the advice of the dbt documentation right here:<\/span><span class=\"line\">  https:\/\/docs.getdbt.com\/docs\/configure-your-profile<\/span><span class=\"line\">Another factor:<\/span><span class=\"line\">Need assistance? Do not hesitate to succeed in out to us through GitHub points or on Slack:<\/span><span class=\"line\">  https:\/\/neighborhood.getdbt.com\/<\/span><span class=\"line\">Comfortable modeling!<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">Working the above command will create a variety of folders and recordsdata. It&#8217;ll look one thing like this,<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">MY_DBT_DEMO\/<\/span><span class=\"line\">    analyses\/<\/span><span class=\"line\">    knowledge\/<\/span><span class=\"line\">    macros\/<\/span><span class=\"line\">    fashions\/<\/span><span class=\"line\">        instance\/<\/span><span class=\"line\">            my_first_dbt_model.sql<\/span><span class=\"line\">            my_second_dbt_model.sql<\/span><span class=\"line\">            schema.yml<\/span><span class=\"line\">    seeds\/<\/span><span class=\"line\">    snapshots\/<\/span><span class=\"line\">    exams\/<\/span><span class=\"line\">    .gitignore<\/span><span class=\"line\">    dbt_project.yml<\/span><span class=\"line\">    duckdb.exe<\/span><span class=\"line\">    README.md<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">The fashions\/instance folder exhibits two instance mannequin recordsdata and a schema file. We\u2019ll speak extra about mannequin recordsdata in a bit, however for now you may safely delete the whole instance folder and its contents.\u00a0<\/p>\n<p class=\"mt-6 text-xl leading-8\">One of the vital recordsdata that the dbt init course of creates is named <strong class=\"font-bold\">profiles.yml. <\/strong>This holds<strong class=\"font-bold\"> <\/strong>your database connection properties, however you gained\u2019t see it in your dbt undertaking construction. As a substitute, in Home windows, its full path is,<\/p>\n<p class=\"mt-6 text-xl leading-8\">In my setup, the file contained this.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">my_dbt_demo:<\/span><span class=\"line\">  outputs:<\/span><span class=\"line\">    dev:<\/span><span class=\"line\">      sort: duckdb<\/span><span class=\"line\">      path: dev.duckdb<\/span><span class=\"line\">      threads: 1<\/span><span class=\"line\"\/><span class=\"line\">    prod:<\/span><span class=\"line\">      sort: duckdb<\/span><span class=\"line\">      path: prod.duckdb<\/span><span class=\"line\">      threads: 4<\/span><span class=\"line\"\/><span class=\"line\">  goal: dev<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">Now we will see what dbt expects our database to be known as and the place it ought to reside. In fact, you may edit this file and alter these particulars if you need. The trail is relative to your HOME listing. I need my duckDB knowledge file to be in,<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">C:Usersthomaprojectsdbt-demodatamy_dbt_demo<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">So I up to date my profiles.yml file to appear to be this<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">my_dbt_demo:<\/span><span class=\"line\">  outputs:<\/span><span class=\"line\">    dev:<\/span><span class=\"line\">      sort: duckdb<\/span><span class=\"line\">      path: \"{{ env_var('USERPROFILE') }}\/tasks\/dbt-demo\/knowledge\/duckdb.dev\"<\/span><span class=\"line\">      schema: uncooked<\/span><span class=\"line\">      threads: 1<\/span><span class=\"line\"\/><span class=\"line\">    prod:<\/span><span class=\"line\">      sort: duckdb<\/span><span class=\"line\">      path: \"{{ env_var('USERPROFILE') }}\/tasks\/dbt-demo\/knowledge\/duckdb.prod\"<\/span><span class=\"line\">      schema: uncooked<\/span><span class=\"line\">      threads: 4<\/span><span class=\"line\"\/><span class=\"line\">  goal: dev<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<h2 id=\"creating-our-duckdb-database\" class=\"mt-12 text-3xl leading-9 font-bold\">Creating our DuckDB\u00a0database<\/h2>\n<p class=\"mt-6 text-xl leading-8\">Now we will create our DuckDB database. To try this, we have to set up the DuckDB CLI. Click on the hyperlink under and observe the directions related to your atmosphere.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">https:\/\/duckdb.org\/set up\/?atmosphere=cli&amp;platform=win&amp;download_method=direct<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">Run the duckdb CLI and cross it the identify of an acceptable file to completely retailer your database. You too can run it and not using a parameter in the event you\u2019re not bothered about conserving the info while you exit. Sort within the following command.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">(.venv-core) PS C:Usersthomaprojectsdbt-demomy_dbt_demo&gt; .duckdb $HOMEprojectsdbt-demomy_dbt_demodataduckdb.dev<\/span><span class=\"line\">DuckDB v1.5.5 (Variegata)<\/span><span class=\"line\">Enter \".assist\" for utilization hints.<\/span><span class=\"line\">duckdb D CREATE SCHEMA IF NOT EXISTS uncooked;<\/span><span class=\"line\">duckdb D<\/span><span class=\"line\">duckdb D CREATE OR REPLACE TABLE uncooked.orders (<\/span><span class=\"line\">             order_id       INTEGER,<\/span><span class=\"line\">             customer_name  VARCHAR,<\/span><span class=\"line\">             product_name   VARCHAR,<\/span><span class=\"line\">             order_date     DATE,<\/span><span class=\"line\">             amount       INTEGER,<\/span><span class=\"line\">             unit_price     DECIMAL(10, 2),<\/span><span class=\"line\">             order_status   VARCHAR<\/span><span class=\"line\">         );<\/span><span class=\"line\">duckdb D INSERT INTO uncooked.orders VALUES<\/span><span class=\"line\">             (1,  'Alice',   'Laptop computer Stand', '2026-01-03', 1,  39.99, 'accomplished'),<\/span><span class=\"line\">             (2,  'Bob',     'USB-C Hub',    '2026-01-04', 2,  29.99, 'accomplished'),<\/span><span class=\"line\">             (3,  'Charlie', 'Webcam',       '2026-01-05', 1,  74.50, 'returned'),<\/span><span class=\"line\">             (4,  'Alice',   'Keyboard',     '2026-01-08', 1,  89.00, 'accomplished'),<\/span><span class=\"line\">             (5,  'Diana',   'Mouse',        '2026-01-10', 2,  24.99, 'accomplished'),<\/span><span class=\"line\">             (6,  'Bob',     'Monitor',      '2026-01-12', 1, 249.00, 'processing'),<\/span><span class=\"line\">             (7,  'Alice',   'USB-C Hub',    '2026-02-02', 1,  29.99, 'accomplished'),<\/span><span class=\"line\">             (8,  'Charlie', 'Keyboard',     '2026-02-06', 1,  89.00, 'accomplished'),<\/span><span class=\"line\">             (9,  'Diana',   'Webcam',       '2026-02-09', 2,  74.50, 'accomplished'),<\/span><span class=\"line\">             (10, 'Bob',     'Mouse',        '2026-02-14', 1,  24.99, 'cancelled'),<\/span><span class=\"line\">             (11, 'Alice',   'Monitor',      '2026-03-01', 1, 249.00, 'accomplished'),<\/span><span class=\"line\">             (12, 'Diana',   'Laptop computer Stand', '2026-03-05', 2,  39.99, 'accomplished');<\/span><span class=\"line\">duckdb D<\/span><span class=\"line\">duckdb D SHOW ALL TABLES;<\/span><span class=\"line\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<\/span><span class=\"line\">\u2502 database \u2502 schema  \u2502  identify   \u2502            column_names             \u2502            column_types             \u2502 momentary \u2502<\/span><span class=\"line\">\u2502 varchar  \u2502 varchar \u2502 varchar \u2502              varchar[]              \u2502              varchar[]              \u2502  boolean  \u2502<\/span><span class=\"line\">\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<\/span><span class=\"line\">\u2502 duckdb   \u2502 uncooked     \u2502 orders  \u2502 [order_id, customer_name,           \u2502 [INTEGER, VARCHAR, VARCHAR, DATE,   \u2502 false     \u2502<\/span><span class=\"line\">\u2502          \u2502         \u2502         \u2502  product_name, order_date,          \u2502  INTEGER, 'DECIMAL(10,2)', VARCHAR] \u2502           \u2502<\/span><span class=\"line\">\u2502          \u2502         \u2502         \u2502  amount, unit_price,              \u2502                                     \u2502           \u2502<\/span><span class=\"line\">\u2502          \u2502         \u2502         \u2502  order_status]                      \u2502                                     \u2502           \u2502<\/span><span class=\"line\">\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/span><span class=\"line\">duckdb D<\/span><span class=\"line\">duckdb D SELECT *<\/span><span class=\"line\">         FROM uncooked.orders<\/span><span class=\"line\">         ORDER BY order_id;<\/span><span class=\"line\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<\/span><span class=\"line\">\u2502 order_id \u2502 customer_name \u2502 product_name \u2502 order_date \u2502 amount \u2502  unit_price   \u2502 order_status \u2502<\/span><span class=\"line\">\u2502  int32   \u2502    varchar    \u2502   varchar    \u2502    date    \u2502  int32   \u2502 decimal(10,2) \u2502   varchar    \u2502<\/span><span class=\"line\">\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<\/span><span class=\"line\">\u2502        1 \u2502 Alice         \u2502 Laptop computer Stand \u2502 2026-01-03 \u2502        1 \u2502         39.99 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502        2 \u2502 Bob           \u2502 USB-C Hub    \u2502 2026-01-04 \u2502        2 \u2502         29.99 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502        3 \u2502 Charlie       \u2502 Webcam       \u2502 2026-01-05 \u2502        1 \u2502         74.50 \u2502 returned     \u2502<\/span><span class=\"line\">\u2502        4 \u2502 Alice         \u2502 Keyboard     \u2502 2026-01-08 \u2502        1 \u2502         89.00 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502        5 \u2502 Diana         \u2502 Mouse        \u2502 2026-01-10 \u2502        2 \u2502         24.99 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502        6 \u2502 Bob           \u2502 Monitor      \u2502 2026-01-12 \u2502        1 \u2502        249.00 \u2502 processing   \u2502<\/span><span class=\"line\">\u2502        7 \u2502 Alice         \u2502 USB-C Hub    \u2502 2026-02-02 \u2502        1 \u2502         29.99 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502        8 \u2502 Charlie       \u2502 Keyboard     \u2502 2026-02-06 \u2502        1 \u2502         89.00 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502        9 \u2502 Diana         \u2502 Webcam       \u2502 2026-02-09 \u2502        2 \u2502         74.50 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502       10 \u2502 Bob           \u2502 Mouse        \u2502 2026-02-14 \u2502        1 \u2502         24.99 \u2502 cancelled    \u2502<\/span><span class=\"line\">\u2502       11 \u2502 Alice         \u2502 Monitor      \u2502 2026-03-01 \u2502        1 \u2502        249.00 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502       12 \u2502 Diana         \u2502 Laptop computer Stand \u2502 2026-03-05 \u2502        2 \u2502         39.99 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/span><span class=\"line\">  12 rows                                                                              7 columns<\/span><span class=\"line\">duckdb D<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<h2 id=\"creating-and-running-a-dbt-model-with-a-source\" class=\"mt-12 text-3xl leading-9 font-bold\">Creating and working a dbt mannequin with a\u00a0supply<\/h2>\n<p class=\"mt-6 text-xl leading-8\">Now that we have now knowledge in our database, we will begin to use dbt. Two of crucial ideas to understand in dbt are these of <strong class=\"font-bold\">fashions<\/strong> and<strong class=\"font-bold\"> sources<\/strong>. <\/p>\n<p class=\"mt-6 text-xl leading-8\">A mannequin is just a file containing a snippet of SQL that dbt makes use of to create a brand new desk or view in your goal database. <\/p>\n<p class=\"mt-6 text-xl leading-8\">A supply is an current desk or view in your knowledge retailer that dbt did not create, akin to uncooked knowledge loaded by an software or ingestion instrument. Sources are how fashions check with current tables in your database\/schema. You outline a supply utilizing a YAML configuration file. As we\u2019re working with an orders desk, we\u2019ll name ours <strong class=\"font-bold\">orders.yml.\u00a0<\/strong><\/p>\n<p class=\"mt-6 text-xl leading-8\">For our instance, we\u2019re going to create a mannequin that builds a desk to carry accomplished orders. This may check with our current orders database desk, so it is smart to create a supply YAML file for it. That appears like this:<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\"># orders.yml<\/span><span class=\"line\"\/><span class=\"line\">model: 2<\/span><span class=\"line\"\/><span class=\"line\">sources:<\/span><span class=\"line\">  - identify: uncooked<\/span><span class=\"line\">    schema: uncooked<\/span><span class=\"line\">    tables:<\/span><span class=\"line\">      - identify: orders<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">And our mannequin SQL file seems to be like this.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">-- customer_orders_summary.sql<\/span><span class=\"line\"\/><span class=\"line\">{{ config(materialized='desk') }}<\/span><span class=\"line\"\/><span class=\"line\">with completed_orders as (<\/span><span class=\"line\"\/><span class=\"line\">    choose<\/span><span class=\"line\">        order_id,<\/span><span class=\"line\">        customer_name,<\/span><span class=\"line\">        order_date,<\/span><span class=\"line\">        amount,<\/span><span class=\"line\">        amount * unit_price as order_value<\/span><span class=\"line\">    from {{ supply('uncooked', 'orders') }}<\/span><span class=\"line\">    the place decrease(order_status) = 'accomplished'<\/span><span class=\"line\"\/><span class=\"line\">)<\/span><span class=\"line\"\/><span class=\"line\">choose<\/span><span class=\"line\">    customer_name,<\/span><span class=\"line\">    rely(*) as completed_order_count,<\/span><span class=\"line\">    sum(amount) as total_units_purchased,<\/span><span class=\"line\">    spherical(sum(order_value), 2) as total_revenue,<\/span><span class=\"line\">    spherical(avg(order_value), 2) as average_order_value,<\/span><span class=\"line\">    min(order_date) as first_order_date,<\/span><span class=\"line\">    max(order_date) as most_recent_order_date<\/span><span class=\"line\">from completed_orders<\/span><span class=\"line\">group by customer_name<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">Create each the mannequin SQL file and supply YAML file underneath the fashions folder in your dbt undertaking.<\/p>\n<p class=\"mt-6 text-xl leading-8\">Hopefully you may instantly see the good thing about utilizing a supply in our mannequin file. As a result of the FROM clause within the SQL makes use of a reference relatively than an precise desk identify, if the supply desk identify have been to alter sooner or later sooner or later, you&#8217;ll solely must replace that change in a single place\u200a\u2014\u200a the supply file. Any and all SQLs utilizing the supply file would run unchanged.<\/p>\n<p class=\"mt-6 text-xl leading-8\">Okay, now that these recordsdata are in place, we will run our dbt transformation. You do this utilizing the<strong class=\"font-bold\"> dbt run<\/strong> command.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">(.venv-core) PS C:Usersthomaprojectsdbt-demomy_dbt_demo&gt; dbt run<\/span><span class=\"line\">20:33:39  Working with dbt=1.12.0<\/span><span class=\"line\">20:33:40  Registered adapter: duckdb=1.10.1<\/span><span class=\"line\">20:33:40  Unable to do partial parsing as a result of profile has modified<\/span><span class=\"line\">20:33:41  [WARNING]: Configuration paths exist in your dbt_project.yml file which don't apply to any sources.<\/span><span class=\"line\">There are 1 unused configuration paths:<\/span><span class=\"line\">- fashions.my_dbt_demo.instance<\/span><span class=\"line\">20:33:41  Discovered 1 mannequin, 1 supply, 486 macros<\/span><span class=\"line\">20:33:41<\/span><span class=\"line\">20:33:41  Concurrency: 1 threads (goal='dev')<\/span><span class=\"line\">20:33:41<\/span><span class=\"line\">20:33:41  1 of 1 START sql desk mannequin uncooked.customer_order_summary ........................ [RUN]<\/span><span class=\"line\">20:33:41  1 of 1 OK created sql desk mannequin uncooked.customer_order_summary ................... [OK in 0.11s]<\/span><span class=\"line\">20:33:41<\/span><span class=\"line\">20:33:41  Completed working 1 desk mannequin in 0 hours 0 minutes and 0.23 seconds (0.23s).<\/span><span class=\"line\">20:33:41<\/span><span class=\"line\">20:33:41  Accomplished efficiently<\/span><span class=\"line\">20:33:41<\/span><span class=\"line\">20:33:41  Achieved. PASS=1 WARN=0 ERROR=0 SKIP=0 NO-OP=0 REUSED=0 TOTAL=1<\/span><span class=\"line\"\/><span class=\"line\">(.venv-core) PS C:Usersthomaprojectsdbt-demomy_dbt_demo&gt; .duckdb $HOMEprojectsdbt-demomy_dbt_demodataduckdb.dev<\/span><span class=\"line\">DuckDB v1.5.5 (Variegata)<\/span><span class=\"line\">Enter \".assist\" for utilization hints.<\/span><span class=\"line\">duckdb D present all tables;<\/span><span class=\"line\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<\/span><span class=\"line\">\u2502 database \u2502 schema  \u2502          identify          \u2502        column_names         \u2502         column_types         \u2502 momentary \u2502<\/span><span class=\"line\">\u2502 varchar  \u2502 varchar \u2502        varchar         \u2502          varchar[]          \u2502          varchar[]           \u2502  boolean  \u2502<\/span><span class=\"line\">\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<\/span><span class=\"line\">\u2502 duckdb   \u2502 uncooked     \u2502 customer_order_summary \u2502 [customer_name,             \u2502 [VARCHAR, BIGINT, HUGEINT,   \u2502 false     \u2502<\/span><span class=\"line\">\u2502          \u2502         \u2502                        \u2502  completed_order_count,     \u2502  'DECIMAL(38,2)', DOUBLE,    \u2502           \u2502<\/span><span class=\"line\">\u2502          \u2502         \u2502                        \u2502  total_units_purchased,     \u2502  DATE, DATE]                 \u2502           \u2502<\/span><span class=\"line\">\u2502          \u2502         \u2502                        \u2502  total_revenue,             \u2502                              \u2502           \u2502<\/span><span class=\"line\">\u2502          \u2502         \u2502                        \u2502  average_order_value,       \u2502                              \u2502           \u2502<\/span><span class=\"line\">\u2502          \u2502         \u2502                        \u2502  first_order_date,          \u2502                              \u2502           \u2502<\/span><span class=\"line\">\u2502          \u2502         \u2502                        \u2502  most_recent_order_date]    \u2502                              \u2502           \u2502<\/span><span class=\"line\">\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<\/span><span class=\"line\">\u2502 duckdb   \u2502 uncooked     \u2502 orders                 \u2502 [order_id, customer_name,   \u2502 [INTEGER, VARCHAR, VARCHAR,  \u2502 false     \u2502<\/span><span class=\"line\">\u2502          \u2502         \u2502                        \u2502  product_name, order_date,  \u2502  DATE, INTEGER,              \u2502           \u2502<\/span><span class=\"line\">\u2502          \u2502         \u2502                        \u2502  quantity, unit_price,      \u2502  'DECIMAL(10,2)', VARCHAR]   \u2502           \u2502<\/span><span class=\"line\">\u2502          \u2502         \u2502                        \u2502  order_status]              \u2502                              \u2502           \u2502<\/span><span class=\"line\">\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/span><span class=\"line\"\/><span class=\"line\">duckdb D choose * from uncooked.customer_order_summary;<\/span><span class=\"line\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<\/span><span class=\"line\">\u2502 customer_name \u2502 completed_order_count \u2502 \u2026 \u2502 average_order_value \u2502 first_order_date \u2502 most_recent_order_date \u2502<\/span><span class=\"line\">\u2502    varchar    \u2502         int64         \u2502 \u2026 \u2502       double        \u2502       date       \u2502          date          \u2502<\/span><span class=\"line\">\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<\/span><span class=\"line\">\u2502 Charlie       \u2502                     1 \u2502 \u2026 \u2502                89.0 \u2502 2026-02-06       \u2502 2026-02-06             \u2502<\/span><span class=\"line\">\u2502 Alice         \u2502                     4 \u2502 \u2026 \u2502               102.0 \u2502 2026-01-03       \u2502 2026-03-01             \u2502<\/span><span class=\"line\">\u2502 Bob           \u2502                     1 \u2502 \u2026 \u2502               59.98 \u2502 2026-01-04       \u2502 2026-01-04             \u2502<\/span><span class=\"line\">\u2502 Diana         \u2502                     3 \u2502 \u2026 \u2502               92.99 \u2502 2026-01-10       \u2502 2026-03-05             \u2502<\/span><span class=\"line\">\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">The output is as anticipated. A brand new abstract desk is created with the required data. That\u2019s all I\u2019m going to say on fashions and sources. What I\u2019ve proven may appear a little bit of a faff for only one desk, and it&#8217;s, however belief me, in case you are coping with dozens or lots of of tables and transformations, you gained\u2019t remorse the time spent on creating fashions and sources.<\/p>\n<h2 id=\"using-dbt-for-testing-your-data\" class=\"mt-12 text-3xl leading-9 font-bold\">Utilizing dbt for\u00a0testing your knowledge<\/h2>\n<p class=\"mt-6 text-xl leading-8\">One other advantage of utilizing dbt is its capability to automate your SQL testing cycle. Assessments are outlined (in YAML) alongside your fashions and sources and may be executed independently or at any time when the undertaking is constructed. You may write your individual SQL exams, however dbt additionally supplies 4 built-in check situations:<\/p>\n<ul class=\"mt-6 list-disc pl-10 text-xl leading-8\">\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\">distinctive<\/p>\n<\/li>\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\">not_null<\/p>\n<\/li>\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\">relationships<\/p>\n<\/li>\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\">accepted_values<\/p>\n<\/li>\n<\/ul>\n<p class=\"mt-6 text-xl leading-8\">We\u2019ll demo two of those exams to present you a flavour of what you are able to do with them.<\/p>\n<h3 id=\"not-null-test\" class=\"mt-9 text-[22.5px] leading-9 font-bold text-black\">Not null\u00a0check<\/h3>\n<p class=\"mt-6 text-xl leading-8\">Our check can be run towards the customer_name column of the customer_order_summary desk. As we\u2019re testing a desk that dbt is creating, we add the check YAML to a fashions part in our orders.yml file. It now seems to be like this:<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\"># orders.yml<\/span><span class=\"line\"\/><span class=\"line\">model: 2<\/span><span class=\"line\"\/><span class=\"line\">sources:<\/span><span class=\"line\">  - identify: uncooked<\/span><span class=\"line\">    schema: uncooked<\/span><span class=\"line\">    tables:<\/span><span class=\"line\">      - identify: orders<\/span><span class=\"line\"\/><span class=\"line\">fashions:<\/span><span class=\"line\">  - identify: customer_order_summary<\/span><span class=\"line\">    columns:<\/span><span class=\"line\">      - identify: customer_name<\/span><span class=\"line\">        data_tests:<\/span><span class=\"line\">          - not_null<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">As I didn\u2019t have any null buyer names in my authentic orders desk, I created one so we will see what a failing check seems to be like.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">duckdb D replace uncooked.orders set customer_name = NULL the place order_id = 1;<\/span><span class=\"line\">duckdb D choose * from uncooked.orders;<\/span><span class=\"line\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<\/span><span class=\"line\">\u2502 order_id \u2502 customer_name \u2502 product_name \u2502 order_date \u2502 amount \u2502  unit_price   \u2502 order_status \u2502<\/span><span class=\"line\">\u2502  int32   \u2502    varchar    \u2502   varchar    \u2502    date    \u2502  int32   \u2502 decimal(10,2) \u2502   varchar    \u2502<\/span><span class=\"line\">\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<\/span><span class=\"line\">\u2502        1 \u2502 NULL          \u2502 Laptop computer Stand \u2502 2026-01-03 \u2502        1 \u2502         39.99 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502        2 \u2502 Bob           \u2502 USB-C Hub    \u2502 2026-01-04 \u2502        2 \u2502         29.99 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502        3 \u2502 Charlie       \u2502 Webcam       \u2502 2026-01-05 \u2502        1 \u2502         74.50 \u2502 returned     \u2502<\/span><span class=\"line\">\u2502        4 \u2502 Alice         \u2502 Keyboard     \u2502 2026-01-08 \u2502        1 \u2502         89.00 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502        5 \u2502 Diana         \u2502 Mouse        \u2502 2026-01-10 \u2502        2 \u2502         24.99 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502        6 \u2502 Bob           \u2502 Monitor      \u2502 2026-01-12 \u2502        1 \u2502        249.00 \u2502 processing   \u2502<\/span><span class=\"line\">\u2502        7 \u2502 Alice         \u2502 USB-C Hub    \u2502 2026-02-02 \u2502        1 \u2502         29.99 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502        8 \u2502 Charlie       \u2502 Keyboard     \u2502 2026-02-06 \u2502        1 \u2502         89.00 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502        9 \u2502 Diana         \u2502 Webcam       \u2502 2026-02-09 \u2502        2 \u2502         74.50 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502       10 \u2502 Bob           \u2502 Mouse        \u2502 2026-02-14 \u2502        1 \u2502         24.99 \u2502 cancelled    \u2502<\/span><span class=\"line\">\u2502       11 \u2502 Alice         \u2502 Monitor      \u2502 2026-03-01 \u2502        1 \u2502        249.00 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2502       12 \u2502 Diana         \u2502 Laptop computer Stand \u2502 2026-03-05 \u2502        2 \u2502         39.99 \u2502 accomplished    \u2502<\/span><span class=\"line\">\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/span><span class=\"line\">  12 rows                                                                              7 columns<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">Now, to run our check, we will merely sort the <strong class=\"font-bold\">dbt construct<\/strong> command like this, which runs and validates the chosen elements of a dbt undertaking in dependency order.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">(.venv-core) PS C:Usersthomaprojectsdbt-demomy_dbt_demo&gt; dbt construct<\/span><span class=\"line\">08:43:19  Working with dbt=1.12.0<\/span><span class=\"line\">08:43:20  Registered adapter: duckdb=1.10.1<\/span><span class=\"line\">08:43:20  [WARNING]: Configuration paths exist in your dbt_project.yml file which don't apply to any sources.<\/span><span class=\"line\">There are 1 unused configuration paths:<\/span><span class=\"line\">- fashions.my_dbt_demo.instance<\/span><span class=\"line\">08:43:20  Discovered 1 mannequin, 1 check, 1 supply, 486 macros<\/span><span class=\"line\">08:43:20<\/span><span class=\"line\">08:43:20  Concurrency: 1 threads (goal='dev')<\/span><span class=\"line\">08:43:20<\/span><span class=\"line\">08:43:20  1 of two START sql desk mannequin uncooked.customer_order_summary ........................ [RUN]<\/span><span class=\"line\">08:43:20  1 of two OK created sql desk mannequin uncooked.customer_order_summary ................... [OK in 0.14s]<\/span><span class=\"line\">08:43:20  2 of two START check not_null_customer_order_summary_customer_name ................ [RUN]<\/span><span class=\"line\">08:43:20  2 of two FAIL 1 not_null_customer_order_summary_customer_name .................... [FAIL 1 in 0.02s]<\/span><span class=\"line\">08:43:20<\/span><span class=\"line\">08:43:20  Completed working 1 desk mannequin, 1 check in 0 hours 0 minutes and 0.24 seconds (0.24s).<\/span><span class=\"line\">08:43:20<\/span><span class=\"line\">08:43:20  Accomplished with 1 error, 0 partial successes, and 0 warnings:<\/span><span class=\"line\">08:43:20<\/span><span class=\"line\">08:43:20  [ERROR]: in check not_null_customer_order_summary_customer_name (modelsorders.yml)<\/span><span class=\"line\">08:43:20    Received 1 outcome, configured to fail if != 0<\/span><span class=\"line\">08:43:20<\/span><span class=\"line\">08:43:20    compiled code at targetcompiledmy_dbt_demomodelsorders.ymlnot_null_customer_order_summary_customer_name.sql<\/span><span class=\"line\">08:43:20<\/span><span class=\"line\">08:43:20  Achieved. PASS=1 WARN=0 ERROR=1 SKIP=0 NO-OP=0 REUSED=0 TOTAL=2<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">The problem is caught and reported on. dbt does not delete or roll again a mannequin when its subsequent knowledge check fails. Nevertheless, fashions downstream of the failed check are usually skipped through the construct. If you wish to run the check with out re-creating any tables, and so forth., simply use the<strong class=\"font-bold\"> dbt check<\/strong> command.<\/p>\n<h3 id=\"accepted-values-test\" class=\"mt-9 text-[22.5px] leading-9 font-bold text-black\">Accepted values\u00a0check<\/h3>\n<p class=\"mt-6 text-xl leading-8\">This does precisely what it seems like. It lets you check {that a} column comprises solely particular values. If we take a look at our orders desk, we will see that the order_status column ought to solely comprise both <strong class=\"font-bold\">accomplished,<\/strong> <strong class=\"font-bold\">processing, returned <\/strong>or<strong class=\"font-bold\"> cancelled <\/strong>values. So let\u2019s replace the desk and alter one of many values to be one thing else.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">duckdb D choose * from uncooked.orders the place order_id = 10;<\/span><span class=\"line\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<\/span><span class=\"line\">\u2502 order_id \u2502 customer_name \u2502 product_name \u2502 order_date \u2502 amount \u2502  unit_price   \u2502 order_status \u2502<\/span><span class=\"line\">\u2502  int32   \u2502    varchar    \u2502   varchar    \u2502    date    \u2502  int32   \u2502 decimal(10,2) \u2502   varchar    \u2502<\/span><span class=\"line\">\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<\/span><span class=\"line\">\u2502       10 \u2502 Bob           \u2502 Mouse        \u2502 2026-02-14 \u2502        1 \u2502         24.99 \u2502 cancelled    \u2502<\/span><span class=\"line\">\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/span><span class=\"line\">duckdb D replace uncooked.orders set order_status = 'invalid' the place order_id = 10;<\/span><span class=\"line\">duckdb D choose * from uncooked.orders the place order_id = 10;<\/span><span class=\"line\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<\/span><span class=\"line\">\u2502 order_id \u2502 customer_name \u2502 product_name \u2502 order_date \u2502 amount \u2502  unit_price   \u2502 order_status \u2502<\/span><span class=\"line\">\u2502  int32   \u2502    varchar    \u2502   varchar    \u2502    date    \u2502  int32   \u2502 decimal(10,2) \u2502   varchar    \u2502<\/span><span class=\"line\">\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<\/span><span class=\"line\">\u2502       10 \u2502 Bob           \u2502 Mouse        \u2502 2026-02-14 \u2502        1 \u2502         24.99 \u2502 invalid      \u2502<\/span><span class=\"line\">\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">As we\u2019re testing a supply desk, we must always put our check YAML config within the sources part of our YAML file. You may depart or take away the unique null check if you need. I\u2019ve stored it in.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\"># orders.yml<\/span><span class=\"line\"\/><span class=\"line\">model: 2<\/span><span class=\"line\"\/><span class=\"line\">sources:<\/span><span class=\"line\">  - identify: uncooked<\/span><span class=\"line\">    schema: uncooked<\/span><span class=\"line\">    tables:<\/span><span class=\"line\">      - identify: orders<\/span><span class=\"line\">        columns:<\/span><span class=\"line\">          - identify: order_status<\/span><span class=\"line\">            data_tests:<\/span><span class=\"line\">              - accepted_values:<\/span><span class=\"line\">                  arguments:<\/span><span class=\"line\">                    values:<\/span><span class=\"line\">                      - accomplished<\/span><span class=\"line\">                      - processing<\/span><span class=\"line\">                      - returned<\/span><span class=\"line\">                      - cancelled<\/span><span class=\"line\"\/><span class=\"line\">fashions:<\/span><span class=\"line\">  - identify: customer_order_summary<\/span><span class=\"line\">    columns:<\/span><span class=\"line\">      - identify: customer_name<\/span><span class=\"line\">        data_tests:<\/span><span class=\"line\">          - not_null<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">We&#8217;re working the check on an current desk, so we needn&#8217;t run the construct command. We are able to simply use dbt check.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">(.venv-core) PS C:Usersthomaprojectsdbt-demomy_dbt_demo&gt; dbt check<\/span><span class=\"line\">09:08:04  Working with dbt=1.12.0<\/span><span class=\"line\">09:08:04  Registered adapter: duckdb=1.10.1<\/span><span class=\"line\">09:08:04  [WARNING]: Configuration paths exist in your dbt_project.yml file which don't apply to any sources.<\/span><span class=\"line\">There are 1 unused configuration paths:<\/span><span class=\"line\">- fashions.my_dbt_demo.instance<\/span><span class=\"line\">09:08:04  Discovered 1 mannequin, 2 knowledge exams, 1 supply, 486 macros<\/span><span class=\"line\">09:08:04<\/span><span class=\"line\">09:08:04  Concurrency: 1 threads (goal='dev')<\/span><span class=\"line\">09:08:04<\/span><span class=\"line\">09:08:04  1 of two START check not_null_customer_order_summary_customer_name ................ [RUN]<\/span><span class=\"line\">09:08:04  1 of two FAIL 1 not_null_customer_order_summary_customer_name .................... [FAIL 1 in 0.03s]<\/span><span class=\"line\">09:08:04  2 of two START check source_accepted_values_raw_orders_order_status__completed__processing__returned__cancelled  [RUN]<\/span><span class=\"line\">09:08:04  2 of two FAIL 1 source_accepted_values_raw_orders_order_status__completed__processing__returned__cancelled  [FAIL 1 in 0.02s]<\/span><span class=\"line\">09:08:04<\/span><span class=\"line\">09:08:04  Completed working 2 knowledge exams in 0 hours 0 minutes and 0.11 seconds (0.11s).<\/span><span class=\"line\">09:08:04<\/span><span class=\"line\">09:08:04  Accomplished with 2 errors, 0 partial successes, and 0 warnings:<\/span><span class=\"line\">09:08:04<\/span><span class=\"line\">09:08:04  [ERROR]: in check not_null_customer_order_summary_customer_name (modelsorders.yml)<\/span><span class=\"line\">09:08:04    Received 1 outcome, configured to fail if != 0<\/span><span class=\"line\">09:08:04<\/span><span class=\"line\">09:08:04    compiled code at targetcompiledmy_dbt_demomodelsorders.ymlnot_null_customer_order_summary_customer_name.sql<\/span><span class=\"line\">09:08:04<\/span><span class=\"line\">09:08:04  [ERROR]: in check source_accepted_values_raw_orders_order_status__completed__processing__returned__cancelled (modelsorders.yml)<\/span><span class=\"line\">09:08:04    Received 1 outcome, configured to fail if != 0<\/span><span class=\"line\">09:08:04<\/span><span class=\"line\">09:08:04    compiled code at targetcompiledmy_dbt_demomodelsorders.ymlsource_accepted_values_raw_ord_0932c13ab9fb3a73a9e3e3c87c81af50.sql<\/span><span class=\"line\">09:08:04<\/span><span class=\"line\">09:08:04  Achieved. PASS=0 WARN=0 ERROR=2 SKIP=0 NO-OP=0 REUSED=0 TOTAL=2<\/span><span class=\"line\">(.venv-core) PS C:Usersthomaprojectsdbt-demomy_dbt_demo&gt;<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">The opposite two sorts of built-in check are equally straightforward to arrange and run, so I am going to depart it at that.<\/p>\n<h2 id=\"using-dbt-to-document-your-system\" class=\"mt-12 text-3xl leading-9 font-bold\">Utilizing dbt to doc your\u00a0system<\/h2>\n<p class=\"mt-6 text-xl leading-8\">The ultimate introductory dbt matter we\u2019re going to take a look at is arguably certainly one of its finest options. Most documentation begins life with good intentions earlier than quietly changing into old-fashioned. dbt approaches documentation in another way.<\/p>\n<p class=\"mt-6 text-xl leading-8\">As a result of your fashions, exams and metadata all reside alongside your SQL, dbt can generate undertaking documentation routinely. Extra importantly, it additionally creates a visible lineage graph displaying precisely how your fashions depend upon each other.<\/p>\n<p class=\"mt-6 text-xl leading-8\">That is invaluable when somebody new joins your undertaking as a result of they don\u2019t must reverse-engineer lots of of SQL recordsdata. They&#8217;ll see the whole transformation pipeline virtually instantly.<\/p>\n<p class=\"mt-6 text-xl leading-8\">It\u2019s a type of options that doesn\u2019t appear notably thrilling till you\u2019ve inherited another person\u2019s analytics undertaking.<\/p>\n<p class=\"mt-6 text-xl leading-8\">Proper off the bat, dbt can do some automated documentation for you, but it surely\u2019s a type of issues that the extra you place into it, the higher documentation you&#8217;ll get out. With out doing something additional to our undertaking, right here is the naked documentation you get. We use the <strong class=\"font-bold\">dbt docs generate <\/strong>command to create the documentation like this.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">(.venv-core) PS C:Usersthomaprojectsdbt-demomy_dbt_demo&gt; dbt docs generate<\/span><span class=\"line\"\/><span class=\"line\">09:21:19  Working with dbt=1.12.0<\/span><span class=\"line\">09:21:19  Registered adapter: duckdb=1.10.1<\/span><span class=\"line\">09:21:19  [WARNING]: Configuration paths exist in your dbt_project.yml file which don't apply to any sources.<\/span><span class=\"line\">There are 1 unused configuration paths:<\/span><span class=\"line\">- fashions.my_dbt_demo.instance<\/span><span class=\"line\">09:21:19  Discovered 1 mannequin, 2 knowledge exams, 1 supply, 486 macros<\/span><span class=\"line\">09:21:19<\/span><span class=\"line\">09:21:19  Concurrency: 1 threads (goal='dev')<\/span><span class=\"line\">09:21:19<\/span><span class=\"line\">09:21:19  Constructing catalog<\/span><span class=\"line\">09:21:19  Catalog written to C:Usersthomaprojectsdbt-demomy_dbt_demotargetcatalog.json<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">Now that we\u2019ve generated the documentation, we will visualise it in an online browser utilizing the <strong class=\"font-bold\">dbt docs serve<\/strong> command.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">(.venv-core) PS C:Usersthomaprojectsdbt-demomy_dbt_demo&gt; dbt docs serve<\/span><span class=\"line\">09:24:48  Working with dbt=1.12.0<\/span><span class=\"line\">Serving docs at 8080<\/span><span class=\"line\">To entry out of your browser, navigate to: http:\/\/localhost:8080<\/span><span class=\"line\"\/><span class=\"line\">Press Ctrl+C to exit.<\/span><span class=\"line\">127.0.0.1 - - [04\/Aug\/2026 10:24:48] \"GET \/ HTTP\/1.1\" 200 -<\/span><span class=\"line\">127.0.0.1 - - [04\/Aug\/2026 10:24:48] \"GET \/manifest.json?cb=1785835488811 HTTP\/1.1\" 200 -<\/span><span class=\"line\">127.0.0.1 - - [04\/Aug\/2026 10:24:48] \"GET \/catalog.json?cb=1785835488811 HTTP\/1.1\" 200 -<\/span><span class=\"line\">127.0.0.1 - - [04\/Aug\/2026 10:24:49] code 404, message File not discovered<\/span><span class=\"line\">127.0.0.1 - - [04\/Aug\/2026 10:24:49] \"GET \/%7Bpercent7Bpercent20getIcon(merchandise.sort,%20'on')%20percent7Dpercent7D HTTP\/1.1\" 404 -<\/span><span class=\"line\">127.0.0.1 - - [04\/Aug\/2026 10:24:49] code 404, message File not discovered<\/span><span class=\"line\">127.0.0.1 - - [04\/Aug\/2026 10:24:49] \"GET \/%7Bpercent7Bpercent20getIcon(merchandise.sort,%20'off')%20percent7Dpercent7D HTTP\/1.1\" 404 -<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">You must see a browser window open that appears one thing like this,<\/p>\n<figure class=\"mt-6\" style=\"text-align:center\">\n<div class=\"relative overflow-hidden\" style=\"width:100%px;max-width:100%;aspect-ratio:1080\/587\"><img decoding=\"async\" src=\"https:\/\/assets.insightmediagroup.io\/media\/wp-content\/uploads\/2026\/08\/image-12-1024x557.png\" alt=\"\" class=\"w-full absolute inset-0 h-full object-cover\"\/><\/div>\n<\/figure>\n<p class=\"mt-6 text-xl leading-8\">As I discussed, it\u2019s fairly bare-bones however nonetheless helpful. To see the true energy, you need to add your individual descriptive documentation textual content within the type of YAML to your orders.yml file. Right here is an instance.<\/p>\n<div class=\"mt-6 w-full max-w-full overflow-hidden rounded-lg border border-gray-200\" data-code-theme=\"light\">\n<div class=\"mt-0 text-sm [&amp;_pre]:py-0 [&amp;_pre]:grid [&amp;_code]:py-4 [&amp;_code]:w-full [&amp;_code]:grid [&amp;_code]:overflow-x-auto [&amp;_code]:no-scrollbar [&amp;_code]:bg-transparent [&amp;_.line]:px-3 [&amp;_.line]:w-full [&amp;_.line]:relative [&amp;_.line]:min-h-5\">\n<div>\n<pre class=\"w-full bg-white text-[#24292e]\"><code><span class=\"line\">model: 2<\/span><span class=\"line\"\/><span class=\"line\">sources:<\/span><span class=\"line\">  - identify: uncooked<\/span><span class=\"line\">    description: \"Uncooked demonstration knowledge created straight in DuckDB earlier than dbt transformations run.\"<\/span><span class=\"line\">    schema: uncooked<\/span><span class=\"line\">    tables:<\/span><span class=\"line\">      - identify: orders<\/span><span class=\"line\">        description: \"Pattern buyer orders used because the enter to the shopper order abstract mannequin.\"<\/span><span class=\"line\">        columns:<\/span><span class=\"line\">          - identify: order_id<\/span><span class=\"line\">            description: \"Distinctive identifier assigned to every order.\"<\/span><span class=\"line\"\/><span class=\"line\">          - identify: customer_name<\/span><span class=\"line\">            description: \"Title of the shopper who positioned the order.\"<\/span><span class=\"line\"\/><span class=\"line\">          - identify: product_name<\/span><span class=\"line\">            description: \"Product bought by the shopper.\"<\/span><span class=\"line\"\/><span class=\"line\">          - identify: order_date<\/span><span class=\"line\">            description: \"Date on which the order was positioned.\"<\/span><span class=\"line\"\/><span class=\"line\">          - identify: amount<\/span><span class=\"line\">            description: \"Variety of product models ordered.\"<\/span><span class=\"line\"\/><span class=\"line\">          - identify: unit_price<\/span><span class=\"line\">            description: \"Worth of 1 product unit on the time of the order.\"<\/span><span class=\"line\"\/><span class=\"line\">          - identify: order_status<\/span><span class=\"line\">            description: \"Present order state; restricted to the 4 supported standing values.\"<\/span><span class=\"line\">            data_tests:<\/span><span class=\"line\">              - accepted_values:<\/span><span class=\"line\">                  arguments:<\/span><span class=\"line\">                    values:<\/span><span class=\"line\">                      - accomplished<\/span><span class=\"line\">                      - processing<\/span><span class=\"line\">                      - returned<\/span><span class=\"line\">                      - cancelled<\/span><span class=\"line\"\/><span class=\"line\">fashions:<\/span><span class=\"line\">  - identify: customer_order_summary<\/span><span class=\"line\">    description: &gt;<\/span><span class=\"line\">      A dbt-created desk containing one row per buyer. It contains solely accomplished<\/span><span class=\"line\">      orders and summarises order counts, models bought, income and order dates.<\/span><span class=\"line\">    columns:<\/span><span class=\"line\">      - identify: customer_name<\/span><span class=\"line\">        description: \"Buyer represented by the abstract row.\"<\/span><span class=\"line\">        data_tests:<\/span><span class=\"line\">          - not_null<\/span><span class=\"line\"\/><span class=\"line\">      - identify: completed_order_count<\/span><span class=\"line\">        description: \"Variety of accomplished orders positioned by the shopper.\"<\/span><span class=\"line\"\/><span class=\"line\">      - identify: total_units_purchased<\/span><span class=\"line\">        description: \"Whole variety of models throughout the shopper's accomplished orders.\"<\/span><span class=\"line\"\/><span class=\"line\">      - identify: total_revenue<\/span><span class=\"line\">        description: \"Whole worth of the shopper's accomplished orders.\"<\/span><span class=\"line\"\/><span class=\"line\">      - identify: average_order_value<\/span><span class=\"line\">        description: \"Common worth of the shopper's accomplished orders.\"<\/span><span class=\"line\"\/><span class=\"line\">      - identify: first_order_date<\/span><span class=\"line\">        description: \"Earliest accomplished order date for the shopper.\"<\/span><span class=\"line\"\/><span class=\"line\">      - identify: most_recent_order_date<\/span><span class=\"line\">        description: \"Most up-to-date accomplished order date for the shopper.\"<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"mt-6 text-xl leading-8\">Now, once we run the 2 dbt documentation instructions, we get a a lot richer output like this.<\/p>\n<figure class=\"mt-6\" style=\"text-align:center\">\n<div class=\"relative overflow-hidden\" style=\"width:100%px;max-width:100%;aspect-ratio:1080\/683\"><img decoding=\"async\" src=\"https:\/\/assets.insightmediagroup.io\/media\/wp-content\/uploads\/2026\/08\/image-13-1024x648.png\" alt=\"\" class=\"w-full absolute inset-0 h-full object-cover\"\/><\/div>\n<\/figure>\n<h2 id=\"next-stages\" class=\"mt-12 text-3xl leading-9 font-bold\">Subsequent levels<\/h2>\n<p class=\"mt-6 text-xl leading-8\">dbt is a big ecosystem, and as I defined, I solely needed to the touch on a number of the fundamentals of its operation. As issues stand, I\u2019m proud of the information I&#8217;ve on utilizing dbt. If you wish to take issues additional, you would possibly wish to dive deeper into the next matters, which construct on what I\u2019ve talked about right here.<\/p>\n<ul class=\"mt-6 list-disc pl-10 text-xl leading-8\">\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\"><strong class=\"font-bold\">Incremental fashions:<\/strong> Course of solely new or modified data as an alternative of rebuilding a complete desk on each run.<\/p>\n<\/li>\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\"><strong class=\"font-bold\">Jinja<\/strong>: A templating language that permits you to add variables, situations, loops and reusable features to SQL.<\/p>\n<\/li>\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\"><strong class=\"font-bold\">Macros:<\/strong> Reusable items of Jinja and SQL logic that may settle for parameters and generate SQL.<\/p>\n<\/li>\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\"><strong class=\"font-bold\">Snapshots:<\/strong> Report how supply data change over time, permitting you to retain their historic values.<\/p>\n<\/li>\n<li class=\"mt-2 [&amp;&gt;p]:mt-0\">\n<p class=\"mt-6 text-xl leading-8\"><strong class=\"font-bold\">Reusable packages:<\/strong> Use fashions, macros and exams created by different dbt tasks as an alternative of constructing every part your self.<\/p>\n<\/li>\n<\/ul>\n<p class=\"mt-6 text-xl leading-8\">Here&#8217;s a hyperlink to the official dbt Labs house web page the place you may discover all the knowledge you must find out about dbt.<\/p>\n<p class=\"mt-6 text-xl leading-8\"><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/www.getdbt.com\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"underline underline-offset-2 transition-colors hover:text-brand\">https:\/\/www.getdbt.com<\/a><\/p>\n<p class=\"mt-6 text-xl leading-8\">Comfortable studying.<\/p>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>As a contract knowledge engineer, I typically expertise \u2014 ahem \u2014 let&#8217;s simply say, durations of inactivity. Once I browse the web marketplace for appropriate roles throughout these instances, some of the in-demand expertise I preserve seeing is expertise with a instrument known as dbt.\u00a0 So, to present myself the very best probability of acquiring [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":18573,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55],"tags":[157,1483,2296,10495],"class_list":["post-18571","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-machine-learning","tag-data","tag-science","tag-started","tag-withdbt"],"_links":{"self":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/18571","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18571"}],"version-history":[{"count":1,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/18571\/revisions"}],"predecessor-version":[{"id":18572,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/18571\/revisions\/18572"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/media\/18573"}],"wp:attachment":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}