sqlalchemy cursor error during yield_per

后端 未结 3 692
不思量自难忘°
不思量自难忘° 2020-12-18 22:08

I am getting the following error:

Traceback (most recent call last):
    main()
    for item in session.query(Item).yield_per(10):
    fetch = cursor.fetchma         


        
3条回答
  •  眼角桃花
    2020-12-18 23:01

    Another option would be to use the cursor option "WITH HOLD", when it gets into an sqlalchemy release: https://bitbucket.org/zzzeek/sqlalchemy/issues/3667/support-postgresqls-with-hold-cursor

    Note the caveat Scott mentions about Postgres materializing cursors on first commit.

提交回复
热议问题