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

Audit Logs ? What is the best way to implement them #968

Open
ishaan-jaff opened this issue May 31, 2024 · 0 comments
Open

Audit Logs ? What is the best way to implement them #968

ishaan-jaff opened this issue May 31, 2024 · 0 comments

Comments

@ishaan-jaff
Copy link

ishaan-jaff commented May 31, 2024

Problem

Is there a recommended way to implement audit logs with Prisma Py. I want to audit when certain actions are taken on a specific table

  • example a user edited a value in budgets table. We need to store the value before, after, time, and updated_by

Suggested solution

I'd like to do something like this

Ideally I don't need to search for all the instances in my code where the DB is being written to

prisma_client = PrismaClient(
          database_url=database_url
      )
prisma_client.extend(`tables_to_audit=['budgets', 'models'])

Alternatives

Additional context

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