/
__init__.py
51 lines (45 loc) · 988 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from ..client import Client
from .connection import Connection
from .error import (
DatabaseError,
DataError,
Error,
IntegrityError,
InterfaceError,
InternalError,
NotSupportedError,
OperationalError,
ProgrammingError,
Warning,
)
apilevel = "2.0"
threadsafety = 3
paramstyle = "pyformat"
def connect(client=None):
"""Establish a DB-API connection to Treasure Data.
Parameters
----------
client : pytd.Client, optional
A client used to connect to Treasure Data. If not given, a client is
created using default options.
"""
if client is None:
client = Client()
return Connection(client)
__all__ = [
"apilevel",
"threadsafety",
"paramstyle",
"connect",
"Connection",
"Error",
"Warning",
"InterfaceError",
"DatabaseError",
"InternalError",
"OperationalError",
"ProgrammingError",
"IntegrityError",
"DataError",
"NotSupportedError",
]