__init__.py 754 字节
Newer Older
S
slguan 已提交
1 2 3 4

from .connection import TDengineConnection
from .cursor import TDengineCursor

5 6 7 8
# For some reason, the following is needed for VS Code (through PyLance) to 
# recognize that "error" is a valid module of the "taos" package.
from .error import ProgrammingError

S
slguan 已提交
9 10 11 12 13 14
# Globals
threadsafety = 0
paramstyle = 'pyformat'

__all__ = ['connection', 'cursor']

15

S
slguan 已提交
16 17 18 19 20 21 22 23 24 25 26 27
def connect(*args, **kwargs):
    """ Function to return a TDengine connector object

    Current supporting keyword parameters:
    @dsn: Data source name as string
    @user: Username as string(optional)
    @password: Password as string(optional)
    @host: Hostname(optional)
    @database: Database name(optional)

    @rtype: TDengineConnector
    """
28
    return TDengineConnection(*args, **kwargs)