Skip to content

Commit

Permalink
wrap in try except for isc cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
daimor committed Mar 31, 2024
1 parent b7a8a48 commit ae50b85
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,27 @@ from sqlalchemy import create_engine
engine = create_engine("iris://_SYSTEM:SYS@localhost:1972/USER")
```

IRIS Cloud SQL requires SSLContext

```python
url = engine.URL.create(
drivername="iris",
host=host,
port=443,
username='SQLAdmin',
password=password,
database='USER',
)

sslcontext = ssl.create_default_context(cafile="certificateSQLaaS.pem")

engine = create_engine(url, connect_args={"sslcontext": sslcontext})
```

InterSystems IRIS
---

You can run your instance of InterSystems IRIS Community Edition with Docker
You can run your instance of InterSystems IRIS Community Edition with Docker

```shell
docker run -d --name iris \
Expand Down
7 changes: 5 additions & 2 deletions sqlalchemy_iris/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,8 +902,11 @@ def on_connect(conn):
if self.embedded:
self.supports_vectors = conn.iris.cls("%SYSTEM.License").GetFeature(28) == 1
else:
iris = IRISNative.createIRIS(conn)
self.supports_vectors = iris.classMethodBoolean("%SYSTEM.License", "GetFeature", 28)
try:
iris = IRISNative.createIRIS(conn)
self.supports_vectors = iris.classMethodBoolean("%SYSTEM.License", "GetFeature", 28)
except: # noqa
self.supports_vectors = False
if self.supports_vectors:
with conn.cursor() as cursor:
# Distance or similarity
Expand Down

0 comments on commit ae50b85

Please sign in to comment.