google / google/python-spanner-orm

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

Abierto
#192 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
41
Forks
17
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.