Can SQLAlchemy be used with Google Cloud SQL?

前端 未结 4 1686
一生所求
一生所求 2020-12-01 05:13

I\'ve looked over Google Cloud SQL\'s documentation and various searches, but I can\'t find out whether it is possible to use SQLAlchemy with Google Cloud SQL, and if so, wh

4条回答
  •  鱼传尺愫
    2020-12-01 05:50

    it is doable, though I haven't used Flask at all so I'm not sure about establishing the connection through that. I got it working through Pyramid and submitted a patch to SQLAlchemy (possibly to the wrong repo) here:

    https://bitbucket.org/sqlalchemy/sqlalchemy/pull-request/2/added-a-dialect-for-google-app-engines

    That has since been replaced and accepted into SQLAlchemy as

    http://www.sqlalchemy.org/trac/ticket/2484

    I don't think it's made it way to a release though.

    There are some issues with Google SQL throwing different exceptions so we had issues with things like deploying a database automatically. You also need to disable connection pooling using NullPool as mentioned in the second patch.

    We've since moved to using the datastore through NDB so I haven't followed the progess of these fixes for a while..

提交回复
热议问题