Query your existing excel, csv files etc directly via sql queries.
GitHub RepoImpressions810

Query your existing excel, csv files etc directly via sql queries.

@the_ospsPost Author

Project Description

View on GitHub

Query Your CSV and Excel Files with SQL? Yes, Please.

If you've ever found yourself writing a custom Python script just to filter a massive CSV file, or manually sifting through an Excel spreadsheet to find specific data, you know the pain. There's a better way. What if you could just query these files directly using SQL, the language you already know for asking data questions?

That's exactly what filesql does. It's a simple, single-binary tool that lets you run SQL queries directly on your local data files like CSV, Excel, and more. No database setup, no complex imports—just instant SQL on your existing files.

What It Does

filesql is a command-line tool written in Go that creates a temporary, in-memory SQL database from your structured data files. You point it at a file, write a SQL query, and it handles the rest. It automatically infers the schema and lets you use the full power of SQL to SELECT, JOIN, and WHERE your way to the data you need.

Why It's Cool

The beauty of filesql is in its straightforward utility. It's not trying to be a massive ETL platform; it's a sharp, focused tool for a common problem.

  • Zero Setup: There's no server to configure or database to initialize. You download the binary and you're ready to query.
  • File Format Flexibility: It works with a variety of common file types: CSV, TSV, Excel (.xlsx), and even JSON.
  • It's a Time Machine for Your Data: Got an old data export you need to analyze quickly? Instead of loading it into a database or wrestling with a spreadsheet, you can query it in seconds. It's perfect for one-off data analysis, quick reporting, or just exploring a dataset you've been sent.
  • Developer-Friendly CLI: The tool is designed for the terminal. It fits perfectly into your existing workflow, whether you're piping data to other commands or just running a quick query.

How to Try It

Getting started is as simple as it gets.

  1. Install the binary. You can grab the latest release for your OS from the GitHub releases page. Alternatively, if you have Go installed, you can use:

    go install github.com/nao1215/filesql@latest
    
  2. Run a query. The basic command structure is intuitive. Let's say you have a users.csv file and want to find everyone from London:

    filesql query -f users.csv "SELECT * FROM data WHERE city = 'London'"
    

    That's it. The tool will parse the file, create a table named data, run your query, and print the results neatly to your console.

For more examples and the full list of command-line options, check out the project's GitHub repository.

Final Thoughts

filesql is one of those tools that instantly feels like it should have been in your toolbox all along. It elegantly solves a small but frequent annoyance for developers, data analysts, and sysadmins. It won't replace your production database, but for quick data slicing and dicing on local files, it's hard to beat. Next time you're handed a CSV and asked to "find something interesting," you'll know what to do.


Follow us for more cool projects: @githubprojects

Back to Projects
Project ID: 1990395373651685433Last updated: November 17, 2025 at 12:23 PM