Broken aiopg.sa.RowProxy unpacking
Aberta
- Linguagem predominante
- Python
- Estrelas
- 1.4k
- Forks
- 170
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
So RowProxy doesn't behave like the SQLAlchemy one, I find it really misleading.
```entry = {
'dtid': dtid,
'username': username,
}
query = psa.insert(User) \
.values(entry) \
.returning(User.c.id) \
.on_conflict_do_update(
index_elements=[User.c.dtid],
set_=entry
)
user_id = await (await conn.execute(query)).first()
print(type(user_id), user_id) # Output: " (1,)"
print(user_id[0]) # Output: " 1"
user_id, = user_id
print(user_id) # Output: " id"
```
As you see, everything goes well until I try to unpack the row...
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.