Jaymon / prom

A PostgreSQL or SQLite orm for Python
MIT License
22 stars 4 forks source link

Orm.read_only #17

Closed Jaymon closed 4 years ago

Jaymon commented 8 years ago

if you set this to True on a prom.Orm instance it will cause insert() and update() to fail.

I was in a situation where I needed to mimic some production data in the test environment and it would've been nice to just have an added level of WTF just in case I accidentally triggered a change

Jaymon commented 8 years ago

this could actually be deeper, you could put it on the connection url &readonly=1 and it will cause insert, update, and delete queries to fail at the interface level

Jaymon commented 6 years ago

http://initd.org/psycopg/docs/connection.html#connection.readonly