Skip to content

Conversation

@shvbox
Copy link

@shvbox shvbox commented Feb 18, 2019

…ection. Fix wrong id when inserting with external database.

What does this PR do and why is it necessary?

  1. Silently reconnect to external database when connection was broken. Use of pool_pre_ping option of SqlAlchemy 1.2
  2. When connected to external PostgreSql database result.lastrowid allways returns 0. With SQLite all is fine. Using result.inserted_primary_key[0] works as expected for both databases.

How was it tested? How can it be tested by the reviewer?

Tested on my farm.

Any background context you want to provide?

https://stackoverflow.com/questions/23747742/sqlalchemy-session-reconnect
https://stackoverflow.com/questions/8589674/sqlalchemy-getting-the-id-of-the-last-record-inserted

What are the relevant tickets if any?

#108

Screenshots (if appropriate)

Further notes

Changed requiremens for SqlAlchemy version >= 1.2
Changed plugin version

…ection. Fix wrong id when inserting on external database.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant