xlql is a command line utility which aims to enable SQL queries and python like language access to data in Excel files. This is done by exporting Excel data from excel files to sqlite database. SQLite SQL can be used against such data. Export to Excel of resulting data is also supported at the moment.
Download an executable for your platform from the releases section.
xlql.exe -f file_to_execute.star
Super basic Example 1 will just load countries sheet from the Sample HR Database.xlsx and print it's content to console.
Run this example from the directory, which has this Sample HR Database.xlsx file.
Example 2 shows how to run SQL join on Excel data.
Run this example from the directory, which has this Sample HR Database.xlsx file.
Example 3 shows hot data generated by starlark script (Taylor approximation for sin function in range [-3 to 4) ) which is exported to Excel. Then in excel graph of the data was done.
Example 4 shows in memory database creation and iteration via query.get_cursor method.
This application is based on excellent starlark implementation in golang.
To quote from the site above
Starlark is a dialect of Python intended for use as a configuration language.
For complete syntax and specification see Starlark in Go: Language definition
At the moment sqlite version statically linked into executable is 3.46.1 (https://www.sqlite.org/changes.html). This corresponds to github.com/mattn/go-sqlite3 v1.14.23. So modern features of sqlite are supported like - RIGHT and FULL OUTER JOIN (2022). Next release (due June 2024) to be upgraded to latest version of sqlite (as driver (github.com/mattn/go-sqlite3) will allow).
See Releases page
- github.com/qax-os/excelize v2.9.0 If you find this program useful, please support this amazing library and a lot of work to bring Golang world to Excel (and vice versa). Support link.
- go.starlark.net v0.0.0-20231013162135-47c85baa7a64
- github.com/jedib0t/go-pretty/v6 v6.4.8
- github.com/joho/godotenv v1.5.1
- github.com/mattn/go-sqlite3 v1.14.23
Discord of this software: https://discord.gg/tgYGNhpJwz Email for questions/suggestions/issues: [email protected]
Please note that discord is preferred method to reach me regarding this repository/software. Emails I will review sporadically.