我在我为自己的个人聚合器编写的小型网络应用程序中使用了elixir / flask。
我正在尝试创建一个宁静的调用来将特定rssfeed的所有项目标记为已读。
SQL语句看起来像UPDATE model_rssitems set hasbeenseen = 1 where rssfeed_id = '%s' % feedid
我不知道如何编写代码使elixir执行该操作,当我尝试使用session.execute时出现错误UnboundExecutionError: Could not locate a bind configured on SQL expression or this Session
我确定我做错了什么,但我无法弄清楚是什么。
答案 0 :(得分:1)
我假设您尚未使用bind
表达式:)
您的代码需要这样的信息来告诉Elixir
您正在使用的数据库。
from elixir import metadata
metadata.bind = 'sqlite:///your_database_file.sqlite'
metadata.bind.echo = True