FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

`find`, `find_multi` don't work for unordered composite keys · Issue #192 · google/python-spanner-orm · GitHub

find, find_multi don't work for unordered composite keys #192

Description

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").

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL