Skip to content

Support multiple Actual server versions at once #57

@bvanelli

Description

@bvanelli

Description

As described in #51 (comment), 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:

  • Multiple models of the database, one per version, and deciding each one on the go when connecting to the server or
  • Have "templated" models that would load the attributes lazily, but only when they are confirmed to exist on the database

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions