question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a Prisma Ignore file to ignore certain tables

See original GitHub issue

Problem

In our project we have temporary tables for daily logs before they’re offloaded to file storage at the end of the day. Right now, when we do prisma db pull, it pulls those tables into the prisma schema as well even though we don’t really care about those tables in code. These tables are created and dropped at the beginning and end of each day.

Suggested solution

We could have a .prismaignore or something file where we can specify a list of relations/items to be ignored when introspecting (and maybe migrating etc too? I haven’t tried using prisma migrate so I’m not sure). All of our these types of tables have a consistent naming scheme where it’s <tableName>-<todaysDate> format so we can use regex to distinguish those tables.

Alternatives

I think this is a pretty clean solution tbh, I can’t think of any other solutions off the top of my head.

Additional context

N/A

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
onuralpbicercommented, Mar 14, 2022

@janpio No absolutely, I know. I was just thinking out loud (well, over text) that the workarounds might indeed be useful, I did not mean it in a way to imply you were forcing me to use it that way. Apologies if it came across that way.

And thanks, I will do that.

0reactions
janpiocommented, Mar 14, 2022

All good, just wanted to make sure you heard what I said and it seems oyu did 👍 Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Excluding fields - Prisma
This page explains how to exclude sensitive fields from Prisma Client. ... create a function that you can use to exclude certain fields...
Read more >
Prisma schema API (Reference)
One way to do so is by creating a .env file with the following contents. Note that the file must be in the...
Read more >
What is introspection? (Reference) - Prisma
If your goal is to exclude certain models from the Prisma Client generation, you can add the @@ignore attribute to the model definition...
Read more >
Prisma CLI Command Reference
You can get additional help on any of the prisma commands by adding the --help flag after the command. Exit codes. All prisma...
Read more >
Filtering and sorting (Concepts) - Prisma
To use case-insensitive filtering, add the mode property to a particular filter ... To use this feature, in the generator block of your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found