mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2024-11-22 09:06:41 +03:00
Update docs
This commit is contained in:
parent
20ed85c864
commit
374f2dfe3e
|
@ -1,6 +1,10 @@
|
|||
Change Log
|
||||
==========
|
||||
|
||||
Unreleased
|
||||
----------
|
||||
- Added `timeout` parameter to database initializer (SUHAR1K)
|
||||
|
||||
v1.0.3
|
||||
------
|
||||
- Bug fix: `QuerySet.count()` ignores slicing
|
||||
|
|
|
@ -10,7 +10,7 @@ infi.clickhouse_orm.database
|
|||
Database instances connect to a specific ClickHouse database for running queries,
|
||||
inserting data and other operations.
|
||||
|
||||
#### Database(db_name, db_url="http://localhost:8123/", username=None, password=None, readonly=False, autocreate=True)
|
||||
#### Database(db_name, db_url="http://localhost:8123/", username=None, password=None, readonly=False, autocreate=True, timeout=60)
|
||||
|
||||
|
||||
Initializes a database instance. Unless it's readonly, the database will be
|
||||
|
@ -22,6 +22,7 @@ created on the ClickHouse server if it does not already exist.
|
|||
- `password`: optional connection credentials.
|
||||
- `readonly`: use a read-only connection.
|
||||
- `autocreate`: automatically create the database if does not exist (unless in readonly mode).
|
||||
- `timeout`: the connection timeout in seconds.
|
||||
|
||||
|
||||
#### add_setting(name, value)
|
||||
|
|
|
@ -83,8 +83,8 @@ class Database(object):
|
|||
- `username`: optional connection credentials.
|
||||
- `password`: optional connection credentials.
|
||||
- `readonly`: use a read-only connection.
|
||||
- `autocreate`: automatically create the database if does not exist (unless in readonly mode).
|
||||
- `timeout`: the connect timeout.
|
||||
- `autocreate`: automatically create the database if it does not exist (unless in readonly mode).
|
||||
- `timeout`: the connection timeout in seconds.
|
||||
'''
|
||||
self.db_name = db_name
|
||||
self.db_url = db_url
|
||||
|
@ -321,8 +321,7 @@ class Database(object):
|
|||
if isinstance(data, string_types):
|
||||
data = data.encode('utf-8')
|
||||
params = self._build_params(settings)
|
||||
timeout = self.timeout
|
||||
r = requests.post(self.db_url, params=params, data=data, stream=stream, timeout=timeout)
|
||||
r = requests.post(self.db_url, params=params, data=data, stream=stream, timeout=self.timeout)
|
||||
if r.status_code != 200:
|
||||
raise ServerError(r.text)
|
||||
return r
|
||||
|
|
Loading…
Reference in New Issue
Block a user