records
records copied to clipboard
Support "Raw" queries to support things like VACUUM
I've found one use case that was a bit difficult, which is using records to perform routine maintenance. I was able to work around with the following code(sql is a records db):
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
...
vac_conn = sql._engine.raw_connection()
vac_conn.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
vac_curr = vac_conn.cursor()
vac_curr.execute("VACUUM (ANALYZE)")
vac_conn.close()
It would be great to add a raw flag to the query method, or even just have a raw method to be able to call sql outside of transaction blocks.
interesting
I will fix this.
-raw flag is Perfect!!