You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@PhatWabbit - I'm not sure we built out all of the update functions on the API yet. We focused first on the read and create functions. @emiliom and @lsetiawan - do you have any additional thoughts on this?
My suggestion would be to reuse the connection setup at the start of an odm2api session, then construct and issue a direct SQL UPDATE statement. Roughly, this would look something like this:
fromodm2api.ODMconnectionimportdbconnectionsession_factory=dbconnection.createConnection('postgresql', **db_cred)
DBSession=session_factory.getSession()
sq_str=" UPDATE mytable SET variablecode = 'xyz' WHERE variablecode = 'abc' "DBSession.execute(sql_str)
DBSession.commit()
@emiliom, I like your idea of including your #155 (comment) into the Sphinx documentation. I was recently looking at this with @roelofversteeg and @erekalper and noticing that those functions were indeed in need or work and documentation. It would be good to include that message in the docs.
Activity
horsburgh commentedon Apr 6, 2018
@PhatWabbit - I'm not sure we built out all of the update functions on the API yet. We focused first on the read and create functions. @emiliom and @lsetiawan - do you have any additional thoughts on this?
emiliom commentedon Apr 6, 2018
That's correct. The
updateservices (https://github.com/ODM2/ODM2PythonAPI/blob/master/odm2api/services/updateService.py) have not been fleshed out, for the most part.My suggestion would be to reuse the connection setup at the start of an odm2api session, then construct and issue a direct
SQL UPDATEstatement. Roughly, this would look something like this:emiliom commentedon Sep 15, 2018
We should probably close this issue. @aufdenkampe and @horsburgh, what do you think?
If you think the code snippet I included is useful enough, we could think about folding it somewhere into the Sphinx documentation.
aufdenkampe commentedon Sep 15, 2018
@emiliom, I like your idea of including your #155 (comment) into the Sphinx documentation. I was recently looking at this with @roelofversteeg and @erekalper and noticing that those functions were indeed in need or work and documentation. It would be good to include that message in the docs.
emiliom commentedon Oct 18, 2018
Adding this example to the Sphinx docs now, so I'm closing the issue.