How can I get the name of the data database in the current namespace?
Hi folks!
Is there a way (function) to know the name of the database for data of the current namespace?
I take the case where we have one database for data and another database for code in a namespace.
Thanks!
Product version: IRIS 2021.1
This is not so simple because parts of a namespace could be mapped in more then one database.
But take a look at the %SYS.Namespace class:
Thanks, Julius!
You can use (inside %SYS) Config.Namespaces:Get().
For example -
Of course assuming you are coming from other namespace into %SYS, you can have the name of that namespace in a variable, and use that variable instead of "USER" in my example above.
If you want the actual directory/folder of the database you can also then use Config.Databases:Get(), for example:
And if you want directly just the locations of the databases, and not their names, you could use %SYS.Namespace:GetAllNSInfo() (without having to move into %SYS first) as @Julius Kavay mentioned.
For example:
Thank you, Tani! This is what I was looking for!