All Projects → henriblancke → dbt-formatter

henriblancke / dbt-formatter

Licence: MIT license
Formatting for dbt jinja-flavored sql

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to dbt-formatter

sf
Simple Bash framework which provides argument parsing, usage output and text formatting variables
Stars: ✭ 16 (-56.76%)
Mutual labels:  formatting
fantomas-for-vs
Visual Studio Formatter for F#
Stars: ✭ 43 (+16.22%)
Mutual labels:  formatting
Golite
Add essential language support for the Go language to Sublime Text 3.
Stars: ✭ 14 (-62.16%)
Mutual labels:  formatting
prettysize-rs
Pretty-print file sizes and more
Stars: ✭ 29 (-21.62%)
Mutual labels:  formatting
biguint-format
Node.js module to format big uint numbers from a byte array or a Buffer
Stars: ✭ 16 (-56.76%)
Mutual labels:  formatting
laravel-formatters
«‎Formatter» pattern for Laravel
Stars: ✭ 86 (+132.43%)
Mutual labels:  formatting
jsonfiddle
JSON Fiddling
Stars: ✭ 14 (-62.16%)
Mutual labels:  formatting
gspread-formatting
Complete cell formatting support for Google spreadsheets via gspread package.
Stars: ✭ 121 (+227.03%)
Mutual labels:  formatting
dbt ad reporting
Fivetran's ad reporting dbt package. Combine your Facebook, Google, Pinterest, Linkedin, Twitter, Snapchat and Microsoft advertising spend using this package.
Stars: ✭ 68 (+83.78%)
Mutual labels:  dbt
dbt2looker
Generate lookml for views from dbt models
Stars: ✭ 119 (+221.62%)
Mutual labels:  dbt
metriql
The metrics layer for your data. Join us at https://metriql.com/slack
Stars: ✭ 227 (+513.51%)
Mutual labels:  dbt
international-telephone-input
Integration to Magento 2 a jQuery plugin for entering and validating international telephone numbers.
Stars: ✭ 26 (-29.73%)
Mutual labels:  formatting
ronin-support
A support library for Ronin. Like activesupport, but for hacking!
Stars: ✭ 23 (-37.84%)
Mutual labels:  formatting
dbt-spotify-analytics
Containerized end-to-end analytics of Spotify data using Python, dbt, Postgres, and Metabase
Stars: ✭ 92 (+148.65%)
Mutual labels:  dbt
Textylic
A note taking app developed for the 22nd century
Stars: ✭ 34 (-8.11%)
Mutual labels:  formatting
awesome-python-code-formatters
A curated list of awesome Python code formatters
Stars: ✭ 168 (+354.05%)
Mutual labels:  formatting
dbt ml
Package for dbt that allows users to train, audit and use BigQuery ML models.
Stars: ✭ 41 (+10.81%)
Mutual labels:  dbt
guidelines
Guidelines, patterns, and coding styles
Stars: ✭ 16 (-56.76%)
Mutual labels:  formatting
dbt-sugar
dbt-sugar is a CLI tool that allows users of dbt to have fun and ease performing actions around dbt models
Stars: ✭ 139 (+275.68%)
Mutual labels:  dbt
dbt-airflow-docker-compose
Execution of DBT models using Apache Airflow through Docker Compose
Stars: ✭ 76 (+105.41%)
Mutual labels:  dbt

CircleCI

DBT Formatter

Install

npm install -s dbt-formatter

Usage

import formatter from 'dbt-formatter';

const mySql = "SELECT * FROM {{ ref('myTableRef') }}";
const myOpts = { sql: 'default', indent: 2, upper: false };

formatter.format(mySql, myOpts);

This will result in:

SELECT
  *
FROM
  {{ ref('myTableRef') }}

Usage options

Fine tune dbt-formatter behavior with the following options:

Option Default Description
sql default The sql dialect you want to use, currently only default is available
indent 2 How many spaces you want an indentation to be
upper false Formats sql reserved words to be uppercase when set to true
newline false Appends a new line at the end of the formatted sql string
lowerWords false Lowercases all words as identified by the tokenizer
allowCamelcase true Allows column names to be camelcased

Development

NPM scripts

  • npm test: Run test suite
  • npm start: Run npm run build in watch mode
  • npm run build: Generate bundles and typings, create docs
  • npm run lint: Lints code
  • npm run package: Package dbt-formatter as a binary

Roadmap

  • Add more sql dialects:
    • snowflake
    • redshift
    • bigquery
    • postgres
    • presto
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].