Introduction

Snippets let you share small, reusable bits of SQL with your team.

Demo

https://youtu.be/KwUyIdkBPt0

Creating your first Snippet

To create a snippet hit command / ctrl + k → "Create snippet"

Working with dates is a great example, check out this snippet we use at SeekWell which creates three date formats from a timestamp

date_trunc('day', {{column_name}})::date as "{{alias}}_day",
date_trunc('week', {{column_name}})::date as "{{alias}}_week",
date_trunc('month', {{column_name}})::date as "{{alias}}_month"

Once you type {{ you'll see the variable added to "Defaults". Here you can add a commonly used value for the variable (e.g. created_on).

<aside> 💡 Variables are optional, not adding variables will create a "static snippet"

</aside>

Navigation

Library

SnippetLibrary

Suggest a snippet here.

Other resources to jump start