Skip to content

Using sqldb in processes #4

Answered by pditommaso
KyleStiers asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, the SQL operations added by this plugin are not meant to be used within a process but applied to Nextlfow channels like any other operator.

Therefore, if you want to store into a DB the data produced by a process, you need to apply it to an output channel returned by that process e.g.

process yourTask {
  output: 
   tuple val(foo), val(bar)
  script:
   foo = ..
   bar = ..
   """
   some_command
   """
}

workflow {
  yourTask().sqlInsert(into: 'SAMPLE', columns: 'FOO,BAR', db: 'xyz' )
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@KyleStiers
Comment options

@pditommaso
Comment options

Answer selected by KyleStiers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants