wwl
wwl

Reputation: 2065

Can DataGrip iterate through CSV files?

I'm using DataGrip and need to do multiple queries of the following format:

SELECT * FROM table WHERE id = '01345' AND date = '01-01-2020'

For each query, the id and date are different. I have a CSV file with many rows, each row containing a different id and date. Is there a way to get DataGrip to iterate through the CSV file and execute all required queries, and save each output as a CSV file (all outputs combined as a single CSV file would also suffice)?

Upvotes: 0

Views: 1383

Answers (1)

Vasilii Chernov
Vasilii Chernov

Reputation: 1464

There is no one step solution. But here what I would do:

  1. Import CSV file into a table in a temporary in-memory database, e.g. H2
  2. Write your custom extractor, see examples by @moscas

Additionally, see DataGrip blog posts about export and extractors:

Upvotes: 1

Related Questions