google / google/python-spanner-orm

`find`, `find_multi` don't work for unordered composite keys

オープン
#192 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
41
フォーク
17
PR マージ指標
30日以内にマージされた PR はありません

説明

Didn't see it anywhere in the docs, so filing this as a bug

When you declare a model with more than one primary key, say

```
class FooModel(spanner_orm.Model):
__table__ = "products"
bar = spanner_orm.Field(spanner_orm.String(), primary_key=True)
baz = spanner_orm.Field(spanner_orm.String(), primary_key=True)
```

If the table's schema is defined having the column `baz` before `bar`, `find_multi` (and therefore also `find`) won't work properly, as the keyset is compound in different order (ie: `Product.find(bar="123", baz="456")` will instead do `Product.find(baz="123", bar="456")`.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。