|
2 | 2 | Changelog
|
3 | 3 | =========
|
4 | 4 |
|
| 5 | +2.0.0 (2024-03-19) |
| 6 | +------------------ |
| 7 | + |
| 8 | +This is a major release with new features and breaking changes. |
| 9 | + |
| 10 | +Features |
| 11 | +~~~~~~~~ |
| 12 | + |
| 13 | +* Support for ILP over HTTP. The sender can now send data to QuestDB via HTTP |
| 14 | + instead of TCP. This provides error feedback from the server and new features. |
| 15 | + |
| 16 | + .. code-block:: python |
| 17 | +
|
| 18 | + conf = 'http::addr=localhost:9000;' |
| 19 | + with Sender.from_conf(conf) as sender: |
| 20 | + sender.row(...) |
| 21 | + sender.dataframe(...) |
| 22 | +
|
| 23 | + # Will raise `IngressError` if there is an error from the server. |
| 24 | + sender.flush() |
| 25 | +
|
| 26 | +* New configuration string construction. The sender can now be also constructed |
| 27 | + from a :ref:`configuration string <sender_conf>` in addition to the |
| 28 | + constructor arguments. |
| 29 | + This allows for more flexible configuration and is the recommended way to |
| 30 | + construct a sender. |
| 31 | + The same string can also be loaded from the ``QDB_CLIENT_CONF`` environment |
| 32 | + variable. |
| 33 | + The constructor arguments have been updated and some options have changed. |
| 34 | + |
| 35 | +* Explicit transaction support over HTTP. A set of rows for a single table can |
| 36 | + now be committed via the sender transactionally. You can do this using a |
| 37 | + ``with sender.transaction('table_name') as txn:`` block. |
| 38 | + |
| 39 | + .. code-block:: python |
| 40 | +
|
| 41 | + conf = 'http::addr=localhost:9000;' |
| 42 | + with Sender.from_conf(conf) as sender: |
| 43 | + with sender.transaction('test_table') as txn: |
| 44 | + # Same arguments as the sender methods, minus the table name. |
| 45 | + txn.row(...) |
| 46 | + txn.dataframe(...) |
| 47 | +
|
| 48 | +* A number of documentation improvements. |
| 49 | + |
| 50 | + |
| 51 | +Breaking Changes |
| 52 | +~~~~~~~~~~~~~~~~ |
| 53 | + |
| 54 | +* New ``protocol`` parameter in the |
| 55 | + :ref:`Sender <sender_programmatic_construction>` constructor. |
| 56 | + |
| 57 | + In previous version the protocol was always TCP. |
| 58 | + In this new version you must specify the protocol explicitly. |
| 59 | + |
| 60 | +* New auto-flush defaults. In previous versions |
| 61 | + :ref:`auto-flushing <sender_auto_flush>` was enabled by |
| 62 | + default and triggered by a maximum buffer size. In this new version |
| 63 | + auto-flushing is enabled by row count (600 rows by default) and interval |
| 64 | + (1 second by default), while auto-flushing by buffer size is disabled by |
| 65 | + default. |
| 66 | + |
| 67 | + The old behaviour can be still be achieved by tweaking the auto-flush |
| 68 | + settings. |
| 69 | + |
| 70 | + .. list-table:: |
| 71 | + :header-rows: 1 |
| 72 | + |
| 73 | + * - Setting |
| 74 | + - Old default |
| 75 | + - New default |
| 76 | + * - **auto_flush_rows** |
| 77 | + - off |
| 78 | + - 600 |
| 79 | + * - **auto_flush_interval** |
| 80 | + - off |
| 81 | + - 1000 |
| 82 | + * - **auto_flush_bytes** |
| 83 | + - 64512 |
| 84 | + - off |
| 85 | + |
| 86 | +* The ``at=..`` argument of :func:`row <questdb.ingress.Sender.row>` and |
| 87 | + :func:`dataframe <questdb.ingress.Sender.dataframe>` methods is now mandatory. |
| 88 | + Omitting it would previously use a server-generated timestamp for the row. |
| 89 | + Now if you want a server generated timestamp, you can pass the :ref:`ServerTimestamp <sender_server_timestamp>` |
| 90 | + singleton to this parameter. _The ``ServerTimestamp`` behaviour is considered legacy._ |
| 91 | + |
| 92 | +* The ``auth=(u, t, x, y)`` argument of the ``Sender`` constructor has now been |
| 93 | + broken up into multiple arguments: ``username``, ``token``, ``token_x``, ``token_y``. |
| 94 | + |
| 95 | +* The ``tls`` argument of the ``Sender`` constructor has been removed and |
| 96 | + replaced with the ``protocol`` argument. Use ``Protocol.Tcps`` |
| 97 | + (or ``Protocol.Https``) to enable TLS. |
| 98 | + The ``tls`` values have been moved to new ``tls_ca`` and ``tls_roots`` |
| 99 | + :ref:`configuration settings <sender_conf_tls>`. |
| 100 | + |
| 101 | +* The ``net_interface`` argument of the ``Sender`` constructor has been renamed |
| 102 | + to ``bind_interface`` and is now only available for TCP connections. |
| 103 | + |
| 104 | +The following example shows how to migrate to the new API. |
| 105 | + |
| 106 | +**Old questdb 1.x code** |
| 107 | + |
| 108 | +.. code-block:: python |
| 109 | +
|
| 110 | + from questdb.ingress import Sender |
| 111 | +
|
| 112 | + auth = ( |
| 113 | + 'testUser1', |
| 114 | + '5UjEMuA0Pj5pjK8a-fa24dyIf-Es5mYny3oE_Wmus48', |
| 115 | + 'token_x=fLKYEaoEb9lrn3nkwLDA-M_xnuFOdSt9y0Z7_vWSHLU', |
| 116 | + 'token_y=Dt5tbS1dEDMSYfym3fgMv0B99szno-dFc1rYF9t0aac') |
| 117 | + with Sender('localhost', 9009, auth=auth, tls=True) as sender: |
| 118 | + sender.row( |
| 119 | + 'test_table', |
| 120 | + symbols={'sym': 'AAPL'}, |
| 121 | + columns={'price': 100.0}) # `at=None` was defaulted for server time |
| 122 | +
|
| 123 | +**Equivalent questdb 2.x code** |
| 124 | + |
| 125 | +.. code-block:: python |
| 126 | +
|
| 127 | + from questdb.ingress import Sender, Protocol, ServerTimestamp |
| 128 | +
|
| 129 | + sender = Sender( |
| 130 | + Protocol.Tcps, |
| 131 | + 'localhost', |
| 132 | + 9009, |
| 133 | + username='testUser1', |
| 134 | + token='5UjEMuA0Pj5pjK8a-fa24dyIf-Es5mYny3oE_Wmus48', |
| 135 | + token_x='token_x=fLKYEaoEb9lrn3nkwLDA-M_xnuFOdSt9y0Z7_vWSHLU', |
| 136 | + token_y='token_y=Dt5tbS1dEDMSYfym3fgMv0B99szno-dFc1rYF9t0aac', |
| 137 | + auto_flush_rows='off', |
| 138 | + auto_flush_interval='off', |
| 139 | + auto_flush_bytes=64512) |
| 140 | + with sender: |
| 141 | + sender.row( |
| 142 | + 'test_table', |
| 143 | + symbols={'sym': 'AAPL'}, |
| 144 | + columns={'price': 100.0}, |
| 145 | + at=ServerTimestamp) |
| 146 | +
|
| 147 | +**Equivalent questdb 2.x code with configuration string** |
| 148 | + |
| 149 | +.. code-block:: python |
| 150 | +
|
| 151 | + from questdb.ingress import Sender |
| 152 | +
|
| 153 | + conf = ( |
| 154 | + 'tcp::addr=localhost:9009;' + |
| 155 | + 'username=testUser1;' + |
| 156 | + 'token=5UjEMuA0Pj5pjK8a-fa24dyIf-Es5mYny3oE_Wmus48;' + |
| 157 | + 'token_x=token_x=fLKYEaoEb9lrn3nkwLDA-M_xnuFOdSt9y0Z7_vWSHLU;' + |
| 158 | + 'token_y=token_y=Dt5tbS1dEDMSYfym3fgMv0B99szno-dFc1rYF9t0aac;' + |
| 159 | + 'auto_flush_rows=off;' + |
| 160 | + 'auto_flush_interval=off;' + |
| 161 | + 'auto_flush_bytes=64512') |
| 162 | + with Sender.from_conf(conf) as sender: |
| 163 | + sender.row( |
| 164 | + 'test_table', |
| 165 | + symbols={'sym': 'AAPL'}, |
| 166 | + columns={'price': 100.0}, |
| 167 | + at=ServerTimestamp) |
| 168 | +
|
| 169 | +
|
5 | 170 | 1.2.0 (2023-11-23)
|
6 | 171 | ------------------
|
7 | 172 |
|
|
0 commit comments