with (yield self.pool.Connection()) as conn:
with conn.cursor() as cursor:
rows = yield cursor.execute(sql, tuple(args))
data = cursor.fetchall()
raise Return((rows, data))
执行返回结果为 0, ()
但如果将sql格式化好,不使用args则运行正常。
code
sql = sql % tuple(args)
with (yield self.pool.Connection()) as conn:
with conn.cursor() as cursor:
rows = yield cursor.execute(sql)
data = cursor.fetchall()
code
执行返回结果为 0, ()
但如果将sql格式化好,不使用args则运行正常。
code sql = sql % tuple(args) with (yield self.pool.Connection()) as conn: with conn.cursor() as cursor: rows = yield cursor.execute(sql) data = cursor.fetchall()