How to use the pyexasol.connection.ExaConnection function in pyexasol

To help you get started, we’ve selected a few pyexasol examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github badoo / pyexasol / pyexasol / __init__.py View on Github external
def connect(**kwargs) -> ExaConnection:
    """
    Constructor of connection objects
    Please check ExaConnection object for list of arguments
    """
    return ExaConnection(**kwargs)
github badoo / pyexasol / pyexasol / db2 / __init__.py View on Github external
from ..connection import ExaConnection

apilevel = '2.0'
threadsafety = 1
paramstyle = None


def connect(**kwargs):
    if 'autocommit' not in kwargs:
        kwargs['autocommit'] = False

    return DB2Connection(**kwargs)


class DB2Connection(ExaConnection):
    def cursor(self):
        return DB2Cursor(self)


class DB2Cursor(object):
    arraysize = 1

    def __init__(self, connection):
        self.connection = connection
        self.stmt = None

    def execute(self, query):
        self.stmt = self.connection.execute(query)

    def executemany(self, query):
        raise NotSupportedError