Re: [sqlalchemy] session.add with insert-or-update

2020-03-09 Thread Keith Edmunds
Thanks Jonathan. This is a very low traffic application, so not a problem but I appreciate you mentioning it. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example

[sqlalchemy] Re: session.add with insert-or-update

2020-03-07 Thread Keith Edmunds
Thanks Mike! That looks good, and I'm favouring handling it in the application as you suggest. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://

[sqlalchemy] session.add with insert-or-update

2020-03-07 Thread Keith Edmunds
I'm new to SQLAlchemy. Sorry if it shows. I'm using a MySQL backend. I've set up a declarative_base, defined a table class, set up a session. I defined a record as a dictionary and added it successfully to the db with: incident = Incidents(**record) session.add(incident) session.commit() The b