system.db.runNamedQuery is showing as This function is deprecated and will be hidden in the future In Ignition 8.3

Hi,

I am using Ignition version 8.1 and we are planning to update to Ignition 8.3 but when i updated my dev environment to ignition 8.3 i am seeing below message for system.db.runNamedQuery that it will be hidden in future. Eventhough the function works ok now in my dev environment with Ignition 8.3. Can you please help me with below questions:

  1. I have already used this function at many places i my current development. Can you please let me know if this going forward in 8.3 this function is just hidden and will always work or its going to be removed later on?
  2. I have also tried to use system.db.execQuery instead of system.db.runNamedQuery in my further developments but when i moved the code to my prod which is still 8.1 version this new function system.db.execQuery dosen’t seems to work.

How should i manage my environment now so that it won’t break and always be ready for new updates?

runNamedQuery([project], path, [parameters], ...): any

Method on system.db

:warning: Deprecated :warning:: This function is deprecated and will be hidden in the future.

Replace with: system.db.execQuery, system.db.execUpdate

IA hides deprecated functions to stop future use, but they usually remain in the code, so projects are not broken.

It would be worthwhile to convert all of your runNamedQuery calls to the new version as you can. A big bonus is in a lot of scripts you have to determine the calling scope with the old version, this can be removed with the new functions.

Example

# determines if you must provide the project name or not.  
# the new functions have the project name as optional and will not require this logic
if isGateway:
    system.db.runNamedQuery('global', queryName,{})
else:
    system.db.runNamedQuery(queryName,{})
2 Likes

More on deprecation here:

1 Like