RobertCraigie / prisma-client-py

Prisma Client Python is an auto-generated and fully type-safe database client designed for ease of use
https://prisma-client-py.readthedocs.io
Apache License 2.0
1.85k stars 81 forks source link

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

Open ishaan-jaff opened 4 months ago

ishaan-jaff commented 4 months ago

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

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