We need easier ways to query the database without doing a ton of joins.
Something like this, but for datums and attributes.
--CREATE OR REPLACE VIEW sparrow_views.all_data AS
SELECT
*
FROM datum d
JOIN datum_type dt
ON dt.id = d.type
JOIN analysis a
ON a.id = d.analysis
JOIN session s
ON s.id = a.session_id
JOIN sample sa
ON sa.id = s.sample_id
JOIN sample_researcher sr
ON sr.sample_id = s.id
JOIN researcher r
ON r.id = sr.researcher_id;
-- Also want attributes
We need easier ways to query the database without doing a ton of joins.
Something like this, but for datums and attributes.