--crossdb option for joining across databases (#1232)

* Test for cross-database join, refs #283
* Warn if --crossdb used with more than 10 DBs, refs #283
* latest.datasette.io demo of --crossdb joins, refs #283
* Show attached databases on /_memory page, refs #283
* Documentation for cross-database queries, refs #283
This commit is contained in:
Simon Willison 2021-02-18 14:09:12 -08:00 committed by GitHub
commit 6f41c8a2be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 215 additions and 8 deletions

View file

@ -115,6 +115,8 @@ class DatabaseView(DataView):
links.extend(extra_links)
return links
attached_databases = [d.name for d in await db.attached_databases()]
return (
{
"database": database,
@ -139,6 +141,7 @@ class DatabaseView(DataView):
"allow_download": self.ds.setting("allow_download")
and not db.is_mutable
and not db.is_memory,
"attached_databases": attached_databases,
},
(f"database-{to_css_class(database)}.html", "database.html"),
)