Conventions

A handful of small rules apply across every GDQL statement. Learn them once and the rest of the language reads like English.


Case

Keywords and identifiers are case-insensitive. Write whichever style you find readable — SHOWS, shows, and Shows all parse identically. The convention in these docs is uppercase keywords because they stand out from song names, but the parser doesn’t care.

SETLIST FOR 5/8/77;
▶ Try it in sandbox →
setlist for 5/8/77;
▶ Try it in sandbox →
Shows From 1977 Limit 5;
▶ Try it in sandbox →

String literals (song names, venue names) keep whatever case you typed inside the quotes — but the lookup itself is also case-insensitive, so "dark star" and "DARK STAR" find the same song.


Strings

Wrap string literals in double quotes. Use them for song titles, venue names, city names, guest musicians — anything that isn’t a number, date, or keyword.

PERFORMANCES OF "Eyes of the World";
▶ Try it in sandbox →
SHOWS AT "Winterland";
▶ Try it in sandbox →
SHOWS WHERE PLAYED "Scarlet Begonias";
▶ Try it in sandbox →

Single quotes work too. They’re handy when shell escaping gets ugly:

gdql 'SHOWS WHERE PLAYED "Scarlet Begonias"'

GDQL is forgiving about punctuation and exact spelling — "Help on the Way!" and "Help on the Way" resolve to the same song, and apostrophes in titles like "Franklin's Tower" work as written. Specifically, song lookup will:

  • Strip apostrophes — "Truckin" finds "Truckin'"
  • Strip periods — "St Stephen" finds "St. Stephen"
  • Normalize spacing — "Wharfrat" finds "Wharf Rat"
  • Expand Saint to St."Saint Stephen" finds "St. Stephen"
  • Tolerate trailing exclamation marks and other punctuation

When you can’t remember a title, run SONGS ORDER BY NAME or SONGS WITH LYRICS("...") to find the canonical form.


Comments

Line comments start with -- and run to the end of the line. Use them to label queries you’re sharing or to leave notes in saved files.

SETLIST FOR 5/8/77;
▶ Try it in sandbox →

Trailing comments work too:

SHOWS FROM 1977;             -- Europe '77 + Cornell year SONGS WITH LYRICS("rose");   -- the rose songs
▶ Try it in sandbox →

Comments work in multi-statement blocks too — handy for labeling each query in a batch:

-- Cornell '77 and the next two nights
SETLIST FOR 5/7/77;
SETLIST FOR 5/8/77;  -- the famous one
SETLIST FOR 5/9/77;
▶ Try it in sandbox →

There is no block comment syntax. If you need to comment out several lines, prefix each one with --.


Statement termination

Semicolons end statements but are optional for a single query. Use them whenever you want to chain multiple queries into one input.

SETLIST FOR 5/8/77
▶ Try it in sandbox →

When you have more than one query, separate them with ;:

SHOWS FROM 1977 LIMIT 5;
▶ Try it in sandbox →
SETLIST FOR 5/8/77;
▶ Try it in sandbox →
SONGS WITH LYRICS("train");
▶ Try it in sandbox →

The CLI runs each statement in order and prints the results back-to-back.

Try in Sandbox


Whitespace

Whitespace exists for readability. Spaces, tabs, and newlines are interchangeable wherever they’re allowed, but at least one whitespace character must separate adjacent tokens — SHOWS WHERE is valid, SHOWSWHERE is not.

Indent and break long queries however you like:

SHOWS AT "Winterland" FROM 1977-1978 WHERE "Scarlet Begonias" > "Fire on the Mountain" AND PLAYED "Estimated Prophet" ORDER BY DATE LIMIT 10;
▶ Try it in sandbox →

Quick summary

ConventionRule
CaseCase-insensitive — keywords, identifiers, song lookups
StringsDouble quotes "..." (single quotes also work)
Comments-- to end of line; no block comments
Statement endOptional ;; required between multiple statements
WhitespaceRequired between tokens; indentation is free
IN aliasIN works as an alias for FROM everywhere (e.g. SHOWS IN 1977)
Singular formsSHOW (singular) works the same as SHOWS
LIMIT capLIMIT is silently capped at 1000
Smart quotesCurly quotes (\u201c \u201d) are accepted — useful for copy-paste from Word or PowerShell
ASCExplicit ascending order (default when ORDER BY is used without DESC)

Next up: read WHERE conditions for filtering, or Operators for the full token list.