psycopg2
psycopg2 copied to clipboard
added helpful executemany & execute_batch examples
hopefully this will make those functions more approachable for newbies. everyone tries it without proper sequences and then has to google.
I would prefer if the style of the examples was canonical (space after the commas etc) and that the single values example was shown with tuples instead of lists (because one-item tuples are a thing that tricks a lot of newcomers).
I'd thought about that but I did not really see a reason why tuples were preferred anyways. I will update it though.
I will make a new PR with those changes.
Deprecated, closing in favor of https://github.com/psycopg/psycopg2/pull/1508