Skip to content

Add SQL support#41

Closed
clrcrl wants to merge 2 commits into
danielchatfield:masterfrom
clrcrl:add-sql-support
Closed

Add SQL support#41
clrcrl wants to merge 2 commits into
danielchatfield:masterfrom
clrcrl:add-sql-support

Conversation

@clrcrl
Copy link
Copy Markdown

@clrcrl clrcrl commented Oct 8, 2018

I use Jinja in my SQL when using open source tool dbt, so have been using a version of this package for my highlighting.

One thing that I'm stuck on is getting Jinja highlighting to work within round braces (()), for example, the Jinja in the common table expression does not get highlighted:

with order_payments as (
  select
  order_id
  {% for payment_method in payment_methods -%}
  , sum(case when payment_method = '{{payment_method}}' then amount else 0 end) as {{payment_method}}_amount
  {% endfor -%}
  from {{ ref('base_payments') }}
  group by 1
)
select
*
from order_payments

I suspect that this line is the culprit – any ideas on how to get around it?

@clrcrl
Copy link
Copy Markdown
Author

clrcrl commented Oct 8, 2018

Never mind, just saw #37 and #33

@clrcrl clrcrl closed this Oct 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant