VALUES clause in SQLAlchemy

This is now natively available in SQLAlchemy.

Your example would be written as:

from sqlalchemy import select, column, Integer
from sqlalchemy.sql import Values

select(Values(column('Number', Integer), name="sq").data([(1,), (2,), (3,)]))

There doesn’t seem to be any documentation on this, but you can have a look at the test cases https://github.com/sqlalchemy/sqlalchemy/blob/master/test/sql/test_values.py

Leave a Comment