16 lines
352 B
Python
16 lines
352 B
Python
|
from clickhouse_driver import Client
|
||
|
|
||
|
|
||
|
class ClickHouseConnector:
|
||
|
def __init__(self, config):
|
||
|
self.config = config
|
||
|
self.client = None
|
||
|
|
||
|
def connect(self):
|
||
|
self.client = Client(**self.config)
|
||
|
return self.client
|
||
|
|
||
|
def disconnect(self):
|
||
|
if self.client:
|
||
|
self.client.disconnect()
|