Javascript vs SQL?
Dataform is a platform built on Node.js that helps you template SQL code similarly to how dbt templates SQL with Jinja.
Dataform also allows for the creation and installation of NPM packages that can offer a great deal of standardization.
Since you can use JavaScript (as NPM package or natively), and just plain SQL to provide the final code, it means that you have the option to choose between going full JavaScript, full SQL, or somewhere in between.
We opted for the "SQL as base, JS as helpers" route, since it:
- offers better control
- is easier to adapt/copy
- allows for a great deal of customization for users
- is more clear and usable for analysts who work mostly with SQL
We still use a lot of JavaScript, but mostly to have a config that lets you customize your setup and for helper functions that make the SQLX files more readable and maintainable.