Giter Club home page Giter Club logo

dbt-devcontainer-postgres-adminer's Introduction

dbt-devcontainer-demo-template

Template to create self-contained dev container demos of transforming data with dbt. Useful for interviews.

Screenshot of dbt running in a dev container and a dbt docs window

Setup

  1. Install Docker.
  2. Install VS Code and install the Dev Containers extension.
  3. Open this folder in a container in VS Code.
  4. Open a VS Code terminal. You should see the following prompt:
    vscode โžœ /workspace (main) $
    
    If you see it, you're now in a development container with dbt pre-installed and pre-configured!

Usage

  1. Copy your CSV file into seeds/ to use it as a dbt seed.
  2. Run dbt seed
  3. Generate dbt schema for your seed using the following command (be sure to replace "test" with the basename of your CSV file):
    dbt run-operation generate_model_yaml --args '{"model_name": "test"}'
    
    Copy and paste the output to a new file seeds/schema.yml, replacing 'models:' with 'seeds:'. Re-generate the docs with dbt docs generate and you should now be able to see your source declaration when you refresh http://localhost:8081
  4. Code your transformations as usual. Some useful references:
  5. To update docs, run dbt docs generate. The updated documentation will be available on refresh at http://localhost:8081.
  6. Run the transformations with dbt run and tests with dbt test as usual.
  7. Query your table data in Adminer at http://localhost:8080. Choose "PostgreSQL" as the system, leave "warehouse" as the server, and enter "postgres" as both the username and password.

Credits

Based on Microsoft's python3-postgres example.

dbt-devcontainer-postgres-adminer's People

Contributors

johnoscott avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.