Another template-related question (see above), if ...
# modules
m
Another template-related question (see above), if I'd like a module to provide a templated SQL or similar query from a file, how might that work? Specifically, I'd rather the SQL be in a separate file, not a groovy string in
main.nf
. E.g. not like this https://github.com/heuermh/nf-core-modules/blob/dshbio-fastatoparquet/modules/nf-core/seqkit/fastatoparquet/main.nf#L27 Will look for examples . . .
a
I am not overly familiar with
duckdb
but is there a better way of providing queries on the CLI than a plain text string like that? It’s an sql injection attack risk (albeit I think this is only in-memory)
m
Suggestions welcome 😅 In this case
duckdb
is reading from stdin via a pipe, otherwise I might wrap it in python/polars/jdbc etc. to limit access to the query. It might be possible to use prepared statement(s) to limit damage via template value injection and be more clever on the groovy side?
e
I want a
duckdb
shebang
You can pass it a sql file with
-f
I think we're just going to have to make a
duckdb:
directive like I've always wanted
m
Interesting! That would run on the JVM on the head node though, similar to the sql nextflow plugin?
e
No it wouldn't in my mind, it would be a process. But I thought about it for a few minutes, I think if we came up with a shebang it would be way more generally useful to people
🤔 1