Playground¶
HQL runs in this page. A program is checked and evaluated in your browser;
nothing is sent to a server. The vault is the book's
reading club: cards, @[[dune]] and the links between them
are there to query.
Press Run, or Ctrl+Enter.
A typed query
type Book { title : String, year : Int, rating : Int }
books = [
Book(title = "Dune", year = 1965, rating = 5),
Book(title = "Emma", year = 1815, rating = 3),
Book(title = "Beloved", year = 1987, rating = 4),
]
books
| filter(b => b.rating >= 4)
| sort(b => b.title)
| map(b => b.title)
A contract refuses a value
type Book { title : String, year : Int, rating : Int }
books = [
Book(title = "Dune", year = 1965, rating = 5),
Book(title = "Emma", year = "1815", rating = 3),
]
books | map(b => b.title)
The vault: books still to read
cards
| filter(c => c.metadata.status == "todo")
| sort(by = c => c.title)
| map(c => c.title)
The vault: one card
@[[dune]].title
The vault: authors as Markdown
cards | filter(c => c.metadata.category == "author") | markdown
What runs here¶
The language, the standard library and SQLite, in memory. A program that
names a server (a postgres, kafka, nats or spark endpoint, or a
URL) checks, and fails where it would connect: those run in the
hql-demo repository. Files on your
machine are not read.