What is the difference between these two apis? Which one faster, reliable using Python DB API?
Upd: I see two psql drivers for Django. The first one is psycopg2. What is the second one? pygresql?
What is the difference between these two apis? Which one faster, reliable using Python DB API?
Upd: I see two psql drivers for Django. The first one is psycopg2. What is the second one? pygresql?
psycopg2 is partly written in C so you can expect a performance gain, but on the other hand, a bit harder to install. PyGreSQL is written in Python only, easy to deployed but slower.
Licensing may be an issue for you. PyGreSQL is MIT license. Psycopg2 is GPL license.
(as long as you are accessing psycopg2 in normal ways from Python, with no internal API, and no direct C calls, this shouldn't cause you any headaches, and you can release your code under whatever license you like - but I am not a lawyer).
Psycopg2 doesn't have much documentation but the code in the examples directory is very helpful.
Also it's thread safety level 2, meaning multiple threads can share the module and connections but not the cursors.
python dbi pep