Core insert and named columns

Skip to first unread message

Tomas Pavlovsky

Oct 20, 2021, 6:31:01 AMOct 20
to sqlalchemy

class A():
 id = Column('object_id", Integer, primary_key=True)
 field = Column(Integer, primary_key=True)

insert(A).values(**{id:1, field:3})

sqlalchemy.exc.CompileError: Unconsumed column names: id

It is normal behavior or not?

Mike Bayer

Oct 20, 2021, 1:02:03 PMOct 20
to noreply-spamdigest via sqlalchemy
for the moment yes, because there is no ORM overlay for the insert() construct.    the case below should be improved however.

reliable way is to use the attributes:

stmt = insert(A).values({ 1, A.field: 3})

SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See for a full description.
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to

Mike Bayer

Oct 20, 2021, 1:05:46 PMOct 20
to noreply-spamdigest via sqlalchemy

Tomas Pavlovsky

Oct 21, 2021, 4:41:36 AMOct 21
to sqlalchemy
Ok, thank you. 
Reply all
Reply to author
0 new messages