Index - Contents - Home

Chess Query Language

CQL is a powerful query language which allows for a huge variety of searches. It differs from normal Scid searches in that it can also add detailed comments to matching games.

Quick and powerful position searches can be done by marking squares with Shift+Click (full square), then opening the CQL search dialog.

Because of CQL's cryptic nature, adding comments is restricted to the clipbase, and must be enabled with Allow Comments.

When comments are enabled in the clipbase, all matching positions will be annotated with MATCH. These comments can be removed in subsequent searches by enabling Strip Match Comments. Additionally, some CQL filters and keywords (esp. silent), will over-ride these buttons. Other CQL commands also allow for other comments to be added and for processing of variations. These additional comments will *not* be removed with the Strip button, and neither does stripping remove any comments from variations.

It's worth noting that for many simple CQL searches, the equivalent native Scid search (header, material, pattern, etc) will be much faster. CQL is not optimized for trivial queries - though it is more powerful of course - and as a result complex searches can be very slow.

Thanks go to Lewis Stiller and Gady Costeff for their innovative work on CQL.
Fairly technical documentation for their language can be found at their CQL site

Examples

Technical

This feature is not mature; it leaks memory, is not terribly re-entrant (some errors will make future searches broken until ScidvsPC is restarted), and can choke on games with null move.

Some error messages will be shown in the status bar, others in more detail on the command line (Linux and OS X only). For developers, more information can be had by setting the variables CqlShowLex, CqlShowParse, and CqlDebug in tkscid.cpp.

A few CQL keywords which are non-sensical in an Scid context, have null effect. The CQL header params input and output are obvious candidates, likewise the CQL header will now generally be empty cql() , unlike the standalone CQL executable. The sort filter has been disabled for the time being, though may be implemented later.