Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for sql.j2 #3664

Closed
Gregory108 opened this issue Jul 30, 2021 · 1 comment
Closed

Add support for sql.j2 #3664

Gregory108 opened this issue Jul 30, 2021 · 1 comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request

Comments

@Gregory108
Copy link

Gregory108 commented Jul 30, 2021

Developing in DBT means writing in a combination of database-specific SQL dialect and jinja2. At least, VSCode with Better Jinja plugin is able to help with prompts and check syntaxis of both languages simultaneously - iff model file extension is .sql.j2. However, dbt does not recognise such files as model.

Suggestion:

  • make dbt run [-m] work agnostic of anything after .sql extension suffix
@jtcohen6 jtcohen6 added the triage label Aug 2, 2021
@jtcohen6
Copy link
Contributor

jtcohen6 commented Aug 3, 2021

@Gregory108 Thanks for the issue! We've got a very similar one open: #3484, which is in progress in #3498.

The Jinja folks have thrown their weight behind the .jinja file extension, though I understand that .j2 is also a popular choice (docs, stackoverflow conversation).

Personally, I don't have strong feelings about preferring .jinja vs. .j2. I suppose we could support any arbitrary suffix after .sql. dbt does name models based on their file names, and it support dots in model file names today, so I think a model file named models/my.sql.model.sql.j2 would do some surprising things. I think we'd need to consider that an unreasonable edge case, and one we can't hope to support.

In the meantime, I'm going to close this as a duplicate of #3484, which will be doing the heavy lifting. I'd encourage you to leave a comment there if you feel strongly about supporting .sql.j2 in particular (or other extensions in general), in addition to .sql.jinja.

@jtcohen6 jtcohen6 added duplicate This issue or pull request already exists and removed triage labels Aug 3, 2021
@jtcohen6 jtcohen6 closed this as completed Aug 3, 2021
@dbeatty10 dbeatty10 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2024
@dbeatty10 dbeatty10 added the enhancement New feature or request label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants