aixchess

Effizientes Abfragen großer Schachpartiensammlungen

Maintainer: thomas-daniels

Installation und Laden

INSTALL aixchess FROM community;
LOAD aixchess;

Beispiel

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

Über aixchess

Aix ermöglicht das effiziente Speichern und Abfragen großer Schachpartiensammlungen. Die Züge einer Partie sind binär kodiert; diese Erweiterung stellt Skalarfunktionen bereit, um diese Partien direkt in DuckDB zu dekodieren und abzufragen.

Weitere Details finden Sie im GitHub-Repository oder im Blogbeitrag.

Hinzugefügte Funktionen

function_name function_type description comment examples
board_at_position scalar Returns the board at a given position as a struct. NULL NULL
clocks_to_move_times scalar Transform clocks (of one player) into move times, given the clock times and increment. NULL NULL
eval_to_centipawns scalar Returns eval if it is a centipawn evaluation, NULL if mate. NULL NULL
eval_to_mate scalar Returns moves to mate if eval is mate, NULL if centipawn evaluation. NULL NULL
fen_at_position scalar Returns the FEN at a given position. NULL NULL
matches_subfen scalar Returns true if any position matches a given sub-FEN. NULL NULL
move_details scalar Returns a list of details for all moves in the game. NULL NULL
move_details_at scalar Returns the details of a given move in the game. NULL NULL
moved_pieces scalar Returns the moved pieces in order as a string. NULL NULL
moved_pieces_list scalar Returns the moved pieces in order as a list. NULL NULL
piece_counts_at_position scalar Returns the piece counts at a given position. NULL NULL
pieces_at_position scalar Returns the squares where the pieces are at a given position. NULL NULL
recompress scalar Recompresses a game at a given compression level. NULL NULL
scoutfish_query scalar Returns true if a game matches a Scoutfish query. NULL NULL
scoutfish_query_plies scalar Returns the list of plies matching a Scoutfish query. NULL NULL
time_control_lichess scalar Returns the Lichess time control name for given initial time and increment. NULL NULL
to_pgn scalar Represents the game as a PGN string. NULL NULL
to_uci scalar Represents the game as a UCI string. NULL NULL
winning_chances_lichess scalar Converts an evaluation to winning chances using the Lichess formula. NULL NULL
list_eval_to_centipawns macro Apply eval_to_centipawns to all items in a list. NULL NULL
list_eval_to_mate macro Apply eval_to_mate to all items in a list. NULL NULL
list_winning_chances_lichess macro Apply winning_chances_lichess to all items in a list. NULL NULL
is_valid_movedata scalar NULL NULL NULL
clocks_to_move_times__check_nulls scalar NULL NULL NULL
matches_fen scalar NULL NULL NULL
move_details_ext scalar NULL NULL NULL
move_details_ext_at scalar NULL NULL NULL

Überladene Funktionen

Diese Erweiterung fügt keine Funktionsüberladungen hinzu.

Hinzugefügte Typen

Diese Erweiterung fügt keine Typen hinzu.

Hinzugefügte Einstellungen

Diese Erweiterung fügt keine Einstellungen hinzu.