diff --git a/.github/workflows/tox-tests.yml b/.github/workflows/tox-tests.yml index 5538b44..8ff4310 100644 --- a/.github/workflows/tox-tests.yml +++ b/.github/workflows/tox-tests.yml @@ -5,6 +5,8 @@ jobs: lint: name: lint runs-on: ubuntu-latest + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true steps: - uses: actions/checkout@v2 - name: Set up Python ${{matrix.python-version}} diff --git a/pyproject.toml b/pyproject.toml index 0f27e23..7cbf468 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,9 +41,9 @@ black = "^21.7b0" tox-pyenv = "^1.1.0" PyMySQL = "^1.0.2" cryptography = "^3.4.7" +psycopg2-binary = "^2.9.3" ibm-db = "^3.1.1" ibm-db-sa = "^0.3.7" -psycopg2-binary = "^2.9.3" [tool.pytest.ini_options] markers = [ diff --git a/rgsync/Connectors/cql_connector.py b/rgsync/Connectors/cql_connector.py index 2116eb2..645d46d 100644 --- a/rgsync/Connectors/cql_connector.py +++ b/rgsync/Connectors/cql_connector.py @@ -44,9 +44,7 @@ def Connect(self): ConnectionStr = self._getConnectionStr() - WriteBehindLog( - f"Connect: connecting db={self.db} keyspace={self.keyspace}" - ) + WriteBehindLog(f"Connect: connecting db={self.db} keyspace={self.keyspace}") auth_provider = PlainTextAuthProvider( username=self.user, password=self.password ) diff --git a/rgsync/Connectors/sql_connectors.py b/rgsync/Connectors/sql_connectors.py index 1ceb710..10d9db1 100644 --- a/rgsync/Connectors/sql_connectors.py +++ b/rgsync/Connectors/sql_connectors.py @@ -126,6 +126,14 @@ def _getConnectionStr(self): return f"db2://{self.user}:{self.passwd}@{self.db}" +class DB2Connection(BaseSqlConnection): + def __init__(self, user, passwd, db): + BaseSqlConnection.__init__(self, user, passwd, db) + + def _getConnectionStr(self): + return f"db2://{self.user}:{self.passwd}@{self.db}" + + class BaseSqlConnector: def __init__(self, connection, tableName, pk, exactlyOnceTableName=None): self.connection = connection diff --git a/rgsync/redis_gears_write_behind.py b/rgsync/redis_gears_write_behind.py index 3fb554e..cdc1978 100644 --- a/rgsync/redis_gears_write_behind.py +++ b/rgsync/redis_gears_write_behind.py @@ -269,9 +269,7 @@ def __init__(self, mappings, connector, name, version=None): # cases like mongo, that don't implement this, silence the warning if "object has no attribute 'PrepereQueries'" in str(e): return - WriteBehindLog( - f'Skip calling PrepereQueries of connector, err="{str(e)}"' - ) + WriteBehindLog(f'Skip calling PrepereQueries of connector, err="{str(e)}"') def DeleteKeyIfNeeded(r): diff --git a/tests/test_mongowritebehind.py b/tests/test_mongowritebehind.py index b1de5cf..8e9f147 100644 --- a/tests/test_mongowritebehind.py +++ b/tests/test_mongowritebehind.py @@ -32,9 +32,7 @@ def setup_class(cls): dbpasswd = docker["MONGO_INITDB_ROOT_PASSWORD"] db = docker["MONGO_DB"] - con = ( - f"mongodb://{dbuser}:{dbpasswd}@172.17.0.1:27017/{db}?authSource=admin" - ) + con = f"mongodb://{dbuser}:{dbpasswd}@172.17.0.1:27017/{db}?authSource=admin" script = """ from rgsync import RGJSONWriteBehind, RGJSONWriteThrough @@ -228,9 +226,7 @@ def setup_class(cls): dbpasswd = docker["MONGO_INITDB_ROOT_PASSWORD"] db = docker["MONGO_DB"] - con = ( - f"mongodb://{dbuser}:{dbpasswd}@172.17.0.1:27017/{db}?authSource=admin" - ) + con = f"mongodb://{dbuser}:{dbpasswd}@172.17.0.1:27017/{db}?authSource=admin" script = f""" from rgsync import RGJSONWriteBehind, RGJSONWriteThrough @@ -279,9 +275,7 @@ def setup_class(cls): dbpasswd = docker["MONGO_INITDB_ROOT_PASSWORD"] db = docker["MONGO_DB"] - con = ( - f"mongodb://{dbuser}:{dbpasswd}@172.17.0.1:27017/{db}?authSource=admin" - ) + con = f"mongodb://{dbuser}:{dbpasswd}@172.17.0.1:27017/{db}?authSource=admin" script = """ from rgsync import RGJSONWriteBehind, RGJSONWriteThrough diff --git a/tests/test_sqlwritebehind.py b/tests/test_sqlwritebehind.py index f24581e..e341ac1 100644 --- a/tests/test_sqlwritebehind.py +++ b/tests/test_sqlwritebehind.py @@ -94,6 +94,10 @@ def testWriteBehindAck(self): res = result.fetchone() assert res == ("1", "foo", "bar", 22) + result = self.dbconn.execute(text("select * from persons")) + res = result.fetchone() + assert res == ("1", "foo", "bar", 22) + # delete from database self.env.execute_command("hset", "person:1", "#", "~2") res = None