getSql: Line break within arguments

I have this bad ass short code

<table border="1">
  {{ range $i, $r := getSql "SELECT name,sku,url_path,price  FROM `catalog_product_flat_1` where type_id=\"configurable\" and  price > 350" }}

    {{ if eq $i 0 }}
            <td>{{ index $r "name" }}</td>
            <td>{{ index $r "sku" }}</td>
            <td><a href="/{{ index $r "url_path" }}">{{ index $r "price" }}</a></td>

  {{ end }}

The new feature getSql is available here. For self-compilers: check for build tags for using different drivers.

My problem is that the SQL query itself gets too long. How can I do a line break? Everything I’ve tried makes Hugo panic :frowning:

I would like to have something:

  {{ range $i, $r := getSql "SELECT name,sku,url_path,price 
      FROM `catalog_product_flat_1` 
      WHERE type_id=\"configurable\" and  price > 350" }}

Any ideas?

raw string literals, maybe.

See discussion at

and @bep’s comment

It can be fixed by removing the \n case here:

PRs are welcome.

Neither of them is working. It does not affect the shortcodes.

Go states:

although raw strings may not span newlines.

I have found another solution by using a path to .sql file as an argument. This is not really nice but makes working with SQL more easier.