I'm writing a Javascript library, and I'd like to be able to run it through some tool that will
到目前为止,我找不到这样的东西。真的不存在吗?
先前研究:
我有一个Postgres表,其中有2600万行,我想添加一个索引的布尔列。
有没有一种方法可以计算出要在生产中尝试这种操作之前需要花费多长时间?
我正在使用 SQLAlchemy 表达式语言(而不是 ORM),并且我正在尝试弄清楚如何更新查询结果。
我发现 RowProxy 对象不支持赋值,AttributeError而是抛出一个:
# Get a row from the table
row = engine.execute(mytable.select().limit(1)).fetchone()
# Check that `foo` exists on the row
assert row.foo is None
# Try to update `foo`
row.foo = "bar"
AttributeError: 'RowProxy' object has no attribute 'foo'
Run Code Online (Sandbox Code Playgroud)
我找到了这个解决方案,它使用了 ORM,但我特别希望使用表达式语言。
我还找到了这个解决方案,它将行转换为字典并更新字典,但这似乎是一个hacky 解决方法。
所以我有几个问题: