8000 KeyError when using returning(literal_column('*')) with insert · Issue #190 · encode/databases · GitHub
[go: up one dir, main page]

Skip to content
KeyError when using returning(literal_column('*')) with insert #190
Open
@kamilglod

Description

@kamilglod

slqlalchemy supports "*" as a returning value, however when I'm using it with postgres backend

row = await db.fetch_one(table.insert().values(**values).returning(literal_column('*')))

and then try to get row data KeyError shows up in this line https://github.com/encode/databases/blob/master/databases/backends/postgres.py#L105
That's because self._column_map has value {'*': (0, NullType())}

So there should be probably some extra check for the wildcard column.