kvesteri / sqlalchemy-continuum

Versioning extension for SQLAlchemy.
BSD 3-Clause "New" or "Revised" License
568 stars 128 forks source link

Add support for computed fields #340

Open yuvalek opened 9 months ago

yuvalek commented 9 months ago

The code today does not support computed fields. When sqlalchemy-continuum tried to create the versioned row it also tried to write a value to the computed column thus making an error.

yuvalek commented 9 months ago

My pr excludes computed columns when writing but still creates them in the DB.

yoshpe commented 2 months ago

I've tested it, however the function versioned_column_properties isn't seemed to be called when generating the Metadata schema (the columns are still added to the history's table)

As a workaround, you can add 'exclude' to the __versioned__ key, and manually exclude the column, which works

marksteward commented 2 months ago

Yeah I'm not sure how we'd do this any way other than ignoring them. Suggestions welcome.

yuvalek commented 2 months ago

It is weird because I tested it locally when I wrote it and it did work and excluded the column.