1

Is there any way to render a sql template file using the sqlfluff API.

Currently I can render using the command:

sqlfluff render -d <dialect> some_template.sql 

Is there any way for me to switch from above command to python API? (In addition, after running the sqlfluff lint command in the ci/cd code, are the sql template files changed (apply jinja template)) Sorry for my English, thanks.

Sander van den Oord
  • 10,986
  • 5
  • 51
  • 96

1 Answers1

0

The CLI functions can be found here, which includes render:
https://github.com/sqlfluff/sqlfluff/blob/main/src/sqlfluff/cli/commands.py#L1116

The python API currently only seems to contain .lint(), .fix() and .parse() and not .render(): https://github.com/sqlfluff/sqlfluff/blob/main/src/sqlfluff/api/simple.py#L59

Sander van den Oord
  • 10,986
  • 5
  • 51
  • 96