How to easily execute a SQL query against a local dataset

Konstantin Dokuchaev
Konstantin Dokuchaev
How to easily execute a SQL query against a local dataset

dsq utility will help you execute SQL queries on datasets in JSON, CSV, Excel, Parquet and many other formats.

As a tester, I often have to work with data in various formats like .json or .csv. When the data is not in files, but in the database, it is easy to select the necessary information using SQL queries. But what about data in local files?

This is where the dsq utility comes to the rescue which will help you execute SQL queries on datasets in JSON, CSV, Excel, Parquet and many other formats.

For macOS and Linux users, GitHub has detailed instructions for installing and working with it. I will show on the example of Windows how it works.

The first step is to download the binary from the releases page and extract it on your computer. In this case, you must not forget to specify the path to dsqin $PATHyour PC.

Then you just need to execute a SQL query on the command line to the file you need. For example, this way dsq C:\Temp\dsq-win32-x64-0.2.0\123.csv "SELECT * FROM {} WHERE ID_EMIAS = '23621134';"you will immediately get the result.

And here is the same line, but when working with Dbeaver.



Great! Next, complete checkout for full access to All-in-One Person
Welcome back! You've successfully signed in
You've successfully subscribed to All-in-One Person
Success! Your account is fully activated, you now have access to all content
Success! Your billing info has been updated
Your billing was not updated