Skip to content

vaal12-go/xlql

Repository files navigation

XLQL (excel SQL)

Overview

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.

Installation

Download an executable for your platform from the releases section.

Basic use

xlql.exe -f file_to_execute.star

Examples

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.

Sin graph

Example 4 shows in memory database creation and iteration via query.get_cursor method.

Command line parameters

See command line parameters

Starlark language

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

SQLite version

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).

API

See API documentation page

Releases

See Releases page

Thanks (libraries used)

Support

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.