How does one do the equivalent of system.db.runUpdateQuery or runPrepUpdate with getKey=1 within the sdk? According to the SRConnection docs SRConnection, there is a runPrepInsertGetKey, but it returns:
That looks like you're calling an instance method as a static method. You need to obtain an SRConnection first, probably by going into a DatasourceManager off of the GatewayContext provided in your module's setup hook.
What language are you writing your module in? Can you make your typing explicit and/or see what you actually have after __db.connection()?
Unless you’re calling com.inductiveautomation.ignition.gateway.datasource.DatasourceManager#getConnection(java.lang.String), I’m not sure you actually have an SRConnection.
That was it! When we started the modules the target gateway was back at 8.0.13, and the modules were built accordingly. This particular call was in a shared jar file which had upgraded references. Once all version references were updated and updated modules installed, the call to runPrepInsertGetKey runs successfully.
Is this in fact the method used to implement the system.db.runPrepUpdate with getKey=1? runPrepInsertGetKey requires the table and column to be passed in, which is not part of the python interface.