Initial Release
irisconns
was created to help manage IRIS connections in your project using configuration files instead of hard-coding the configuration information in your project.
irisconns
looks in irisconns
or .irisconns
files for connection information.
If a connection has been previously requested, the new request will return the existing connection.
irisconns
was originally created/published for the InterSystems External Languages Contest: .Net, Java, Python, JavaScript - 2025.
irisconns
looks in the following directories:
In each directory, irisconns
looks for the following files:
irisconns
.irisconns
The first file that contains a section for the given connection name will be loaded. Any missing information will be gathered by prompting the user for more information.
# 'default' is the connection returned if no name is provided. [default] hostname = localhost port = 11972 namespace = USER username = _SYSTEM
This connection name is "TEST".
[TEST]
hostname = test-server
port = 1972
namespace = USER
username = _SYSTEM
confirm = falseThis connection name is "PROD".
[PROD]
hostname = prod-server
port = 1972
namespace = %SYS
username = _SYSTEM
The following keys can be set for each connection in an irisconns
file. Any missing/required keys will be prompted to the user.
Key | Description | Example Values |
---|---|---|
hostname | Server name/IP of the connection | |
port | Port number for the connection | |
namespace | Namespace being connected to | |
username | User name | |
confirm | Should we confirm passwords? | false, no, off, f, n, 0, true, yes, on, t, y, 1 |
Save irisconns.py
to your PYTHONPATH so that you can import the irisconns
module.
This module requires the IRIS Python SDK:
pip install intersystems-irispython
Example usage:
import irisconns
default connection
irispy = irisconns.get_irispy()
named connection
irispy = irisconns.get_irispy('TEST')
usage
irispy.set('hello world!', 'test', 1)
print(f'>>> Value from IRIS: {irispy.get("test", 1)}')
irispy.kill('test', 1)
Save irisconns.js
to your project so that you can require the irisconns.js
package.
This module requires the IRIS JavaScript SDK:
npm install @intersystems/intersystems-iris-native
Example usage:
// Import the package const irisconns = require('./irisconns.js');
// Wrap in an async function so we can await the connection...
(async () => {
// 'default' connection
const iris = await irisconns.get_iris();// named (i.e. "PROD") connection
// const iris = await irisconns.get_iris('PROD');
// usage
iris.set('hello world!','test',1);
console.log('>>> Value from IRIS: ', iris.get('test',1));
iris.kill('test',1);
})()
To demo irisconns
, run the following docker compose command to start up a generic IRIS instance and build the demo images:
docker compose up
To run the python demo:
docker run -it --rm --network irisconns_default irisconns-irispy python demo.py
To run the nodejs demo:
docker run -it --rm --network irisconns_default irisconns-irisjs node demo.js