I have several occasions where I want to collect data when in the field. This is in situations where I do not always have access to my postgres database.
To keep things in sync, it would be excellent if I could use psycopg2 functions offline to generate queries that can be held back and once I am able to connect to the database; process everything that is held back.
One thing I am currently struggling with is that the psycopg2 cursor requires a connection to be constructed.
My question is:
Is there a way to use a cursor to do things like mogrify without an active connection object? Or with a connection object that is not connected to a database? I would then like to write the mogrify results temporarily to file so they can be processed later.