From 7806fc736a2ebce304452b1a9fd595894cddfa8f Mon Sep 17 00:00:00 2001 From: Federico Di Gregorio Date: Tue, 9 Oct 2018 00:00:12 +0200 Subject: Sandbox removed The sandbox directory was there to test issues before we had full test coverage and to try quick and dirty Python snippets before moving them to the examples directory, sending them to mailing list or copying them to the docs. Almost anything that was in sandbox is now in the examples directory or has been refactored into a full test, or is so old that is of no use anymore. So, adieu sandbox. --- sandbox/async.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 sandbox/async.py (limited to 'sandbox/async.py') diff --git a/sandbox/async.py b/sandbox/async.py deleted file mode 100644 index 3ddaa3a..0000000 --- a/sandbox/async.py +++ /dev/null @@ -1,35 +0,0 @@ -import datetime -import time -import psycopg2 - -#d = datetime.timedelta(12, 100, 9876) -#print d.days, d.seconds, d.microseconds -#print psycopg.adapt(d).getquoted() - -conn = psycopg2.connect("dbname=test_unicode") -conn.set_client_encoding("xxx") -curs = conn.cursor() -#curs.execute("SELECT 1.0 AS foo") -#print curs.fetchmany(2) -#print curs.fetchall() - -def sleep(curs): - while not curs.isready(): - print(".") - time.sleep(.1) - -#curs.execute(""" -# DECLARE zz INSENSITIVE SCROLL CURSOR WITH HOLD FOR -# SELECT now(); -# FOR READ ONLY;""", async = 1) -curs.execute("SELECT now() AS foo", async=1) -sleep(curs) -print(curs.fetchall()) - -#curs.execute(""" -# FETCH FORWARD 1 FROM zz;""", async = 1) -curs.execute("SELECT now() AS bar", async=1) -print(curs.fetchall()) - -curs.execute("SELECT now() AS bar") -sleep(curs) -- cgit v1.2.1