Skip to content

Commit

Permalink
Version bumped to 0.0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
xzkostyan committed Mar 31, 2019
1 parent f72814f commit 2e3d729
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## [Unreleased]

## [0.0.19] - 2019-03-31
### Added
- IPv4/IPv6 types. Pull request [#73](https://github.com/mymarilyn/clickhouse-driver/pull/73) by [AchilleAsh](https://github.com/AchilleAsh).

### Fixed
- String enums escaping.

## [0.0.18] - 2019-02-19
### Fixed
- Strings mishandling read from buffer. Pull request [#72](https://github.com/mymarilyn/clickhouse-driver/pull/72) by [mitsuhiko](https://github.com/mitsuhiko).
Expand Down Expand Up @@ -180,7 +187,8 @@
- Date/DateTime types.
- String types.

[Unreleased]: https://github.com/mymarilyn/clickhouse-driver/compare/0.0.18...HEAD
[Unreleased]: https://github.com/mymarilyn/clickhouse-driver/compare/0.0.19...HEAD
[0.0.19]: https://github.com/mymarilyn/clickhouse-driver/compare/0.0.18...0.0.19
[0.0.18]: https://github.com/mymarilyn/clickhouse-driver/compare/0.0.17...0.0.18
[0.0.17]: https://github.com/mymarilyn/clickhouse-driver/compare/0.0.16...0.0.17
[0.0.16]: https://github.com/mymarilyn/clickhouse-driver/compare/0.0.15...0.0.16
Expand Down
2 changes: 1 addition & 1 deletion clickhouse_driver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from .client import Client


VERSION = (0, 0, 18)
VERSION = (0, 0, 19)
__version__ = '.'.join(str(x) for x in VERSION)

__all__ = ['Client']
49 changes: 48 additions & 1 deletion docs/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ SELECT type: :class:`str`/:func:`basestring <basestring>`.
>>> client.execute('SELECT * FROM test')
[('foo',), ('bar',), ('foo',)]
For Python 2.7, `enum34 <https://pypi.org/project/enum34>`_ package is used.
For Python 2.7 `enum34 <https://pypi.org/project/enum34>`_ package is used.

Currently clickhouse-driver can't handle empty enum value due to Python's `Enum` mechanics.
Enum member name must be not empty. See `issue`_ and `workaround`_.
Expand Down Expand Up @@ -164,3 +164,50 @@ Decimal
INSERT types: :class:`~decimal.Decimal`, :class:`float`, :class:`int`, :class:`long`.

SELECT type: :class:`~decimal.Decimal`.


IPv4/IPv6
---------

INSERT types: :class:`~ipaddress.IPv4Address`/:class:`~ipaddress.IPv6Address`, :class:`int`, :class:`long`, :class:`str`/:func:`basestring <basestring>`.

SELECT type: :class:`~ipaddress.IPv4Address`/:class:`~ipaddress.IPv6Address`.

.. code-block:: python
>>> from ipaddress import IPv4Address, IPv6Address
>>>
>>> client.execute('DROP TABLE IF EXISTS test')
[]
>>> client.execute(
... 'CREATE TABLE test (x IPv4) '
... 'ENGINE = Memory'
... )
[]
>>> client.execute(
... 'INSERT INTO test (x) VALUES', [
... {'x': '192.168.253.42'},
... {'x': 167772161},
... {'x': IPv4Address('192.168.253.42')}
... ])
>>> client.execute('SELECT * FROM test')
[(IPv4Address('192.168.253.42'),), (IPv4Address('10.0.0.1'),), (IPv4Address('192.168.253.42'),)]
>>>
>>> client.execute('DROP TABLE IF EXISTS test')
[]
>>> client.execute(
... 'CREATE TABLE test (x IPv6) '
... 'ENGINE = Memory'
... )
[]
>>> client.execute(
... 'INSERT INTO test (x) VALUES', [
... {'x': '79f4:e698:45de:a59b:2765:28e3:8d3a:35ae'},
... {'x': IPv6Address('12ff:0000:0000:0000:0000:0000:0000:0001')},
... {'x': b"y\xf4\xe6\x98E\xde\xa5\x9b'e(\xe3\x8d:5\xae"}
... ])
>>> client.execute('SELECT * FROM test')
[(IPv6Address('79f4:e698:45de:a59b:2765:28e3:8d3a:35ae'),), (IPv6Address('12ff::1'),), (IPv6Address('79f4:e698:45de:a59b:2765:28e3:8d3a:35ae'),)]
>>>
For Python 2.7 `ipaddress <https://pypi.org/project/ipaddress>`_ package is used.

0 comments on commit 2e3d729

Please sign in to comment.