Skip to content

Conversation

princed
Copy link
Contributor

@princed princed commented Jun 11, 2024

Hi Ali, thanks for this tool! It seems to be the only one of its kind I was able to find.

There a little inaccuracy in the README that took me some time to figure out: according to text/template docs interpolation need a dot in front, otherwise it's considered function call, which is consistent with an error I was getting

level=error name=pdd ts=2024-06-11T06:55:15.90434Z caller=main.go:168 error="template: query:1: function \"id\" not defined"

when using the following manifest:

vars:
  id: "id = 'abc'"

tables:
  - table: entity
    query: "SELECT * FROM entity WHERE {{id}}"

Changing it to {{.id}} fixed the problem.

@aweris
Copy link
Owner

aweris commented Jul 1, 2024

Hey, thank you for your kind words. It's wonderful if it helped you even a little bit.

@aweris aweris merged commit ed5d140 into aweris:master Jul 1, 2024
@princed princed deleted the readme-template-fix branch July 1, 2024 22:41
@princed princed mentioned this pull request Jul 1, 2024
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.

2 participants