Skip to content
DuckDB community extension

aixchess

Efficiently query large chess game collections

01 / SETUP

Install and load

Run these commands in a Haybarn SQL session. The extension is available from the community repository.

Haybarn 2.0.0 · SQL
INSTALL aixchess FROM community;
LOAD aixchess FROM community;

Using upstream DuckDB? Follow the maintainer’s installation instructions.

02 / QUERY

Usage example

Count en passant moves played in Lichess games from January 2013

SQL
-- Count en passant moves played in Lichess games from January 2013

WITH lichess_2013_01 AS (
    FROM 'hf://datasets/thomasd1/aix-lichess-database/low_compression/aix_lichess_2013-01_low.parquet'
),
en_passant_move_count AS (
    SELECT
        SUM(
            move_details(movedata).filter(lambda m: m.is_en_passant).length()
        ) AS nb_ep_moves 
    FROM lichess_2013_01
)

FROM en_passant_move_count;

-- Result: 3496
Reported result

From the publisher’s example

3496

Provided by thomas-daniels. Not yet verified on Haybarn 2.0.0.

Sample data & setup

About this extension

Aix enables efficient storage and querying of large chess game collections. A game's moves are encoded in a binary representation, and this extension provides scalar functions to decode and query these games directly within DuckDB.

Project overview from the community descriptor.

Documentation and resources

Project and build details
Repository
thomas-daniels/aix
License
GPL-3.0
Maintainers
thomas-daniels
Written in
C++
Build source
907b5107601e
Build definition
Community descriptor