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

Easy data querying from SQL #299

Open
davenquinn opened this issue Jun 23, 2022 · 0 comments
Open

Easy data querying from SQL #299

davenquinn opened this issue Jun 23, 2022 · 0 comments

Comments

@davenquinn
Copy link
Collaborator

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant