feat(website): joins cast on the querying-with-joins guide
Fourth cast: build a minimal two-table schema with rows, switch to advanced mode (`mode advanced`), and run a join pairing each book with its author — shows the mode switch + SQL + multi-table result, motion that complements the guide's static examples. Convert the guide to .mdx and embed above the intro. Recorded via `pnpm casts`; build clean (25 pages).
This commit is contained in:
@@ -17,6 +17,34 @@
|
||||
|
||||
/** The shared library narrative, trimmed per cast. */
|
||||
export const casts = [
|
||||
{
|
||||
name: 'joins',
|
||||
title: 'Switch to advanced mode and join across tables',
|
||||
width: 90,
|
||||
height: 26,
|
||||
typeSpeed: '42ms',
|
||||
steps: [
|
||||
{ wait: 900 },
|
||||
// minimal two-table schema + a few rows to join
|
||||
{ type: 'create table authors with pk author_id(serial)', after: 650 },
|
||||
{ type: 'add column to authors: name (text)', after: 650 },
|
||||
{ type: 'create table books with pk book_id(serial)', after: 650 },
|
||||
{ type: 'add column to books: title (text)', after: 650 },
|
||||
{ type: 'add column to books: author_id (int)', after: 800 },
|
||||
{ type: "insert into authors (name) values ('Ursula K. Le Guin')", after: 600 },
|
||||
{ type: "insert into authors (name) values ('Italo Calvino')", after: 700 },
|
||||
{ type: "insert into books (title, author_id) values ('A Wizard of Earthsea', 1)", after: 600 },
|
||||
{ type: "insert into books (title, author_id) values ('The Left Hand of Darkness', 1)", after: 600 },
|
||||
{ type: "insert into books (title, author_id) values ('Invisible Cities', 2)", after: 900 },
|
||||
// switch to SQL and join
|
||||
{ type: 'mode advanced', after: 1200 },
|
||||
{
|
||||
type: 'select authors.name, books.title from books join authors on books.author_id = authors.author_id order by authors.name',
|
||||
after: 2600,
|
||||
},
|
||||
{ type: 'quit', after: 400 },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'relationship-diagram',
|
||||
title: 'Declare a relationship and see it drawn',
|
||||
|
||||
Reference in New Issue
Block a user