0
私はTornadoとPostgresを使用しています。私はプログラム中にリストに追加されたいくつかのクエリ(4または5)を持っており、今度はそれらを一度にすべて実行したいと思います!私はこのコードを実行リストから複数のクエリを一度にPythonで実行するには?
:
yield self.db.execute(''.join(queries)).result()
"クエリ" のクエリのリストがあり、私は私がしたエラーを得た実行しようとした
!
これは私の接続プールともTonadoの設定です:
ioloop = IOLoop.instance()
application.db = momoko.Pool(
dsn='dbname=xxx user=xxx password=xxxx host=x port=xxxx'
size=xx,
ioloop=ioloop,
)
# this is a one way to run ioloop in sync
future = application.db.connect()
ioloop.add_future(future, lambda f: ioloop.stop())
ioloop.start()
future.result() # raises exception on connection error
http_server = HTTPServer(application)
http_server.listen(8888, 'localhost')
ioloop.start()
"yield self.db.execute( ''。join(queries))。result()"私は "yield queries"を実行しました。あなたが説明したように "append(self.db.execute(....) – Nikito