XLite - query Excel (.xlsx, .xls) and Open Document spreadsheets (.ods) as SQLite virtual tables

Overview

XLite - query Excel (.xlsx, .xls) and Open Document spreadsheets (.ods) as SQLite virtual tables

XLite is a SQLite extension written in Rust. The main purpose of this library is to allow working with spreadsheets from SQLite exposing them as virtual tables.

Download

build

The following prebuilt libraries are available for download

Linux Windows MacOS
x86 libxlite.so.tar.gz xlite.dll.zip N/A
x86-64 libxlite.so.tar.gz xlite.dll.zip libxlite.dylib.zip
AArch64

Please contribute the missing build targets if you know how to implement them with GitHub Actions.

How to build

cargo build --release

This step will produce libxlite.so or libxlite.dylib or xlite.dll depending on your operation system.

How to use

Assuming you have sqlite3 command line tools installed, libxlite library in your current directory and some spreadsheet file on your disk you can load extension:

sqlite3 # will open SQLite CLI
> .load libxlite # or "xlite" on Windows

This will load xlite module, now it can be used to create virtual tables.

Creating a virtual table (this sample uses the .xslx file from the tests directory):

CREATE VIRTUAL TABLE test_data USING xlite(
    FILENAME './tests/abcdef.xlsx',
    WORKSHEET 'Sheet1',
    RANGE 'A2:F'
);

Explanation: this statement will create a virtual table based on the .xlsx file and the worksheet named "Sheet1".

Optional RANGE parameter is used here to skip the first row in the table. A2:F meaning is use columns from A to F but start from 2nd row.

Querying:

SELECT A, B, C, D, E, F from test_data;

Columns are named according to their name (index) in the spreadsheet.

SELECT COUNT(*), D FROM test_data GROUP BY D ORDER BY COUNT(*);

All operations supported by SQLite can be executed on spreadsheets as long as it is supported by the virtual table mechanism.

Dropping:

DROP TABLE test_data;

This statement will drop only the virtual table. Physical file won't be deleted.

Limitations

INSERT, UPDATE and DELETE statements are not supported right now.

About

This project is experimental, use at your own risk. The project is developed in my free time as a way to learn Rust and database systems.

You might also like...
🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, SQLite, and MSSQL.

SQLx 🧰 The Rust SQL Toolkit Install | Usage | Docs Built with ❤️ by The LaunchBadge team SQLx is an async, pure Rust† SQL crate featuring compile-tim

🐸Slippi DB ingests Slippi replays and puts the data into a SQLite database for easier parsing.
🐸Slippi DB ingests Slippi replays and puts the data into a SQLite database for easier parsing.

The primary goal of this project is to make it easier to analyze large amounts of Slippi data. Its end goal is to create something similar to Ballchasing.com but for Melee.

A tool for automated migrations for PostgreSQL, SQLite and MySQL.

Models Models is an implementation for a SQL migration management tool. It supports PostgreSQL, MySQL, and SQLite. Quick Start install the CLI by runn

Grsql is a great tool to allow you set up your remote sqlite database as service and CRUD(create/read/update/delete) it using gRPC.

Grsql is a great tool to allow you set up your remote sqlite database as service and CRUD (create/ read/ update/ delete) it using gRPC. Why Create Thi

A Rust-based comment server using SQLite and an intuitive REST API.

soudan A Rust-based comment server using SQLite and an intuitive REST API. Soudan is built with simplicity and static sites in mind. CLI usage See sou

A SQLite extension for quickly generating random numbers, booleans, characters, and blobs

sqlite-fastrandom A SQLite extension for quickly generating random numbers, booleans, characters, and blobs. Not cryptographically secure. Based on sq

Ergonomic bindings to SQLite for Rust

Rusqlite Rusqlite is an ergonomic wrapper for using SQLite from Rust. It attempts to expose an interface similar to rust-postgres. use rusqlite::{para

SQLite clone from scratch in Rust
SQLite clone from scratch in Rust

Rust-SQLite (SQLRite) Rust-SQLite, aka SQLRite , is a simple embedded database modeled off SQLite, but developed with Rust. The goal is get a better u

Some bunch of test scripts to generate a SQLite DB with 1B rows in fastest possible way

To find out the fastest way to create an SQLite DB with 1B random rows.

Comments
  • Thank you!

    Thank you!

    As you might know I have forked your repository and tailored it for Google Sheet (as I've been using it at work.) I just want to say thank you for making the repo and the blog article public. I really enjoyed reading it.

    https://github.com/0x6b/libgsqlite

    opened by 0x6b 2
Releases(v0.1.5)
Owner
Sergey Khabibullin
C#/.NET, Rust and database systems
Sergey Khabibullin
Mycelite is a SQLite extension that allows you to synchronize changes from one instance of SQLite to another.

Mycelite What is Mycelite? Mycelite is a SQLite extension that allows you to synchronize changes from one instance of SQLite to another. Currently, it

Mycelial 16 Jan 2, 2023
Query is a Rust server for your remote SQLite databases and a CLI to manage them.

Query Query is a Rust server for your remote SQLite databases and a CLI to manage them. Table Of Contents Run A Query Server CLI Install Use The Insta

Víctor García 6 Oct 6, 2023
Build SQLite virtual file systems (VFS) by implementing a simple Rust trait.

sqlite-vfs Build SQLite virtual file systems (VFS) by implementing a simple Rust trait. Documentation | Example This library is build for my own use-c

Markus Ast 56 Dec 19, 2022
Command-line tool to make Rust source code entities from Postgres tables.

pg2rs Command-line tool to make Rust source code entities from Postgres tables. Generates: enums structs which can be then used like mod structs; use

Stanislav 10 May 20, 2022
A programmable document database inspired by CouchDB written in Rust

PliantDB PliantDB aims to be a Rust-written, ACID-compliant, document-database inspired by CouchDB. While it is inspired by CouchDB, this project will

Khonsu Labs 718 Dec 31, 2022
RefineDB - A strongly-typed document database that runs on any transactional key-value store.

RefineDB - A strongly-typed document database that runs on any transactional key-value store.

Heyang Zhou 375 Jan 4, 2023
Simple document-based NoSQL DBMS from scratch

cudb (a.k.a. cuda++) Simple document-based noSQL DBMS modelled after MongoDB. (Has nothing to do with CUDA, has a lot to do with the Cooper Union and

Jonathan Lam 3 Dec 18, 2021
A scalable, distributed, collaborative, document-graph database, for the realtime web

is the ultimate cloud database for tomorrow's applications Develop easier. Build faster. Scale quicker. What is SurrealDB? SurrealDB is an end-to-end

SurrealDB 16.9k Jan 8, 2023
A programmable document database inspired by CouchDB written in Rust

BonsaiDb Formerly known as PliantDb. Not yet released on crates.io as BonsaiDb. BonsaiDb aims to be a Rust-written, ACID-compliant, document-database

Khonsu Labs 721 Jan 2, 2023
Simple and handy btrfs snapshoting tool. Supports unattended snapshots, tracking, restoring, automatic cleanup and more. Backed with SQLite.

Description Simple and handy btrfs snapshoting tool. Supports unattended snapshots, tracking, restoring, automatic cleanup and more. Backed with SQLit

Eduard Tolosa 27 Nov 22, 2022