【发布时间】:2020-04-20 22:51:56
【问题描述】:
当使用 Flask / sqlAlchemy 从我的 sqlite 数据库中选择行时:
Restaurants.index.in_(filtered_res_ids))).fetchall())
我在 pycharm 中测试时得到了我想要的结果。 但是,当将它部署到我的 AWS 弹性豆茎时,它给我带来了问题。
这是我的一些错误日志:
[Mon Dec 23 18:23:28.956847 2019] [:error] [pid 3451] WHERE restaurants_image_price_english."index" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ... )
[2019-12-23 18:23:28,958] ERROR in app: Exception on /restaurantDiscover [POST]
Traceback (most recent call last):
File "/opt/python/run/venv/local/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
cursor, statement, parameters, context
File "/opt/python/run/venv/local/lib64/python3.6/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: too many SQL variables
我应该使用不同的实现吗?
【问题讨论】:
标签: python sqlite flask sqlalchemy amazon-elastic-beanstalk