Published
Edited
Jul 29, 2022
2 forks
Importers
6 stars
Insert cell
Insert cell
Insert cell
Insert cell
db = FileAttachment('chinook.db').sqlite()
Insert cell
Insert cell
Insert cell
db
SELECT * FROM sqlite_schema
WHERE type ='table' AND name NOT LIKE 'sqlite_%';
Insert cell
Insert cell
Insert cell
db
SELECT sqlite_master.name as from_table,
fk_info.[from] as from_column,
fk_info.[table] as to_table,
fk_info.[to] as to_column
FROM sqlite_master
JOIN pragma_foreign_key_list(sqlite_master.name) as fk_info
Insert cell
Insert cell
sqliteERDiagram(db)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
tableStatementTree = objectTree(tableStatementAST ? tableStatementAST.statement[0] : {})
Insert cell
Insert cell
Insert cell
duckDB = createDuckDB(db)
Insert cell
duckDB
show tables
Insert cell
duckDB.describeTables()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
duckDBTablesDiagram = duckDBDiagram(duckDB)
Insert cell
Insert cell
duckDB
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more