Skip to content

Example of a dbt transform on Splitgraph Cloud with Github Actions

Notifications You must be signed in to change notification settings

splitgraph/dbt-transform-example

Repository files navigation

dbt-transform-example

Example of a dbt transform on Splitgraph Cloud with Github Actions

If you're reading this on Splitgraph: this is built from a GitHub repository and a dbt project at https://github.com/splitgraph/dbt-transform-example. It uses data from trase/supply-chains.

If you're reading this on GitHub: This repository contains a dbt project that builds a model from the data in https://splitgraph.com/trase/supply-chains and outputs it to https://splitgraph.com/splitgraph/dbt-transform-example.

How it works

Using this in your own projects

  • Fork this repository
  • Get a pair of Splitgraph API credentials on the settings page and set them up as GitHub Secrets:
    • SPLITGRAPH_API_KEY
    • SPLITGRAPH_API_SECRET
  • Change splitgraph/dbt-transform-example in splitgraph.yml and the GitHub Action workflow file to use your own username (e.g. someuser/dbt-transform-example)
  • Run the workflow manually

Local development with the Splitgraph engine

$ cat ~/.dbt/profiles.yml 
splitgraph:
  outputs:
    prod:
      dbname: splitgraph
      host: 127.0.0.1
      pass: password
      port: 6432
      schema: dbt_transform_example
      threads: 32
      type: postgres
      user: sgr
  target: prod
  • Set up the dataset: sgr clone trase/supply-chains:latest && sgr checkout --layered trase/supply-chains:latest
  • Run dbt: dbt build
  • The resultant model will be in dbt_transform_example.top_exporter_metrics. You can connect to the engine with a normal PostgreSQL client by running psql $(sgr config -n).

About

Example of a dbt transform on Splitgraph Cloud with Github Actions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published