Doveps / mono

Code for Doveps projects
http://doveps.com
MIT License
0 stars 0 forks source link

02-02-2018 Daily Report #85

Closed JosiahRegencia closed 6 years ago

JosiahRegencia commented 6 years ago

So while waiting for tomorrow's setup, I decided to refactor query.py so that I didn't have to call set_engine_name() for every function.

This is the branch: https://github.com/Doveps/mono/tree/refactor-query

The current problem is that when using psycopg2 I have to explicitly reopen the cursor. Still trying to find a way to not implement it that way. More updates later.

JosiahRegencia commented 6 years ago

Found a way to not repeat calling set_engine_name every time

https://github.com/Doveps/mono/blob/96833a07cd1aa714c29bb0628e816ddeb701b3b9/savant/app/query.py#L29

https://github.com/Doveps/mono/blob/96833a07cd1aa714c29bb0628e816ddeb701b3b9/savant/app/query.py#L44

and more.

But the thing is, I don't close the psycopg2 cursor and connection. Not sure if that's good practice or not. Still reviewing.