Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mechanism for displaying summary of m2m relationships in rows on table view #484

Open
simonw opened this issue May 23, 2019 · 1 comment

Comments

@simonw
Copy link
Owner

simonw commented May 23, 2019

Part of #354 (m2m support)

It would be fantastic if rows that are part of a m2m relationship could display it in an additional column in the table view.

It might look something like this: https://russian-ira-facebook-ads.datasettes.com/russian-ads-919cbfd/display_ads?_search=black+lives+matter

russian-ads__display_ads__50_rows_where_where_search_matches__black_lives_matter_

That example was achieved using a custom SQL query and datasette-json-html - but I'd like this to be a built-in feature instead.

@simonw
Copy link
Owner Author

simonw commented May 23, 2019

Ideally we would display a limited number of m2m related records with a "..." if there are more than our limit. I could also show a count of the total number of records, but this would have to be agressively time-limited or it could cause extremely poor performance.

This could be implemented as a SQL query for every displayed row, taking advantage of Many Small Queries Are Efficient In SQLite. Provided that SQL runs against an index this should be fast to display even on a table with hundreds of rows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant