Skip to content

Commit

Permalink
fix for SQLAlchemy>=2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
daimor committed Feb 3, 2023
1 parent 9ebb1a8 commit 55631d4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 3 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
wheel
flake8
pytest
pytest
black
twine
18 changes: 3 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
from setuptools import setup
import os

thelibFolder = os.path.dirname(os.path.realpath(__file__))
requirementPath = thelibFolder + '/requirements.txt'

requirements, dependency_links = [], []
if os.path.isfile(requirementPath):
with open('./requirements.txt') as f:
for line in f.read().splitlines():
if line.startswith('http'):
dependency_links.append(line)
else:
requirements.append(line)

setup(
install_requires=requirements,
dependency_links=dependency_links,
install_requires=[
"SQLAlchemy>=1.3"
],
entry_points={
"sqlalchemy.dialects": [
"iris = sqlalchemy_iris.iris:IRISDialect_iris",
Expand Down
5 changes: 5 additions & 0 deletions sqlalchemy_iris/embedded.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@ def _get_option(self, connection, option):
def _set_option(self, connection, option, value):
return connection.iris.cls('%SYSTEM.SQL.Util').SetOption(option)

@classmethod
def import_dbapi(cls):
import intersystems_iris.dbapi._DBAPI as dbapi
return dbapi


dialect = IRISDialect_emb
5 changes: 5 additions & 0 deletions sqlalchemy_iris/iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ class IRISDialect_iris(IRISDialect):

supports_statement_cache = True

@classmethod
def import_dbapi(cls):
import intersystems_iris.dbapi._DBAPI as dbapi
return dbapi


dialect = IRISDialect_iris

0 comments on commit 55631d4

Please sign in to comment.