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

1 Like

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

So now i have to change all my runNamedQuery to execQuery. It is a lot of change as i have used in many scripts, events bindings e.t.c….but i think i have no other choice and have to do it as runNamedQuery still works in 8.3 but IA might remove it completely in other upcoming major version and my whole project will always have a risk of getting break.

Use the Find/Replace function to speed up the conversion, but IA is not going to just pull the rug out from under you. (Note that this is the benefit of delegating all events scripts etc. to project scripts, it makes it easier to make these kinds of changes.)

Even if another major release deprecates the old function, you don't have to update until you are ready. My guess would be a couple years minimum before it would happen via v8.5.

2 Likes

Just going to highlight this portion of my other post.

There's not going to be a rug pull. While I'd recommend moving to the new functions eventually, it's because they are better. There is absolutely no urgency to doing so.

I'll even state confidently:
The next major version of Ignition, 2027.2, is not going to do anything to change the behavior of system.db.runNamedQuery in a backwards-incompatible way.

5 Likes

Thank you for the responses. I will slowly try to move the code to the new version now :slight_smile:

1 Like