Skip to content

Commit ae50b85

Browse files
committed
wrap in try except for isc cloud
1 parent b7a8a48 commit ae50b85

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,27 @@ from sqlalchemy import create_engine
2323
engine = create_engine("iris://_SYSTEM:SYS@localhost:1972/USER")
2424
```
2525

26+
IRIS Cloud SQL requires SSLContext
27+
28+
```python
29+
url = engine.URL.create(
30+
drivername="iris",
31+
host=host,
32+
port=443,
33+
username='SQLAdmin',
34+
password=password,
35+
database='USER',
36+
)
37+
38+
sslcontext = ssl.create_default_context(cafile="certificateSQLaaS.pem")
39+
40+
engine = create_engine(url, connect_args={"sslcontext": sslcontext})
41+
```
42+
2643
InterSystems IRIS
2744
---
2845

29-
You can run your instance of InterSystems IRIS Community Edition with Docker
46+
You can run your instance of InterSystems IRIS Community Edition with Docker
3047

3148
```shell
3249
docker run -d --name iris \

sqlalchemy_iris/base.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,8 +902,11 @@ def on_connect(conn):
902902
if self.embedded:
903903
self.supports_vectors = conn.iris.cls("%SYSTEM.License").GetFeature(28) == 1
904904
else:
905-
iris = IRISNative.createIRIS(conn)
906-
self.supports_vectors = iris.classMethodBoolean("%SYSTEM.License", "GetFeature", 28)
905+
try:
906+
iris = IRISNative.createIRIS(conn)
907+
self.supports_vectors = iris.classMethodBoolean("%SYSTEM.License", "GetFeature", 28)
908+
except: # noqa
909+
self.supports_vectors = False
907910
if self.supports_vectors:
908911
with conn.cursor() as cursor:
909912
# Distance or similarity

0 commit comments

Comments
 (0)