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

Create sqlite query to get the image data #2

Open
srietkerk opened this issue Jan 16, 2023 · 2 comments
Open

Create sqlite query to get the image data #2

srietkerk opened this issue Jan 16, 2023 · 2 comments

Comments

@srietkerk
Copy link
Contributor

To populate the page with all of the right data for the guesser, we need to make the right query to get the data from all of the tables.

@bglossner
Copy link
Contributor

The query will look like:

with daily_game as (
   select * from DailyGame where date = <date-str>
),
all_image_counts as (
   select * from ImageCountInstance as ici
   inner join daily_game as dg
   where ici.imageId = dg.imageId
)
select * from Image
inner join
all_image_counts as aic
where
Image.id = aic.imageId

@bglossner
Copy link
Contributor

Would be cool to make a SQL view for this but that's not available unfortunately yet: prisma/prisma#678

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

2 participants