Is it possible to use database functions when inserting multiple values into a table using SQLAlchemy?
If I insert a single row, the following code works fine:
conn.execute(
example_table.insert().values(
id=17,
example_field=db.func.concat("foo", "bar")
)
)
The field example_field contains the string foobar. However, trying to insert multiple rows this way produces unexpected results:
conn.execute(example_table.insert(), [{
"id": 17,
"example_field": db.func.concat("foo", "bar")
}, {
"id": 18,
"example_field": db.func.concat("bar", "baz")
}])
The field example_field is filled with the string concat(:concat_1, :concat_2).
What is the proper way to insert multiple rows into a table with functions?