bvanelli / actualpy

Python API implementation for Actual server - reference https://actualbudget.org/
https://actualpy.readthedocs.io/en/latest/
27 stars 7 forks source link

Support multiple Actual server versions at once #57

Open bvanelli opened 2 months ago

bvanelli commented 2 months ago

Description

As described in https://github.com/bvanelli/actualpy/issues/51#issuecomment-2284856457, mhe main issue is that I intended to support multiple versions on Actual, but sqlalchemy emit statements for all columns when doing an insert. For example, when inserting a payee:

E       [SQL: INSERT INTO payees (id, name, category, transfer_acct, favorite) VALUES (?, ?, ?, ?, ?)]
E       [parameters: ('835983d9-1e5e-4c24-bca5-55acea558f2c', None, None, '99293e48-4f92-4d92-a1f1-cd4f4c126d22', None)]

This code works fine for actual 24.8.0, but not on 24.7.0, because there the column favorite does not exist. I tried using sqlalchemy deferred column but that is only effective on selects, not inserts.

This is extremely annoying because I then need either:

I like the second idea more, but it's a bit difficult to implement.