Not loaded · from iris-dev
Connects Python to InterSystems IRIS via TCP using DB-API, SQLAlchemy, and pandas. Covers common pitfalls like port confusion, keyword-arg segfault, and FETCH FIRST crash.
Claude Code won't load this skill
It ships in iris-dev at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
| This skill | iris-embedded-python | |
|---|---|---|
| Python location | External process, connects over TCP | Inside IRIS (Embedded Python) |
| Import | intersystems_irispython.dbapi | import iris |
| Connection | Superserver port (default 1972) | In-process, no network |
| Use when | Running .py scripts, notebooks, external services | ObjectScript calls Python, or Python calls iris.sql |
If you see import iris in the code, use the iris-embedded-python skill instead.
Always use the superserver port, not the web port.
Run check_config to see both ports:
iris-agentic-dev tool check_config --args '{}'
Look for iris_port (superserver, default 1972), not web_port (default 52773/52780).
Docker example: -p 11975:1972 → superserver port on the host is 11975.
pip install intersystems-irispython
import intersystems_irispython.dbapi as dbapi
# CORRECT — positional args
conn = dbapi.connect("localhost", 11975, "USER", "_SYSTEM", "SYS")
# WRONG — keyword args cause SIGSEGV on irispython >= 5.x outside an IRIS install
# conn = dbapi.connect(hostname="localhost", port=11975, ...) # DO NOT USE
from sqlalchemy import create_engine
engine = create_engine("iris://_SYSTEM:SYS@localhost:11975/USER")
| Pattern | Symptom | Fix |
|---|---|---|
dbapi.connect(hostname=..., port=...) keyword args | SIGSEGV / exit 139 | Use positional args: connect("host", port, "ns", "user", "pass") |
SELECT ... FETCH FIRST n ROWS ONLY | SIGSEGV in C extension | Use SELECT TOP n ... instead |
pd.read_sql(query, conn) | SIGSEGV on some queries | Use cursor.execute(); cursor.fetchall() |
These are not edge cases — all three crash hard with no Python traceback. If you see exit 139 or SIGSEGV, check this table first.
DB-API does not normalize aggregate return types. COUNT, AVG, SUM may return Decimal, str, or float depending on the query. Cast explicitly:
cursor.execute("SELECT COUNT(*), AVG(Fare) FROM MyTable")
row = cursor.fetchone()
count = int(row[0]) if row[0] is not None else 0
avg_fare = float(row[1]) if row[1] is not None else 0.0
If you see a warning about IRISINSTALLDIR not being set, it is cosmetic. Suppress it before the import:
import os
os.environ.setdefault("IRISINSTALLDIR", "")
import intersystems_irispython.dbapi as dbapi
| SQL feature | IRIS behavior |
|---|---|
| Row limit | SELECT TOP n ... — FETCH FIRST n ROWS ONLY causes SIGSEGV |
| Reserved words | COUNT, HOUR, YEAR, DATE, TIME cannot be used as column aliases |
| Schema discovery | INFORMATION_SCHEMA available and standard |
| Aggregates | COUNT, SUM, AVG, MIN, MAX work |
| Standard functions | COALESCE, CASE, ROUND, NULLIF all work |
Minimal working example against the local dev container (iris-dev-iris, superserver port 11975):
import os
os.environ.setdefault("IRISINSTALLDIR", "")
import intersystems_irispython.dbapi as dbapi
conn = dbapi.connect("localhost", 11975, "USER", "_SYSTEM", "SYS")
cursor = conn.cursor()
cursor.execute("SELECT TOP 5 ID, Name FROM %Dictionary.ClassDefinition")
for row in cursor.fetchall():
print(row[0], row[1])
cursor.close()
conn.close()
Swap 11975 for whatever iris_port shows in check_config output for your environment.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub intersystems-community/iris-agentic-dev --plugin iris-dev40 skills in this plugin
/ensemble-productionManage and observe IRIS Interoperability productions — lifecycle, logs, queues, and message tracing. Covers pyprod Python API, ObjectScript Ens.Director, and MCP tool flow./iris-agentic-devConfigure, connect, and troubleshoot the iris-agentic-dev MCP server (iris_execute/iris_query/iris_doc/docs_introspect/kb/etc.) against an IRIS container or instance. Use when its tools return IRIS_UNREACHABLE, when pointing it at a new IRIS, or when a connection edit "isn't taking effect." Covers the .iris-agentic-dev.toml config, live file-watch reload, the OrbStack port-discovery gotcha, and the docker-exec fallback./iris-agentic-dev-setupOther plugins' skills for the same job