Generated by Cython 0.29.32

Yellow lines hint at Python interaction.
Click on a line that starts with a "+" to see the C code that Cython generated for it.

Raw output: ingress.c

+0001: ################################################################################
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 0002: ##     ___                  _   ____  ____
 0003: ##    / _ \ _   _  ___  ___| |_|  _ \| __ )
 0004: ##   | | | | | | |/ _ \/ __| __| | | |  _ \
 0005: ##   | |_| | |_| |  __/\__ \ |_| |_| | |_) |
 0006: ##    \__\_\\__,_|\___||___/\__|____/|____/
 0007: ##
 0008: ##  Copyright (c) 2014-2019 Appsicle
 0009: ##  Copyright (c) 2019-2022 QuestDB
 0010: ##
 0011: ##  Licensed under the Apache License, Version 2.0 (the "License");
 0012: ##  you may not use this file except in compliance with the License.
 0013: ##  You may obtain a copy of the License at
 0014: ##
 0015: ##  http://www.apache.org/licenses/LICENSE-2.0
 0016: ##
 0017: ##  Unless required by applicable law or agreed to in writing, software
 0018: ##  distributed under the License is distributed on an "AS IS" BASIS,
 0019: ##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 0020: ##  See the License for the specific language governing permissions and
 0021: ##  limitations under the License.
 0022: ##
 0023: ################################################################################
 0024: 
 0025: # distutils: language=c
 0026: # cython: language_level=3
 0027: # cython: binding=True
 0028: 
 0029: """
 0030: API for fast data ingestion into QuestDB.
 0031: """
 0032: 
 0033: # For prototypes: https://github.com/cython/cython/tree/master/Cython/Includes
 0034: from libc.stdint cimport uint8_t, uint64_t, int64_t, uint32_t, uintptr_t, \
 0035:     INT64_MAX, INT64_MIN
 0036: from libc.stdlib cimport malloc, calloc, realloc, free, abort, qsort
 0037: from libc.string cimport strncmp, memset
 0038: from libc.math cimport isnan
 0039: from libc.errno cimport errno
 0040: from cpython.datetime cimport datetime
 0041: from cpython.bool cimport bool
 0042: from cpython.weakref cimport PyWeakref_NewRef, PyWeakref_GetObject
 0043: from cpython.object cimport PyObject
 0044: from cpython.buffer cimport Py_buffer, PyObject_CheckBuffer, \
 0045:     PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE
 0046: from cpython.memoryview cimport PyMemoryView_FromMemory
 0047: 
 0048: from .line_sender cimport *
 0049: from .pystr_to_utf8 cimport *
 0050: from .arrow_c_data_interface cimport *
 0051: from .extra_cpython cimport *
 0052: from .ingress_helper cimport *
 0053: 
 0054: # An int we use only for error reporting.
 0055: #  0 is success.
 0056: # -1 is failure.
 0057: ctypedef int void_int
 0058: 
 0059: import cython
 0060: include "dataframe.pxi"
 0061: 
 0062: 
+0063: from enum import Enum
  __pyx_t_19 = PyList_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_INCREF(__pyx_n_s_Enum);
  __Pyx_GIVEREF(__pyx_n_s_Enum);
  PyList_SET_ITEM(__pyx_t_19, 0, __pyx_n_s_Enum);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_enum, __pyx_t_19, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Enum); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Enum, __pyx_t_19) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0064: from typing import List, Tuple, Dict, Union, Any, Optional, Callable, \
  __pyx_t_1 = PyList_New(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_List);
  __Pyx_GIVEREF(__pyx_n_s_List);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_List);
  __Pyx_INCREF(__pyx_n_s_Tuple);
  __Pyx_GIVEREF(__pyx_n_s_Tuple);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_Tuple);
  __Pyx_INCREF(__pyx_n_s_Dict);
  __Pyx_GIVEREF(__pyx_n_s_Dict);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_Dict);
  __Pyx_INCREF(__pyx_n_s_Union);
  __Pyx_GIVEREF(__pyx_n_s_Union);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_Union);
  __Pyx_INCREF(__pyx_n_s_Any);
  __Pyx_GIVEREF(__pyx_n_s_Any);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_Any);
  __Pyx_INCREF(__pyx_n_s_Optional);
  __Pyx_GIVEREF(__pyx_n_s_Optional);
  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_Optional);
  __Pyx_INCREF(__pyx_n_s_Callable);
  __Pyx_GIVEREF(__pyx_n_s_Callable);
  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_Callable);
  __Pyx_INCREF(__pyx_n_s_Iterable);
  __Pyx_GIVEREF(__pyx_n_s_Iterable);
  PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_Iterable);
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_1, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_List); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_List, __pyx_t_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_Tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Tuple, __pyx_t_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_Dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Dict, __pyx_t_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_Union); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_Any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Any, __pyx_t_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_Optional); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_Callable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Callable, __pyx_t_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_Iterable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Iterable, __pyx_t_1) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
 0065:     Iterable
+0066: import pathlib
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_pathlib, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pathlib, __pyx_t_19) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
 0067: 
+0068: import sys
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_19) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
 0069: 
 0070: # For `get_time_now_ns` and `get_time_now_us` functions.
 0071: IF UNAME_SYSNAME == 'Windows':
 0072:     import time
 0073: ELSE:
 0074:     from posix.time cimport timespec, clock_gettime, CLOCK_REALTIME
 0075: 
 0076: 
+0077: cdef bint _has_gil(PyThreadState** gs):
static int __pyx_f_7questdb_7ingress__has_gil(PyThreadState **__pyx_v_gs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_has_gil", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0078:     return gs[0] == NULL
  __pyx_r = ((__pyx_v_gs[0]) == NULL);
  goto __pyx_L0;
 0079: 
 0080: 
+0081: cdef bint _ensure_doesnt_have_gil(PyThreadState** gs):
static int __pyx_f_7questdb_7ingress__ensure_doesnt_have_gil(PyThreadState **__pyx_v_gs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ensure_doesnt_have_gil", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0082:     """Returns True if previously had the GIL, False otherwise."""
+0083:     if _has_gil(gs):
  __pyx_t_1 = (__pyx_f_7questdb_7ingress__has_gil(__pyx_v_gs) != 0);
  if (__pyx_t_1) {
/* … */
  }
+0084:         gs[0] = PyEval_SaveThread()
    (__pyx_v_gs[0]) = PyEval_SaveThread();
+0085:         return True
    __pyx_r = 1;
    goto __pyx_L0;
+0086:     return False
  __pyx_r = 0;
  goto __pyx_L0;
 0087: 
 0088: 
+0089: cdef void _ensure_has_gil(PyThreadState** gs):
static void __pyx_f_7questdb_7ingress__ensure_has_gil(PyThreadState **__pyx_v_gs) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ensure_has_gil", 0);
/* … */
  /* function exit code */
  __Pyx_RefNannyFinishContext();
}
+0090:     if not _has_gil(gs):
  __pyx_t_1 = ((!(__pyx_f_7questdb_7ingress__has_gil(__pyx_v_gs) != 0)) != 0);
  if (__pyx_t_1) {
/* … */
  }
+0091:         PyEval_RestoreThread(gs[0])
    PyEval_RestoreThread((__pyx_v_gs[0]));
+0092:         gs[0] = NULL
    (__pyx_v_gs[0]) = NULL;
 0093: 
 0094: 
+0095: class IngressErrorCode(Enum):
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_Enum); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_19);
  __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_17 = __Pyx_Py3MetaclassPrepare(__pyx_t_19, __pyx_t_1, __pyx_n_s_IngressErrorCode, __pyx_n_s_IngressErrorCode, (PyObject *) NULL, __pyx_n_s_questdb_ingress, __pyx_kp_s_Category_of_Error); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
/* … */
  __pyx_t_18 = __Pyx_Py3ClassCreate(__pyx_t_19, __pyx_n_s_IngressErrorCode, __pyx_t_1, __pyx_t_17, NULL, 0, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IngressErrorCode, __pyx_t_18) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 0096:     """Category of Error."""
+0097:     CouldNotResolveAddr = line_sender_error_could_not_resolve_addr
  __pyx_t_16 = __Pyx_PyInt_From_enum__line_sender_error_code(line_sender_error_could_not_resolve_addr); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_n_s_CouldNotResolveAddr, __pyx_t_16) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+0098:     InvalidApiCall = line_sender_error_invalid_api_call
  __pyx_t_16 = __Pyx_PyInt_From_enum__line_sender_error_code(line_sender_error_invalid_api_call); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_n_s_InvalidApiCall, __pyx_t_16) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+0099:     SocketError = line_sender_error_socket_error
  __pyx_t_16 = __Pyx_PyInt_From_enum__line_sender_error_code(line_sender_error_socket_error); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_n_s_SocketError, __pyx_t_16) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+0100:     InvalidUtf8 = line_sender_error_invalid_utf8
  __pyx_t_16 = __Pyx_PyInt_From_enum__line_sender_error_code(line_sender_error_invalid_utf8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_n_s_InvalidUtf8, __pyx_t_16) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+0101:     InvalidName = line_sender_error_invalid_name
  __pyx_t_16 = __Pyx_PyInt_From_enum__line_sender_error_code(line_sender_error_invalid_name); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_n_s_InvalidName, __pyx_t_16) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+0102:     InvalidTimestamp = line_sender_error_invalid_timestamp
  __pyx_t_16 = __Pyx_PyInt_From_enum__line_sender_error_code(line_sender_error_invalid_timestamp); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_n_s_InvalidTimestamp, __pyx_t_16) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+0103:     AuthError = line_sender_error_auth_error
  __pyx_t_16 = __Pyx_PyInt_From_enum__line_sender_error_code(line_sender_error_auth_error); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_n_s_AuthError, __pyx_t_16) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+0104:     TlsError = line_sender_error_tls_error
  __pyx_t_16 = __Pyx_PyInt_From_enum__line_sender_error_code(line_sender_error_tls_error); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_n_s_TlsError, __pyx_t_16) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+0105:     BadDataFrame = <int>line_sender_error_tls_error + 1
  __pyx_t_16 = __Pyx_PyInt_From_long((((int)line_sender_error_tls_error) + 1)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_n_s_BadDataFrame, __pyx_t_16) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
 0106: 
+0107:     def __str__(self) -> str:
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_16IngressErrorCode_1__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7questdb_7ingress_16IngressErrorCode___str__[] = "Return the name of the enum.";
static PyMethodDef __pyx_mdef_7questdb_7ingress_16IngressErrorCode_1__str__ = {"__str__", (PyCFunction)__pyx_pw_7questdb_7ingress_16IngressErrorCode_1__str__, METH_O, __pyx_doc_7questdb_7ingress_16IngressErrorCode___str__};
static PyObject *__pyx_pw_7questdb_7ingress_16IngressErrorCode_1__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_16IngressErrorCode___str__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_16IngressErrorCode___str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.IngressErrorCode.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);
/* … */
  __pyx_t_16 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_return, __pyx_n_u_unicode) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
  __pyx_t_18 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_16IngressErrorCode_1__str__, 0, __pyx_n_s_IngressErrorCode___str, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_18, __pyx_t_16);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_n_s_str_2, __pyx_t_18) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_str_2, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 107, __pyx_L1_error)
 0108:         """Return the name of the enum."""
+0109:         return self.name
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 109, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0110: 
 0111: 
+0112: class IngressError(Exception):
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  __pyx_t_19 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_17 = __Pyx_Py3MetaclassPrepare(__pyx_t_19, __pyx_t_1, __pyx_n_s_IngressError, __pyx_n_s_IngressError, (PyObject *) NULL, __pyx_n_s_questdb_ingress, __pyx_kp_s_An_error_whilst_using_the_Sender); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
/* … */
  __pyx_t_16 = __Pyx_Py3ClassCreate(__pyx_t_19, __pyx_n_s_IngressError, __pyx_t_1, __pyx_t_17, NULL, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (__Pyx_CyFunction_InitClassCell(__pyx_t_18, __pyx_t_16) < 0) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IngressError, __pyx_t_16) < 0) __PYX_ERR(0, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 0113:     """An error whilst using the ``Sender`` or constructing its ``Buffer``."""
+0114:     def __init__(self, code, msg):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_12IngressError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7questdb_7ingress_12IngressError_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7questdb_7ingress_12IngressError_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7questdb_7ingress_12IngressError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_code = 0;
  PyObject *__pyx_v_msg = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_code,&__pyx_n_s_msg,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_code)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 114, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msg)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 114, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 114, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_code = values[1];
    __pyx_v_msg = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 114, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("questdb.ingress.IngressError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7questdb_7ingress_12IngressError___init__(__pyx_self, __pyx_v_self, __pyx_v_code, __pyx_v_msg);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_12IngressError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_code, PyObject *__pyx_v_msg) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.IngressError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__48 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_code, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);
/* … */
  __pyx_t_16 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_12IngressError_1__init__, 0, __pyx_n_s_IngressError___init, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_INCREF(__pyx_t_16);
  PyList_Append(__pyx_t_18, __pyx_t_16);
  __Pyx_GIVEREF(__pyx_t_16);
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_n_s_init, __pyx_t_16) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_init, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 114, __pyx_L1_error)
+0115:         super().__init__(msg)
  __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self);
  if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 115, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_msg);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0116:         self._code = code
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_code_2, __pyx_v_code) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
 0117: 
+0118:     @property
  __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_17, __pyx_n_s_code, __pyx_t_16) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+0119:     def code(self) -> IngressErrorCode:
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_12IngressError_3code(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7questdb_7ingress_12IngressError_2code[] = "Return the error code.";
static PyMethodDef __pyx_mdef_7questdb_7ingress_12IngressError_3code = {"code", (PyCFunction)__pyx_pw_7questdb_7ingress_12IngressError_3code, METH_O, __pyx_doc_7questdb_7ingress_12IngressError_2code};
static PyObject *__pyx_pw_7questdb_7ingress_12IngressError_3code(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("code (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_12IngressError_2code(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_12IngressError_2code(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("code", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.IngressError.code", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);
/* … */
  __pyx_t_16 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_IngressErrorCode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_return, __pyx_t_15) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_12IngressError_3code, 0, __pyx_n_s_IngressError_code, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_15, __pyx_t_16);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_code, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 119, __pyx_L1_error)
 0120:         """Return the error code."""
+0121:         return self._code
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_code_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0122: 
 0123: 
+0124: cdef inline object c_err_code_to_py(line_sender_error_code code):
static CYTHON_INLINE PyObject *__pyx_f_7questdb_7ingress_c_err_code_to_py(enum line_sender_error_code __pyx_v_code) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("c_err_code_to_py", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("questdb.ingress.c_err_code_to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0125:     if code == line_sender_error_could_not_resolve_addr:
  switch (__pyx_v_code) {
    case line_sender_error_could_not_resolve_addr:
/* … */
    break;
    case line_sender_error_invalid_api_call:
+0126:         return IngressErrorCode.CouldNotResolveAddr
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_IngressErrorCode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CouldNotResolveAddr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
+0127:     elif code == line_sender_error_invalid_api_call:
    break;
    case line_sender_error_socket_error:
+0128:         return IngressErrorCode.InvalidApiCall
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IngressErrorCode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_InvalidApiCall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
+0129:     elif code == line_sender_error_socket_error:
    break;
    case line_sender_error_invalid_utf8:
+0130:         return IngressErrorCode.SocketError
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_IngressErrorCode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SocketError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
+0131:     elif code == line_sender_error_invalid_utf8:
    break;
    case line_sender_error_invalid_name:
+0132:         return IngressErrorCode.InvalidUtf8
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IngressErrorCode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_InvalidUtf8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
+0133:     elif code == line_sender_error_invalid_name:
    break;
    case line_sender_error_invalid_timestamp:
+0134:         return IngressErrorCode.InvalidName
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_IngressErrorCode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_InvalidName); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
+0135:     elif code == line_sender_error_invalid_timestamp:
    break;
    case line_sender_error_auth_error:
+0136:         return IngressErrorCode.InvalidTimestamp
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IngressErrorCode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_InvalidTimestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
+0137:     elif code == line_sender_error_auth_error:
    break;
    case line_sender_error_tls_error:
+0138:         return IngressErrorCode.AuthError
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_IngressErrorCode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AuthError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
+0139:     elif code == line_sender_error_tls_error:
    break;
    default:
+0140:         return IngressErrorCode.TlsError
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IngressErrorCode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_TlsError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
 0141:     else:
+0142:         raise ValueError('Internal error converting error code.')
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 142, __pyx_L1_error)
    break;
  }
/* … */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_Internal_error_converting_error); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);
 0143: 
 0144: 
+0145: cdef inline object c_err_to_code_and_msg(line_sender_error* err):
static CYTHON_INLINE PyObject *__pyx_f_7questdb_7ingress_c_err_to_code_and_msg(struct line_sender_error *__pyx_v_err) {
  enum line_sender_error_code __pyx_v_code;
  size_t __pyx_v_c_len;
  char const *__pyx_v_c_msg;
  PyObject *__pyx_v_py_msg = 0;
  PyObject *__pyx_v_py_code = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("c_err_to_code_and_msg", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.c_err_to_code_and_msg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_py_msg);
  __Pyx_XDECREF(__pyx_v_py_code);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0146:     """Construct a ``SenderError`` from a C error, which will be freed."""
+0147:     cdef line_sender_error_code code = line_sender_error_get_code(err)
  __pyx_v_code = line_sender_error_get_code(__pyx_v_err);
+0148:     cdef size_t c_len = 0
  __pyx_v_c_len = 0;
+0149:     cdef const char* c_msg = line_sender_error_msg(err, &c_len)
  __pyx_v_c_msg = line_sender_error_msg(__pyx_v_err, (&__pyx_v_c_len));
 0150:     cdef object py_err
 0151:     cdef object py_msg
 0152:     cdef object py_code
+0153:     try:
  /*try:*/ {
+0154:         py_code = c_err_code_to_py(code)
    __pyx_t_1 = __pyx_f_7questdb_7ingress_c_err_code_to_py(__pyx_v_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_py_code = __pyx_t_1;
    __pyx_t_1 = 0;
+0155:         py_msg = PyUnicode_FromStringAndSize(c_msg, <Py_ssize_t>c_len)
    __pyx_t_1 = PyUnicode_FromStringAndSize(__pyx_v_c_msg, ((Py_ssize_t)__pyx_v_c_len)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_py_msg = __pyx_t_1;
    __pyx_t_1 = 0;
+0156:         return (py_code, py_msg)
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_py_code);
    __Pyx_GIVEREF(__pyx_v_py_code);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_py_code);
    __Pyx_INCREF(__pyx_v_py_msg);
    __Pyx_GIVEREF(__pyx_v_py_msg);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_py_msg);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L3_return;
  }
 0157:     finally:
+0158:         line_sender_error_free(err)
  /*finally:*/ {
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __pyx_t_2 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename;
      {
        line_sender_error_free(__pyx_v_err);
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      }
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0;
      __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4;
      goto __pyx_L1_error;
    }
    __pyx_L3_return: {
      __pyx_t_10 = __pyx_r;
      __pyx_r = 0;
      line_sender_error_free(__pyx_v_err);
      __pyx_r = __pyx_t_10;
      __pyx_t_10 = 0;
      goto __pyx_L0;
    }
  }
 0159: 
 0160: 
+0161: cdef inline object c_err_to_py(line_sender_error* err):
static CYTHON_INLINE PyObject *__pyx_f_7questdb_7ingress_c_err_to_py(struct line_sender_error *__pyx_v_err) {
  PyObject *__pyx_v_tup = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("c_err_to_py", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("questdb.ingress.c_err_to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tup);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0162:     """Construct an ``IngressError`` from a C error, which will be freed."""
+0163:     cdef object tup = c_err_to_code_and_msg(err)
  __pyx_t_1 = __pyx_f_7questdb_7ingress_c_err_to_code_and_msg(__pyx_v_err); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tup = __pyx_t_1;
  __pyx_t_1 = 0;
+0164:     return IngressError(tup[0], tup[1])
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IngressError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_tup, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_tup, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0165: 
 0166: 
+0167: cdef inline object c_err_to_py_fmt(line_sender_error* err, str fmt):
static CYTHON_INLINE PyObject *__pyx_f_7questdb_7ingress_c_err_to_py_fmt(struct line_sender_error *__pyx_v_err, PyObject *__pyx_v_fmt) {
  PyObject *__pyx_v_tup = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("c_err_to_py_fmt", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("questdb.ingress.c_err_to_py_fmt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tup);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0168:     """Construct an ``IngressError`` from a C error, which will be freed."""
+0169:     cdef object tup = c_err_to_code_and_msg(err)
  __pyx_t_1 = __pyx_f_7questdb_7ingress_c_err_to_code_and_msg(__pyx_v_err); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tup = __pyx_t_1;
  __pyx_t_1 = 0;
+0170:     return IngressError(tup[0], fmt.format(tup[1]))
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IngressError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_tup, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_tup, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyUnicode_Type_format, __pyx_v_fmt, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0171: 
 0172: 
+0173: cdef object _utf8_decode_error(
static PyObject *__pyx_f_7questdb_7ingress__utf8_decode_error(PyObject *__pyx_v_string, uint32_t __pyx_v_bad_codepoint) {
  PyObject *__pyx_v_s = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_utf8_decode_error", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("questdb.ingress._utf8_decode_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0174:         PyObject* string, uint32_t bad_codepoint):
+0175:     cdef str s = <str><object>string
  __pyx_t_1 = ((PyObject *)__pyx_v_string);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_s = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
+0176:     return IngressError(
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IngressError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
+0177:         IngressErrorCode.InvalidUtf8,
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_IngressErrorCode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InvalidUtf8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+0178:         f'Invalid codepoint 0x{bad_codepoint:x} in string {s!r}: ' +
  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = 0;
  __pyx_t_6 = 127;
  __Pyx_INCREF(__pyx_kp_u_Invalid_codepoint_0x);
  __pyx_t_5 += 20;
  __Pyx_GIVEREF(__pyx_kp_u_Invalid_codepoint_0x);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Invalid_codepoint_0x);
  __pyx_t_7 = __Pyx_PyInt_From_uint32_t(__pyx_v_bad_codepoint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_Format(__pyx_t_7, __pyx_n_u_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8);
  __pyx_t_8 = 0;
  __Pyx_INCREF(__pyx_kp_u_in_string);
  __pyx_t_5 += 11;
  __Pyx_GIVEREF(__pyx_kp_u_in_string);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_in_string);
  __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_s), __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6;
  __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_8);
  __pyx_t_8 = 0;
  __Pyx_INCREF(__pyx_kp_u__19);
  __pyx_t_5 += 2;
  __Pyx_GIVEREF(__pyx_kp_u__19);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u__19);
  __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_t_8, __pyx_kp_u_Cannot_be_encoded_as_UTF_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_9 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_9, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_9, __pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0179:         'Cannot be encoded as UTF-8.')
 0180: 
 0181: 
+0182: cdef str _fqn(type obj):
static PyObject *__pyx_f_7questdb_7ingress__fqn(PyTypeObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_fqn", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("questdb.ingress._fqn", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0183:     if obj.__module__ == 'builtins':
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_obj), __pyx_n_s_module); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_builtins, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
/* … */
  }
+0184:         return obj.__qualname__
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_obj), __pyx_n_s_qualname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 184, __pyx_L1_error)
    __pyx_r = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
 0185:     else:
+0186:         return f'{obj.__module__}.{obj.__qualname__}'
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_obj), __pyx_n_s_module); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u__3);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_obj), __pyx_n_s_qualname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }
 0187: 
 0188: 
+0189: cdef inline void_int _encode_utf8(
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress__encode_utf8(struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_string, struct line_sender_utf8 *__pyx_v_utf8_out) {
  uint32_t __pyx_v_bad_codepoint;
  size_t __pyx_v_count;
  int __pyx_v_kind;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_encode_utf8", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("questdb.ingress._encode_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0190:         qdb_pystr_buf* b,
 0191:         PyObject* string,
 0192:         line_sender_utf8* utf8_out) except -1:
+0193:     cdef uint32_t bad_codepoint = 0
  __pyx_v_bad_codepoint = 0;
+0194:     cdef size_t count = <size_t>(PyUnicode_GET_LENGTH(string))
  __pyx_v_count = ((size_t)PyUnicode_GET_LENGTH(__pyx_v_string));
+0195:     cdef int kind = PyUnicode_KIND(string)
  __pyx_v_kind = PyUnicode_KIND(__pyx_v_string);
+0196:     if kind == PyUnicode_1BYTE_KIND:
  switch (__pyx_v_kind) {
    case PyUnicode_1BYTE_KIND:
/* … */
    break;
    case PyUnicode_2BYTE_KIND:
 0197:         # No error handling for UCS1: All code points translate into valid UTF8.
+0198:         qdb_ucs1_to_utf8(
    qdb_ucs1_to_utf8(__pyx_v_b, __pyx_v_count, PyUnicode_1BYTE_DATA(__pyx_v_string), (&__pyx_v_utf8_out->len), (&__pyx_v_utf8_out->buf));
 0199:             b,
 0200:             count,
 0201:             PyUnicode_1BYTE_DATA(string),
 0202:             &utf8_out.len,
 0203:             &utf8_out.buf)
+0204:     elif kind == PyUnicode_2BYTE_KIND:
    break;
    case PyUnicode_4BYTE_KIND:
+0205:         if not qdb_ucs2_to_utf8(
    __pyx_t_1 = ((!(qdb_ucs2_to_utf8(__pyx_v_b, __pyx_v_count, PyUnicode_2BYTE_DATA(__pyx_v_string), (&__pyx_v_utf8_out->len), (&__pyx_v_utf8_out->buf), (&__pyx_v_bad_codepoint)) != 0)) != 0);
    if (unlikely(__pyx_t_1)) {
/* … */
    }
 0206:                 b,
 0207:                 count,
 0208:                 PyUnicode_2BYTE_DATA(string),
 0209:                 &utf8_out.len,
 0210:                 &utf8_out.buf,
 0211:                 &bad_codepoint):
+0212:             raise _utf8_decode_error(string, bad_codepoint)
      __pyx_t_2 = __pyx_f_7questdb_7ingress__utf8_decode_error(__pyx_v_string, __pyx_v_bad_codepoint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 212, __pyx_L1_error)
+0213:     elif kind == PyUnicode_4BYTE_KIND:
    break;
    default:
+0214:         if not qdb_ucs4_to_utf8(
    __pyx_t_1 = ((!(qdb_ucs4_to_utf8(__pyx_v_b, __pyx_v_count, ((uint32_t const *)PyUnicode_4BYTE_DATA(__pyx_v_string)), (&__pyx_v_utf8_out->len), (&__pyx_v_utf8_out->buf), (&__pyx_v_bad_codepoint)) != 0)) != 0);
    if (unlikely(__pyx_t_1)) {
/* … */
    }
 0215:                 b,
 0216:                 count,
 0217: 
 0218:                 # This cast is required and is possibly a Cython compiler bug.
 0219:                 # It doesn't recognize that `const Py_UCS4*`
 0220:                 # is the same as `const uint32_t*`.
 0221:                 <const uint32_t*>PyUnicode_4BYTE_DATA(string),
 0222: 
 0223:                 &utf8_out.len,
 0224:                 &utf8_out.buf,
 0225:                 &bad_codepoint):
+0226:             raise _utf8_decode_error(string, bad_codepoint)
      __pyx_t_2 = __pyx_f_7questdb_7ingress__utf8_decode_error(__pyx_v_string, __pyx_v_bad_codepoint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 226, __pyx_L1_error)
 0227:     else:
+0228:         raise ValueError(f'Unknown UCS kind: {kind}.')
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = 127;
    __Pyx_INCREF(__pyx_kp_u_Unknown_UCS_kind);
    __pyx_t_3 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_Unknown_UCS_kind);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Unknown_UCS_kind);
    __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_kind, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_kp_u__3);
    __pyx_t_3 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__3);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__3);
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 228, __pyx_L1_error)
    break;
  }
 0229: 
 0230: 
+0231: cdef void_int str_to_utf8(
static __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_str_to_utf8(struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_string, struct line_sender_utf8 *__pyx_v_utf8_out) {
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("str_to_utf8", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.str_to_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0232:         qdb_pystr_buf* b,
 0233:         PyObject* string,
 0234:         line_sender_utf8* utf8_out) except -1:
 0235:     """
 0236:     Convert a Python string to a UTF-8 borrowed buffer.
 0237:     This is done without allocating new Python `bytes` objects.
 0238:     In case the string is an ASCII string, it's also generally zero-copy.
 0239:     The `utf8_out` param will point to (borrow from) either the ASCII buffer
 0240:     inside the original Python object or a part of memory allocated inside the
 0241:     `b` buffer.
 0242: 
 0243:     If you need to use `utf8_out` without the GIL, call `qdb_pystr_buf_copy`.
 0244:     """
+0245:     if not PyUnicode_CheckExact(string):
  __pyx_t_1 = ((!(PyUnicode_CheckExact(__pyx_v_string) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0246:         raise TypeError(
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 246, __pyx_L1_error)
+0247:             'Expected a str object, not an object of type ' +
    __pyx_t_3 = __Pyx_PyUnicode_ConcatSafe(__pyx_kp_u_Expected_a_str_object_not_an_obj, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0248:             _fqn(type(<str><object>string)))
    __pyx_t_2 = __pyx_f_7questdb_7ingress__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_string))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
+0249:     PyUnicode_READY(string)
  __pyx_t_4 = PyUnicode_READY(__pyx_v_string); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 249, __pyx_L1_error)
 0250: 
 0251:     # We optimize the common case of ASCII strings.
 0252:     # This avoid memory allocations and copies altogether.
 0253:     # We get away with this because ASCII is a subset of UTF-8.
+0254:     if PyUnicode_IS_COMPACT_ASCII(string):
  __pyx_t_1 = (PyUnicode_IS_COMPACT_ASCII(__pyx_v_string) != 0);
  if (__pyx_t_1) {
/* … */
  }
+0255:         utf8_out.len = <size_t>(PyUnicode_GET_LENGTH(string))
    __pyx_v_utf8_out->len = ((size_t)PyUnicode_GET_LENGTH(__pyx_v_string));
+0256:         utf8_out.buf = <const char*>(PyUnicode_1BYTE_DATA(string))
    __pyx_v_utf8_out->buf = ((char const *)PyUnicode_1BYTE_DATA(__pyx_v_string));
+0257:         return 0
    __pyx_r = 0;
    goto __pyx_L0;
 0258: 
+0259:     _encode_utf8(b, string, utf8_out)
  __pyx_t_5 = __pyx_f_7questdb_7ingress__encode_utf8(__pyx_v_b, __pyx_v_string, __pyx_v_utf8_out); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 259, __pyx_L1_error)
 0260: 
 0261: 
 0262: 
+0263: cdef void_int str_to_utf8_copy(
static __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_str_to_utf8_copy(struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_string, struct line_sender_utf8 *__pyx_v_utf8_out) {
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("str_to_utf8_copy", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.str_to_utf8_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0264:         qdb_pystr_buf* b,
 0265:         PyObject* string,
 0266:         line_sender_utf8* utf8_out) except -1:
 0267:     """
 0268:     Variant of `str_to_utf8` that always copies the string to a new buffer.
 0269: 
 0270:     The resulting `utf8_out` can be used when not holding the GIL:
 0271:     The pointed-to memory is owned by `b`.
 0272:     """
+0273:     if not PyUnicode_CheckExact(string):
  __pyx_t_1 = ((!(PyUnicode_CheckExact(__pyx_v_string) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0274:         raise TypeError(
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 274, __pyx_L1_error)
+0275:             'Expected a str object, not an object of type ' +
    __pyx_t_3 = __Pyx_PyUnicode_ConcatSafe(__pyx_kp_u_Expected_a_str_object_not_an_obj, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+0276:             _fqn(type(<str><object>string)))
    __pyx_t_2 = __pyx_f_7questdb_7ingress__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_string))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
 0277: 
+0278:     PyUnicode_READY(string)
  __pyx_t_4 = PyUnicode_READY(__pyx_v_string); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 278, __pyx_L1_error)
+0279:     _encode_utf8(b, string, utf8_out)
  __pyx_t_5 = __pyx_f_7questdb_7ingress__encode_utf8(__pyx_v_b, __pyx_v_string, __pyx_v_utf8_out); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 279, __pyx_L1_error)
 0280: 
 0281: 
+0282: cdef void_int str_to_table_name(
static __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_str_to_table_name(struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_string, struct line_sender_table_name *__pyx_v_name_out) {
  struct line_sender_error *__pyx_v_err;
  struct line_sender_utf8 __pyx_v_utf8;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("str_to_table_name", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.str_to_table_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0283:         qdb_pystr_buf* b,
 0284:         PyObject* string,
 0285:         line_sender_table_name* name_out) except -1:
 0286:     """
 0287:     Python string to borrowed C table name.
 0288:     Also see `str_to_utf8`.
 0289:     """
+0290:     cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
 0291:     cdef line_sender_utf8 utf8
+0292:     str_to_utf8(b, string, &utf8)
  __pyx_t_1 = __pyx_f_7questdb_7ingress_str_to_utf8(__pyx_v_b, __pyx_v_string, (&__pyx_v_utf8)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 292, __pyx_L1_error)
+0293:     if not line_sender_table_name_init(name_out, utf8.len, utf8.buf, &err):
  __pyx_t_2 = ((!(line_sender_table_name_init(__pyx_v_name_out, __pyx_v_utf8.len, __pyx_v_utf8.buf, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+0294:         raise c_err_to_py(err)
    __pyx_t_3 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 294, __pyx_L1_error)
 0295: 
 0296: 
+0297: cdef void_int str_to_table_name_copy(
static __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_str_to_table_name_copy(struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_string, struct line_sender_table_name *__pyx_v_name_out) {
  struct line_sender_error *__pyx_v_err;
  struct line_sender_utf8 __pyx_v_utf8;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("str_to_table_name_copy", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.str_to_table_name_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0298:         qdb_pystr_buf* b,
 0299:         PyObject* string,
 0300:         line_sender_table_name* name_out) except -1:
 0301:     """
 0302:     Python string to copied C table name.
 0303:     Also see `str_to_utf8_copy`.
 0304:     """
+0305:     cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
 0306:     cdef line_sender_utf8 utf8
+0307:     str_to_utf8_copy(b, string, &utf8)
  __pyx_t_1 = __pyx_f_7questdb_7ingress_str_to_utf8_copy(__pyx_v_b, __pyx_v_string, (&__pyx_v_utf8)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 307, __pyx_L1_error)
+0308:     if not line_sender_table_name_init(name_out, utf8.len, utf8.buf, &err):
  __pyx_t_2 = ((!(line_sender_table_name_init(__pyx_v_name_out, __pyx_v_utf8.len, __pyx_v_utf8.buf, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+0309:         raise c_err_to_py(err)
    __pyx_t_3 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 309, __pyx_L1_error)
 0310: 
 0311: 
+0312: cdef void_int str_to_column_name(
static __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_str_to_column_name(struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_string, struct line_sender_column_name *__pyx_v_name_out) {
  struct line_sender_error *__pyx_v_err;
  struct line_sender_utf8 __pyx_v_utf8;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("str_to_column_name", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.str_to_column_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0313:         qdb_pystr_buf* b,
 0314:         str string,
 0315:         line_sender_column_name* name_out) except -1:
 0316:     """
 0317:     Python string to borrowed C column name.
 0318:     Also see `str_to_utf8`.
 0319:     """
+0320:     cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
 0321:     cdef line_sender_utf8 utf8
+0322:     str_to_utf8(b, <PyObject*>string, &utf8)
  __pyx_t_1 = __pyx_f_7questdb_7ingress_str_to_utf8(__pyx_v_b, ((PyObject *)__pyx_v_string), (&__pyx_v_utf8)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 322, __pyx_L1_error)
+0323:     if not line_sender_column_name_init(name_out, utf8.len, utf8.buf, &err):
  __pyx_t_2 = ((!(line_sender_column_name_init(__pyx_v_name_out, __pyx_v_utf8.len, __pyx_v_utf8.buf, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+0324:         raise c_err_to_py(err)
    __pyx_t_3 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 324, __pyx_L1_error)
 0325: 
 0326: 
+0327: cdef void_int str_to_column_name_copy(
static __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_str_to_column_name_copy(struct qdb_pystr_buf *__pyx_v_b, PyObject *__pyx_v_string, struct line_sender_column_name *__pyx_v_name_out) {
  struct line_sender_error *__pyx_v_err;
  struct line_sender_utf8 __pyx_v_utf8;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("str_to_column_name_copy", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.str_to_column_name_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0328:         qdb_pystr_buf* b,
 0329:         str string,
 0330:         line_sender_column_name* name_out) except -1:
 0331:     """
 0332:     Python string to copied C column name.
 0333:     Also see `str_to_utf8_copy`.
 0334:     """
+0335:     cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
 0336:     cdef line_sender_utf8 utf8
+0337:     str_to_utf8_copy(b, <PyObject*>string, &utf8)
  __pyx_t_1 = __pyx_f_7questdb_7ingress_str_to_utf8_copy(__pyx_v_b, ((PyObject *)__pyx_v_string), (&__pyx_v_utf8)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 337, __pyx_L1_error)
+0338:     if not line_sender_column_name_init(name_out, utf8.len, utf8.buf, &err):
  __pyx_t_2 = ((!(line_sender_column_name_init(__pyx_v_name_out, __pyx_v_utf8.len, __pyx_v_utf8.buf, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+0339:         raise c_err_to_py(err)
    __pyx_t_3 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 339, __pyx_L1_error)
 0340: 
 0341: 
+0342: cdef int64_t datetime_to_micros(datetime dt):
static int64_t __pyx_f_7questdb_7ingress_datetime_to_micros(PyDateTime_DateTime *__pyx_v_dt) {
  int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_to_micros", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("questdb.ingress.datetime_to_micros", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0343:     """
 0344:     Convert a `datetime.datetime` to microseconds since the epoch.
 0345:     """
 0346:     return (
+0347:         <int64_t>(dt.timestamp()) *
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dt), __pyx_n_s_timestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0348:         <int64_t>(1000000) +
  __pyx_r = ((((int64_t)__pyx_t_4) * ((int64_t)0xF4240)) + ((int64_t)__pyx_t_5));
  goto __pyx_L0;
+0349:         <int64_t>(dt.microsecond))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dt), __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 0350: 
 0351: 
+0352: cdef int64_t datetime_to_nanos(datetime dt):
static int64_t __pyx_f_7questdb_7ingress_datetime_to_nanos(PyDateTime_DateTime *__pyx_v_dt) {
  int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_to_nanos", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("questdb.ingress.datetime_to_nanos", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0353:     """
 0354:     Convert a `datetime.datetime` to nanoseconds since the epoch.
 0355:     """
 0356:     return (
+0357:         <int64_t>(dt.timestamp()) *
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dt), __pyx_n_s_timestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+0358:         <int64_t>(1000000000) +
  __pyx_r = ((((int64_t)__pyx_t_4) * ((int64_t)0x3B9ACA00)) + ((int64_t)__pyx_t_5));
  goto __pyx_L0;
+0359:         <int64_t>(dt.microsecond * 1000))
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dt), __pyx_n_s_microsecond); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_int_1000); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 0360: 
 0361: 
+0362: cdef int64_t _US_SEC = 1000000
  __pyx_v_7questdb_7ingress__US_SEC = 0xF4240;
+0363: cdef int64_t _NS_US = 1000
  __pyx_v_7questdb_7ingress__NS_US = 0x3E8;
 0364: 
 0365: 
+0366: cdef int64_t get_time_now_us() except -1:
static int64_t __pyx_f_7questdb_7ingress_get_time_now_us(void) {
  struct timespec __pyx_v_ts;
  int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_time_now_us", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.get_time_now_us", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0367:     """
 0368:     Get the current time in microseconds.
 0369:     """
 0370:     IF UNAME_SYSNAME == 'Windows':
 0371:         return time.time_ns() // 1000
 0372:     ELSE:
 0373:         # Note: Y2K38 bug on 32-bit systems, but we don't care.
 0374:         cdef timespec ts
+0375:         if clock_gettime(CLOCK_REALTIME, &ts) != 0:
  __pyx_t_1 = ((clock_gettime(CLOCK_REALTIME, (&__pyx_v_ts)) != 0) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0376:             raise OSError(errno, 'clock_gettime(CLOCK_REALTIME, &ts) failed')
    __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __Pyx_INCREF(__pyx_kp_u_clock_gettime_CLOCK_REALTIME_ts);
    __Pyx_GIVEREF(__pyx_kp_u_clock_gettime_CLOCK_REALTIME_ts);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u_clock_gettime_CLOCK_REALTIME_ts);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 376, __pyx_L1_error)
+0377:         return <int64_t>(ts.tv_sec) * _US_SEC + <int64_t>(ts.tv_nsec) // _NS_US
  if (unlikely(__pyx_v_7questdb_7ingress__NS_US == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(0, 377, __pyx_L1_error)
  }
  else if (sizeof(int64_t) == sizeof(long) && (!(((int64_t)-1) > 0)) && unlikely(__pyx_v_7questdb_7ingress__NS_US == (int64_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(((int64_t)__pyx_v_ts.tv_nsec)))) {
    PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
    __PYX_ERR(0, 377, __pyx_L1_error)
  }
  __pyx_r = ((((int64_t)__pyx_v_ts.tv_sec) * __pyx_v_7questdb_7ingress__US_SEC) + __Pyx_div_int64_t(((int64_t)__pyx_v_ts.tv_nsec), __pyx_v_7questdb_7ingress__NS_US));
  goto __pyx_L0;
 0378: 
 0379: 
+0380: cdef int64_t _NS_SEC = 1000000000
  __pyx_v_7questdb_7ingress__NS_SEC = 0x3B9ACA00;
 0381: 
 0382: 
+0383: cdef int64_t get_time_now_ns() except -1:
static int64_t __pyx_f_7questdb_7ingress_get_time_now_ns(void) {
  struct timespec __pyx_v_ts;
  int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_time_now_ns", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.get_time_now_ns", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1L;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0384:     """
 0385:     Get the current time in nanoseconds.
 0386:     """
 0387:     IF UNAME_SYSNAME == 'Windows':
 0388:         return time.time_ns()
 0389:     ELSE:
 0390:         # Note: Y2K38 bug on 32-bit systems, but we don't care.
 0391:         cdef timespec ts
+0392:         if clock_gettime(CLOCK_REALTIME, &ts) != 0:
  __pyx_t_1 = ((clock_gettime(CLOCK_REALTIME, (&__pyx_v_ts)) != 0) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0393:             raise OSError(errno, 'clock_gettime(CLOCK_REALTIME, &ts) failed')
    __pyx_t_2 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __Pyx_INCREF(__pyx_kp_u_clock_gettime_CLOCK_REALTIME_ts);
    __Pyx_GIVEREF(__pyx_kp_u_clock_gettime_CLOCK_REALTIME_ts);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u_clock_gettime_CLOCK_REALTIME_ts);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 393, __pyx_L1_error)
+0394:         return <int64_t>(ts.tv_sec) * _NS_SEC + <int64_t>(ts.tv_nsec)
  __pyx_r = ((((int64_t)__pyx_v_ts.tv_sec) * __pyx_v_7questdb_7ingress__NS_SEC) + ((int64_t)__pyx_v_ts.tv_nsec));
  goto __pyx_L0;
 0395: 
 0396: 
+0397: cdef class TimestampMicros:
struct __pyx_obj_7questdb_7ingress_TimestampMicros {
  PyObject_HEAD
  int64_t _value;
};

 0398:     """
 0399:     A timestamp in microseconds since the UNIX epoch (UTC).
 0400: 
 0401:     You may construct a ``TimestampMicros`` from an integer or a
 0402:     ``datetime.datetime``, or simply call the :func:`TimestampMicros.now`
 0403:     method.
 0404: 
 0405:     .. code-block:: python
 0406: 
 0407:         # Recommended way to get the current timestamp.
 0408:         TimestampMicros.now()
 0409: 
 0410:         # The above is equivalent to:
 0411:         TimestampMicros(time.time_ns() // 1000)
 0412: 
 0413:         # You can provide a numeric timestamp too. It can't be negative.
 0414:         TimestampMicros(1657888365426838)
 0415: 
 0416:     ``TimestampMicros`` can also be constructed from a ``datetime.datetime``
 0417:     object.
 0418: 
 0419:     .. code-block:: python
 0420: 
 0421:         TimestampMicros.from_datetime(
 0422:             datetime.datetime.now(tz=datetime.timezone.utc))
 0423: 
 0424:     We recommend that when using ``datetime`` objects, you explicitly pass in
 0425:     the timezone to use. This is because ``datetime`` objects without an
 0426:     associated timezone are assumed to be in the local timezone and it is easy
 0427:     to make mistakes (e.g. passing ``datetime.datetime.utcnow()`` is a likely
 0428:     bug).
 0429:     """
 0430:     cdef int64_t _value
 0431: 
+0432:     def __cinit__(self, value: int):
/* Python wrapper */
static int __pyx_pw_7questdb_7ingress_15TimestampMicros_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7questdb_7ingress_15TimestampMicros_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 432, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_value = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 432, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("questdb.ingress.TimestampMicros.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7questdb_7ingress_15TimestampMicros___cinit__(((struct __pyx_obj_7questdb_7ingress_TimestampMicros *)__pyx_v_self), __pyx_v_value);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7questdb_7ingress_15TimestampMicros___cinit__(struct __pyx_obj_7questdb_7ingress_TimestampMicros *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.TimestampMicros.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0433:         if value < 0:
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+0434:             raise ValueError('value must be a positive integer.')
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 434, __pyx_L1_error)
/* … */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_value_must_be_a_positive_integer); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);
+0435:         self._value = value
  __pyx_t_3 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_3 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L1_error)
  __pyx_v_self->_value = __pyx_t_3;
 0436: 
+0437:     @classmethod
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampMicros->tp_dict, __pyx_n_s_from_datetime, __pyx_t_1) < 0) __PYX_ERR(0, 438, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_TimestampMicros);
+0438:     def from_datetime(cls, dt: datetime):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_15TimestampMicros_3from_datetime(PyObject *__pyx_v_cls, PyObject *__pyx_v_dt); /*proto*/
static char __pyx_doc_7questdb_7ingress_15TimestampMicros_2from_datetime[] = "\n        Construct a ``TimestampMicros`` from a ``datetime.datetime`` object.\n        ";
static PyMethodDef __pyx_mdef_7questdb_7ingress_15TimestampMicros_3from_datetime = {"from_datetime", (PyCFunction)__pyx_pw_7questdb_7ingress_15TimestampMicros_3from_datetime, METH_O, __pyx_doc_7questdb_7ingress_15TimestampMicros_2from_datetime};
static PyObject *__pyx_pw_7questdb_7ingress_15TimestampMicros_3from_datetime(PyObject *__pyx_v_cls, PyObject *__pyx_v_dt) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_datetime (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dt), __pyx_ptype_7cpython_8datetime_datetime, 1, "dt", 0))) __PYX_ERR(0, 438, __pyx_L1_error)
  __pyx_r = __pyx_pf_7questdb_7ingress_15TimestampMicros_2from_datetime(((PyTypeObject*)__pyx_v_cls), ((PyDateTime_DateTime *)__pyx_v_dt));
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_15TimestampMicros_2from_datetime(PyTypeObject *__pyx_v_cls, PyDateTime_DateTime *__pyx_v_dt) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_datetime", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("questdb.ingress.TimestampMicros.from_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__52 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);
/* … */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dt, __pyx_n_u_datetime) < 0) __PYX_ERR(0, 438, __pyx_L1_error)
  __pyx_t_19 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_15TimestampMicros_3from_datetime, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TimestampMicros_from_datetime, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_19, __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampMicros->tp_dict, __pyx_n_s_from_datetime, __pyx_t_19) < 0) __PYX_ERR(0, 438, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_TimestampMicros);
/* … */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7questdb_7ingress_TimestampMicros, __pyx_n_s_from_datetime); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_from_datetime, 438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 438, __pyx_L1_error)
 0439:         """
 0440:         Construct a ``TimestampMicros`` from a ``datetime.datetime`` object.
 0441:         """
+0442:         if not isinstance(dt, datetime):
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_dt), __pyx_ptype_7cpython_8datetime_datetime); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+0443:             raise TypeError('dt must be a datetime object.')
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 443, __pyx_L1_error)
/* … */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_dt_must_be_a_datetime_object); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);
+0444:         return cls(datetime_to_micros(dt))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_f_7questdb_7ingress_datetime_to_micros(__pyx_v_dt)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_v_cls), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;
 0445: 
+0446:     @classmethod
  __pyx_t_19 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampMicros->tp_dict, __pyx_n_s_now, __pyx_t_19) < 0) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_TimestampMicros);
+0447:     def now(cls):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_15TimestampMicros_5now(PyObject *__pyx_v_cls, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7questdb_7ingress_15TimestampMicros_4now[] = "\n        Construct a ``TimestampMicros`` from the current time as UTC.\n        ";
static PyMethodDef __pyx_mdef_7questdb_7ingress_15TimestampMicros_5now = {"now", (PyCFunction)__pyx_pw_7questdb_7ingress_15TimestampMicros_5now, METH_NOARGS, __pyx_doc_7questdb_7ingress_15TimestampMicros_4now};
static PyObject *__pyx_pw_7questdb_7ingress_15TimestampMicros_5now(PyObject *__pyx_v_cls, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("now (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_15TimestampMicros_4now(((PyTypeObject*)__pyx_v_cls));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_15TimestampMicros_4now(PyTypeObject *__pyx_v_cls) {
  int64_t __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("now", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.TimestampMicros.now", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__54 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_value); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);
/* … */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_15TimestampMicros_5now, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TimestampMicros_now, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampMicros->tp_dict, __pyx_n_s_now, __pyx_t_1) < 0) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_TimestampMicros);
/* … */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_7questdb_7ingress_TimestampMicros, __pyx_n_s_now); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_now, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 447, __pyx_L1_error)
 0448:         """
 0449:         Construct a ``TimestampMicros`` from the current time as UTC.
 0450:         """
+0451:         cdef int64_t value = get_time_now_us()
  __pyx_t_1 = __pyx_f_7questdb_7ingress_get_time_now_us(); if (unlikely(__pyx_t_1 == ((int64_t)-1L))) __PYX_ERR(0, 451, __pyx_L1_error)
  __pyx_v_value = __pyx_t_1;
+0452:         return cls(value)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_v_cls), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;
 0453: 
 0454:     @property
+0455:     def value(self) -> int:
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_15TimestampMicros_5value_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7questdb_7ingress_15TimestampMicros_5value_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_15TimestampMicros_5value___get__(((struct __pyx_obj_7questdb_7ingress_TimestampMicros *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_15TimestampMicros_5value___get__(struct __pyx_obj_7questdb_7ingress_TimestampMicros *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.TimestampMicros.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0456:         """Number of microseconds (Unix epoch timestamp, UTC)."""
+0457:         return self._value
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0458: 
+0459:     def __repr__(self):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_15TimestampMicros_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7questdb_7ingress_15TimestampMicros_7__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_15TimestampMicros_6__repr__(((struct __pyx_obj_7questdb_7ingress_TimestampMicros *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_15TimestampMicros_6__repr__(struct __pyx_obj_7questdb_7ingress_TimestampMicros *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("questdb.ingress.TimestampMicros.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0460:         return f'TimestampMicros.({self._value})'
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_TimestampMicros);
  __pyx_t_2 += 17;
  __Pyx_GIVEREF(__pyx_kp_u_TimestampMicros);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_TimestampMicros);
  __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__10);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__10);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__10);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;
 0461: 
 0462: 
+0463: cdef class TimestampNanos:
struct __pyx_obj_7questdb_7ingress_TimestampNanos {
  PyObject_HEAD
  int64_t _value;
};

 0464:     """
 0465:     A timestamp in nanoseconds since the UNIX epoch (UTC).
 0466: 
 0467:     You may construct a ``TimestampNanos`` from an integer or a
 0468:     ``datetime.datetime``, or simply call the :func:`TimestampNanos.now`
 0469:     method.
 0470: 
 0471:     .. code-block:: python
 0472: 
 0473:         # Recommended way to get the current timestamp.
 0474:         TimestampNanos.now()
 0475: 
 0476:         # The above is equivalent to:
 0477:         TimestampNanos(time.time_ns())
 0478: 
 0479:         # You can provide a numeric timestamp too. It can't be negative.
 0480:         TimestampNanos(1657888365426838016)
 0481: 
 0482:     ``TimestampNanos`` can also be constructed from a ``datetime`` object.
 0483: 
 0484:     .. code-block:: python
 0485: 
 0486:         TimestampNanos.from_datetime(
 0487:             datetime.datetime.now(tz=datetime.timezone.utc))
 0488: 
 0489:     We recommend that when using ``datetime`` objects, you explicitly pass in
 0490:     the timezone to use. This is because ``datetime`` objects without an
 0491:     associated timezone are assumed to be in the local timezone and it is easy
 0492:     to make mistakes (e.g. passing ``datetime.datetime.utcnow()`` is a likely
 0493:     bug).
 0494:     """
 0495:     cdef int64_t _value
 0496: 
+0497:     def __cinit__(self, value: int):
/* Python wrapper */
static int __pyx_pw_7questdb_7ingress_14TimestampNanos_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7questdb_7ingress_14TimestampNanos_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 497, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_value = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 497, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("questdb.ingress.TimestampNanos.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7questdb_7ingress_14TimestampNanos___cinit__(((struct __pyx_obj_7questdb_7ingress_TimestampNanos *)__pyx_v_self), __pyx_v_value);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7questdb_7ingress_14TimestampNanos___cinit__(struct __pyx_obj_7questdb_7ingress_TimestampNanos *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.TimestampNanos.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0498:         if value < 0:
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 498, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+0499:             raise ValueError('value must be a positive integer.')
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 499, __pyx_L1_error)
+0500:         self._value = value
  __pyx_t_3 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_3 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error)
  __pyx_v_self->_value = __pyx_t_3;
 0501: 
+0502:     @classmethod
  __pyx_t_19 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos->tp_dict, __pyx_n_s_from_datetime, __pyx_t_19) < 0) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_TimestampNanos);
+0503:     def from_datetime(cls, dt: datetime):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_14TimestampNanos_3from_datetime(PyObject *__pyx_v_cls, PyObject *__pyx_v_dt); /*proto*/
static char __pyx_doc_7questdb_7ingress_14TimestampNanos_2from_datetime[] = "\n        Construct a ``TimestampNanos`` from a ``datetime.datetime`` object.\n        ";
static PyMethodDef __pyx_mdef_7questdb_7ingress_14TimestampNanos_3from_datetime = {"from_datetime", (PyCFunction)__pyx_pw_7questdb_7ingress_14TimestampNanos_3from_datetime, METH_O, __pyx_doc_7questdb_7ingress_14TimestampNanos_2from_datetime};
static PyObject *__pyx_pw_7questdb_7ingress_14TimestampNanos_3from_datetime(PyObject *__pyx_v_cls, PyObject *__pyx_v_dt) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_datetime (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dt), __pyx_ptype_7cpython_8datetime_datetime, 1, "dt", 0))) __PYX_ERR(0, 503, __pyx_L1_error)
  __pyx_r = __pyx_pf_7questdb_7ingress_14TimestampNanos_2from_datetime(((PyTypeObject*)__pyx_v_cls), ((PyDateTime_DateTime *)__pyx_v_dt));
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_14TimestampNanos_2from_datetime(PyTypeObject *__pyx_v_cls, PyDateTime_DateTime *__pyx_v_dt) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_datetime", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("questdb.ingress.TimestampNanos.from_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__60 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);
/* … */
  __pyx_t_19 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_dt, __pyx_n_u_datetime) < 0) __PYX_ERR(0, 503, __pyx_L1_error)
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_14TimestampNanos_3from_datetime, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TimestampNanos_from_datetime, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_1, __pyx_t_19);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos->tp_dict, __pyx_n_s_from_datetime, __pyx_t_1) < 0) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_TimestampNanos);
/* … */
  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos, __pyx_n_s_from_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_from_datetime, 503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 503, __pyx_L1_error)
 0504:         """
 0505:         Construct a ``TimestampNanos`` from a ``datetime.datetime`` object.
 0506:         """
+0507:         if not isinstance(dt, datetime):
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_dt), __pyx_ptype_7cpython_8datetime_datetime); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+0508:             raise TypeError('dt must be a datetime object.')
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 508, __pyx_L1_error)
+0509:         return cls(datetime_to_nanos(dt))
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_f_7questdb_7ingress_datetime_to_nanos(__pyx_v_dt)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_v_cls), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;
 0510: 
+0511:     @classmethod
  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos->tp_dict, __pyx_n_s_now, __pyx_t_1) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_TimestampNanos);
+0512:     def now(cls):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_14TimestampNanos_5now(PyObject *__pyx_v_cls, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7questdb_7ingress_14TimestampNanos_4now[] = "\n        Construct a ``TimestampNanos`` from the current time as UTC.\n        ";
static PyMethodDef __pyx_mdef_7questdb_7ingress_14TimestampNanos_5now = {"now", (PyCFunction)__pyx_pw_7questdb_7ingress_14TimestampNanos_5now, METH_NOARGS, __pyx_doc_7questdb_7ingress_14TimestampNanos_4now};
static PyObject *__pyx_pw_7questdb_7ingress_14TimestampNanos_5now(PyObject *__pyx_v_cls, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("now (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_14TimestampNanos_4now(((PyTypeObject*)__pyx_v_cls));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_14TimestampNanos_4now(PyTypeObject *__pyx_v_cls) {
  int64_t __pyx_v_value;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("now", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.TimestampNanos.now", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_value); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);
/* … */
  __pyx_t_19 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_14TimestampNanos_5now, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TimestampNanos_now, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos->tp_dict, __pyx_n_s_now, __pyx_t_19) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_TimestampNanos);
/* … */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos, __pyx_n_s_now); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_now, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 512, __pyx_L1_error)
 0513:         """
 0514:         Construct a ``TimestampNanos`` from the current time as UTC.
 0515:         """
+0516:         cdef int64_t value = get_time_now_ns()
  __pyx_t_1 = __pyx_f_7questdb_7ingress_get_time_now_ns(); if (unlikely(__pyx_t_1 == ((int64_t)-1L))) __PYX_ERR(0, 516, __pyx_L1_error)
  __pyx_v_value = __pyx_t_1;
+0517:         return cls(value)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_v_cls), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;
 0518: 
 0519:     @property
+0520:     def value(self) -> int:
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_14TimestampNanos_5value_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7questdb_7ingress_14TimestampNanos_5value_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_14TimestampNanos_5value___get__(((struct __pyx_obj_7questdb_7ingress_TimestampNanos *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_14TimestampNanos_5value___get__(struct __pyx_obj_7questdb_7ingress_TimestampNanos *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.TimestampNanos.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0521:         """Number of nanoseconds (Unix epoch timestamp, UTC)."""
+0522:         return self._value
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0523: 
+0524:     def __repr__(self):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_14TimestampNanos_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7questdb_7ingress_14TimestampNanos_7__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_14TimestampNanos_6__repr__(((struct __pyx_obj_7questdb_7ingress_TimestampNanos *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_14TimestampNanos_6__repr__(struct __pyx_obj_7questdb_7ingress_TimestampNanos *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("questdb.ingress.TimestampNanos.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0525:         return f'TimestampNanos({self.value})'
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_TimestampNanos);
  __pyx_t_2 += 15;
  __Pyx_GIVEREF(__pyx_kp_u_TimestampNanos);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_TimestampNanos);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_INCREF(__pyx_kp_u__10);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__10);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__10);
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;
 0526: 
 0527: 
+0528: cdef class Sender
struct __pyx_obj_7questdb_7ingress_Sender {
  PyObject_HEAD
  struct __pyx_vtabstruct_7questdb_7ingress_Sender *__pyx_vtab;
  PyObject *__weakref__;
  struct line_sender_opts *_opts;
  struct line_sender *_impl;
  struct __pyx_obj_7questdb_7ingress_Buffer *_buffer;
  int _auto_flush_enabled;
  Py_ssize_t _auto_flush_watermark;
  size_t _init_capacity;
  size_t _max_name_len;
};


+0529: cdef class Buffer
struct __pyx_obj_7questdb_7ingress_Buffer {
  PyObject_HEAD
  struct __pyx_vtabstruct_7questdb_7ingress_Buffer *__pyx_vtab;
  struct line_sender_buffer *_impl;
  struct qdb_pystr_buf *_b;
  size_t _init_capacity;
  size_t _max_name_len;
  PyObject *_row_complete_sender;
};

 0530: 
 0531: 
+0532: cdef void_int may_flush_on_row_complete(Buffer buffer, Sender sender) except -1:
static __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_may_flush_on_row_complete(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_buffer, struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_sender) {
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("may_flush_on_row_complete", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.may_flush_on_row_complete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0533:     if sender._auto_flush_enabled:
  __pyx_t_1 = (__pyx_v_sender->_auto_flush_enabled != 0);
  if (__pyx_t_1) {
/* … */
  }
+0534:         if len(buffer) >= sender._auto_flush_watermark:
    __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_buffer)); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 534, __pyx_L1_error)
    __pyx_t_1 = ((__pyx_t_2 >= __pyx_v_sender->_auto_flush_watermark) != 0);
    if (__pyx_t_1) {
/* … */
    }
+0535:             sender.flush(buffer)
      __pyx_t_4.__pyx_n = 1;
      __pyx_t_4.buffer = __pyx_v_buffer;
      __pyx_t_3 = ((struct __pyx_vtabstruct_7questdb_7ingress_Sender *)__pyx_v_sender->__pyx_vtab)->flush(__pyx_v_sender, 0, &__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 0536: 
 0537: 
+0538: cdef class Buffer:
struct __pyx_vtabstruct_7questdb_7ingress_Buffer {
  PyObject *(*_cinit_impl)(struct __pyx_obj_7questdb_7ingress_Buffer *, size_t, size_t);
  PyObject *(*_to_str)(struct __pyx_obj_7questdb_7ingress_Buffer *);
  __pyx_t_7questdb_7ingress_void_int (*_set_marker)(struct __pyx_obj_7questdb_7ingress_Buffer *);
  __pyx_t_7questdb_7ingress_void_int (*_rewind_to_marker)(struct __pyx_obj_7questdb_7ingress_Buffer *);
  PyObject *(*_clear_marker)(struct __pyx_obj_7questdb_7ingress_Buffer *);
  __pyx_t_7questdb_7ingress_void_int (*_table)(struct __pyx_obj_7questdb_7ingress_Buffer *, PyObject *);
  struct qdb_pystr_buf *(*_cleared_b)(struct __pyx_obj_7questdb_7ingress_Buffer *);
  __pyx_t_7questdb_7ingress_void_int (*_symbol)(struct __pyx_obj_7questdb_7ingress_Buffer *, PyObject *, PyObject *);
  __pyx_t_7questdb_7ingress_void_int (*_column_bool)(struct __pyx_obj_7questdb_7ingress_Buffer *, struct line_sender_column_name, int);
  __pyx_t_7questdb_7ingress_void_int (*_column_i64)(struct __pyx_obj_7questdb_7ingress_Buffer *, struct line_sender_column_name, int64_t);
  __pyx_t_7questdb_7ingress_void_int (*_column_f64)(struct __pyx_obj_7questdb_7ingress_Buffer *, struct line_sender_column_name, double);
  __pyx_t_7questdb_7ingress_void_int (*_column_str)(struct __pyx_obj_7questdb_7ingress_Buffer *, struct line_sender_column_name, PyObject *);
  __pyx_t_7questdb_7ingress_void_int (*_column_ts)(struct __pyx_obj_7questdb_7ingress_Buffer *, struct line_sender_column_name, struct __pyx_obj_7questdb_7ingress_TimestampMicros *);
  __pyx_t_7questdb_7ingress_void_int (*_column_dt)(struct __pyx_obj_7questdb_7ingress_Buffer *, struct line_sender_column_name, PyDateTime_DateTime *);
  __pyx_t_7questdb_7ingress_void_int (*_column)(struct __pyx_obj_7questdb_7ingress_Buffer *, PyObject *, PyObject *);
  __pyx_t_7questdb_7ingress_void_int (*_may_trigger_row_complete)(struct __pyx_obj_7questdb_7ingress_Buffer *);
  __pyx_t_7questdb_7ingress_void_int (*_at_ts)(struct __pyx_obj_7questdb_7ingress_Buffer *, struct __pyx_obj_7questdb_7ingress_TimestampNanos *);
  __pyx_t_7questdb_7ingress_void_int (*_at_dt)(struct __pyx_obj_7questdb_7ingress_Buffer *, PyDateTime_DateTime *);
  __pyx_t_7questdb_7ingress_void_int (*_at_now)(struct __pyx_obj_7questdb_7ingress_Buffer *);
  __pyx_t_7questdb_7ingress_void_int (*_at)(struct __pyx_obj_7questdb_7ingress_Buffer *, PyObject *);
  __pyx_t_7questdb_7ingress_void_int (*_row)(struct __pyx_obj_7questdb_7ingress_Buffer *, PyObject *, struct __pyx_opt_args_7questdb_7ingress_6Buffer__row *__pyx_optional_args);
};
static struct __pyx_vtabstruct_7questdb_7ingress_Buffer *__pyx_vtabptr_7questdb_7ingress_Buffer;
 0539:     """
 0540:     Construct QuestDB-flavored InfluxDB Line Protocol (ILP) messages.
 0541: 
 0542:     The :func:`Buffer.row` method is used to add a row to the buffer.
 0543: 
 0544:     You can call this many times.
 0545: 
 0546:     .. code-block:: python
 0547: 
 0548:         from questdb.ingress import Buffer
 0549: 
 0550:         buf = Buffer()
 0551:         buf.row(
 0552:             'table_name1',
 0553:             symbols={'s1', 'v1', 's2', 'v2'},
 0554:             columns={'c1': True, 'c2': 0.5})
 0555: 
 0556:         buf.row(
 0557:             'table_name2',
 0558:             symbols={'questdb': '❤️'},
 0559:             columns={'like': 100000})
 0560: 
 0561:         # Append any additional rows then, once ready, call
 0562:         sender.flush(buffer)  # a `Sender` instance.
 0563: 
 0564:         # The sender auto-cleared the buffer, ready for reuse.
 0565: 
 0566:         buf.row(
 0567:             'table_name1',
 0568:             symbols={'s1', 'v1', 's2', 'v2'},
 0569:             columns={'c1': True, 'c2': 0.5})
 0570: 
 0571:         # etc.
 0572: 
 0573: 
 0574:     Buffer Constructor Arguments:
 0575:       * ``init_capacity`` (``int``): Initial capacity of the buffer in bytes.
 0576:         Defaults to ``65536`` (64KiB).
 0577:       * ``max_name_len`` (``int``): Maximum length of a column name.
 0578:         Defaults to ``127`` which is the same default value as QuestDB.
 0579:         This should match the ``cairo.max.file.name.length`` setting of the
 0580:         QuestDB instance you're connecting to.
 0581: 
 0582:     .. code-block:: python
 0583: 
 0584:         # These two buffer constructions are equivalent.
 0585:         buf1 = Buffer()
 0586:         buf2 = Buffer(init_capacity=65536, max_name_len=127)
 0587: 
 0588:     To avoid having to manually set these arguments every time, you can call
 0589:     the sender's ``new_buffer()`` method instead.
 0590: 
 0591:     .. code-block:: python
 0592: 
 0593:         from questdb.ingress import Sender, Buffer
 0594: 
 0595:         sender = Sender(host='localhost', port=9009,
 0596:             init_capacity=16384, max_name_len=64)
 0597:         buf = sender.new_buffer()
 0598:         assert buf.init_capacity == 16384
 0599:         assert buf.max_name_len == 64
 0600: 
 0601:     """
 0602:     cdef line_sender_buffer* _impl
 0603:     cdef qdb_pystr_buf* _b
 0604:     cdef size_t _init_capacity
 0605:     cdef size_t _max_name_len
 0606:     cdef object _row_complete_sender
 0607: 
+0608:     def __cinit__(self, init_capacity: int=65536, max_name_len: int=127):
/* Python wrapper */
static int __pyx_pw_7questdb_7ingress_6Buffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7questdb_7ingress_6Buffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_init_capacity = 0;
  PyObject *__pyx_v_max_name_len = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_init_capacity,&__pyx_n_s_max_name_len,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_65536);
    values[1] = ((PyObject *)__pyx_int_127);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_capacity);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_name_len);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 608, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_init_capacity = values[0];
    __pyx_v_max_name_len = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 608, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("questdb.ingress.Buffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7questdb_7ingress_6Buffer___cinit__(((struct __pyx_obj_7questdb_7ingress_Buffer *)__pyx_v_self), __pyx_v_init_capacity, __pyx_v_max_name_len);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7questdb_7ingress_6Buffer___cinit__(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, PyObject *__pyx_v_init_capacity, PyObject *__pyx_v_max_name_len) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.Buffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0609:         """
 0610:         Create a new buffer with the an initial capacity and max name length.
 0611:         :param int init_capacity: Initial capacity of the buffer in bytes.
 0612:         :param int max_name_len: Maximum length of a table or column name.
 0613:         """
+0614:         self._cinit_impl(init_capacity, max_name_len)
  __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_init_capacity); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 614, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_max_name_len); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 614, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_7questdb_7ingress_6Buffer__cinit_impl(__pyx_v_self, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 0615: 
+0616:     cdef inline _cinit_impl(self, size_t init_capacity, size_t max_name_len):
static CYTHON_INLINE PyObject *__pyx_f_7questdb_7ingress_6Buffer__cinit_impl(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, size_t __pyx_v_init_capacity, size_t __pyx_v_max_name_len) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_cinit_impl", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0617:         self._impl = line_sender_buffer_with_max_name_len(max_name_len)
  __pyx_v_self->_impl = line_sender_buffer_with_max_name_len(__pyx_v_max_name_len);
+0618:         self._b = qdb_pystr_buf_new()
  __pyx_v_self->_b = qdb_pystr_buf_new();
+0619:         line_sender_buffer_reserve(self._impl, init_capacity)
  line_sender_buffer_reserve(__pyx_v_self->_impl, __pyx_v_init_capacity);
+0620:         self._init_capacity = init_capacity
  __pyx_v_self->_init_capacity = __pyx_v_init_capacity;
+0621:         self._max_name_len = max_name_len
  __pyx_v_self->_max_name_len = __pyx_v_max_name_len;
+0622:         self._row_complete_sender = None
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_row_complete_sender);
  __Pyx_DECREF(__pyx_v_self->_row_complete_sender);
  __pyx_v_self->_row_complete_sender = Py_None;
 0623: 
+0624:     def __dealloc__(self):
/* Python wrapper */
static void __pyx_pw_7questdb_7ingress_6Buffer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7questdb_7ingress_6Buffer_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7questdb_7ingress_6Buffer_2__dealloc__(((struct __pyx_obj_7questdb_7ingress_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7questdb_7ingress_6Buffer_2__dealloc__(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);
/* … */
  /* function exit code */
  __Pyx_RefNannyFinishContext();
}
+0625:         self._row_complete_sender = None
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_row_complete_sender);
  __Pyx_DECREF(__pyx_v_self->_row_complete_sender);
  __pyx_v_self->_row_complete_sender = Py_None;
+0626:         qdb_pystr_buf_free(self._b)
  qdb_pystr_buf_free(__pyx_v_self->_b);
+0627:         line_sender_buffer_free(self._impl)
  line_sender_buffer_free(__pyx_v_self->_impl);
 0628: 
 0629:     @property
+0630:     def init_capacity(self) -> int:
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_13init_capacity_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_13init_capacity_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_6Buffer_13init_capacity___get__(((struct __pyx_obj_7questdb_7ingress_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Buffer_13init_capacity___get__(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.Buffer.init_capacity.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0631:         """
 0632:         The initial capacity of the buffer when first created.
 0633: 
 0634:         This may grow over time, see ``capacity()``.
 0635:         """
+0636:         return self._init_capacity
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_init_capacity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0637: 
 0638:     @property
 0639:     def max_name_len(self) -> int:
 0640:         """Maximum length of a table or column name."""
 0641:         return self._max_name_len
 0642: 
 0643:     @property
+0644:     def max_name_len(self) -> int:
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_12max_name_len_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_12max_name_len_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_6Buffer_12max_name_len___get__(((struct __pyx_obj_7questdb_7ingress_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Buffer_12max_name_len___get__(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.Buffer.max_name_len.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0645:         """Maximum length of a table or column name."""
+0646:         return self._max_name_len
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_max_name_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0647: 
+0648:     def reserve(self, additional: int):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_5reserve(PyObject *__pyx_v_self, PyObject *__pyx_v_additional); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Buffer_4reserve[] = "\n        Ensure the buffer has at least `additional` bytes of future capacity.\n\n        :param int additional: Additional bytes to reserve.\n        ";
static PyMethodDef __pyx_mdef_7questdb_7ingress_6Buffer_5reserve = {"reserve", (PyCFunction)__pyx_pw_7questdb_7ingress_6Buffer_5reserve, METH_O, __pyx_doc_7questdb_7ingress_6Buffer_4reserve};
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_5reserve(PyObject *__pyx_v_self, PyObject *__pyx_v_additional) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reserve (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_6Buffer_4reserve(((struct __pyx_obj_7questdb_7ingress_Buffer *)__pyx_v_self), ((PyObject *)__pyx_v_additional));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Buffer_4reserve(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, PyObject *__pyx_v_additional) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reserve", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.Buffer.reserve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__68 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_additional); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);
/* … */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_additional, __pyx_n_u_int) < 0) __PYX_ERR(0, 648, __pyx_L1_error)
  __pyx_t_19 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_6Buffer_5reserve, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Buffer_reserve, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_19, __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_Buffer->tp_dict, __pyx_n_s_reserve, __pyx_t_19) < 0) __PYX_ERR(0, 648, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_Buffer);
  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_reserve, 648, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 648, __pyx_L1_error)
 0649:         """
 0650:         Ensure the buffer has at least `additional` bytes of future capacity.
 0651: 
 0652:         :param int additional: Additional bytes to reserve.
 0653:         """
+0654:         if additional < 0:
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_additional, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 654, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+0655:             raise ValueError('additional must be non-negative.')
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 655, __pyx_L1_error)
/* … */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_additional_must_be_non_negative); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);
+0656:         line_sender_buffer_reserve(self._impl, additional)
  __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_additional); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L1_error)
  line_sender_buffer_reserve(__pyx_v_self->_impl, __pyx_t_3);
 0657: 
+0658:     def capacity(self) -> int:
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_7capacity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Buffer_6capacity[] = "The current buffer capacity.";
static PyMethodDef __pyx_mdef_7questdb_7ingress_6Buffer_7capacity = {"capacity", (PyCFunction)__pyx_pw_7questdb_7ingress_6Buffer_7capacity, METH_NOARGS, __pyx_doc_7questdb_7ingress_6Buffer_6capacity};
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_7capacity(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("capacity (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_6Buffer_6capacity(((struct __pyx_obj_7questdb_7ingress_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Buffer_6capacity(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("capacity", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.Buffer.capacity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);
/* … */
  __pyx_t_19 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_return, __pyx_n_u_int) < 0) __PYX_ERR(0, 658, __pyx_L1_error)
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_6Buffer_7capacity, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Buffer_capacity, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_1, __pyx_t_19);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_Buffer->tp_dict, __pyx_n_s_capacity, __pyx_t_1) < 0) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_Buffer);
  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_capacity, 658, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 658, __pyx_L1_error)
 0659:         """The current buffer capacity."""
+0660:         return line_sender_buffer_capacity(self._impl)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(line_sender_buffer_capacity(__pyx_v_self->_impl)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0661: 
+0662:     def clear(self):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_9clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Buffer_8clear[] = "\n        Reset the buffer.\n\n        Note that flushing a buffer will (unless otherwise specified)\n        also automatically clear it.\n\n        This method is designed to be called only in conjunction with\n        ``sender.flush(buffer, clear=False)``.\n        ";
static PyMethodDef __pyx_mdef_7questdb_7ingress_6Buffer_9clear = {"clear", (PyCFunction)__pyx_pw_7questdb_7ingress_6Buffer_9clear, METH_NOARGS, __pyx_doc_7questdb_7ingress_6Buffer_8clear};
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_9clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_6Buffer_8clear(((struct __pyx_obj_7questdb_7ingress_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Buffer_8clear(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);
/* … */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_6Buffer_9clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Buffer_clear, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_Buffer->tp_dict, __pyx_n_s_clear, __pyx_t_1) < 0) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_Buffer);
  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_clear, 662, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 662, __pyx_L1_error)
 0663:         """
 0664:         Reset the buffer.
 0665: 
 0666:         Note that flushing a buffer will (unless otherwise specified)
 0667:         also automatically clear it.
 0668: 
 0669:         This method is designed to be called only in conjunction with
 0670:         ``sender.flush(buffer, clear=False)``.
 0671:         """
+0672:         line_sender_buffer_clear(self._impl)
  line_sender_buffer_clear(__pyx_v_self->_impl);
+0673:         qdb_pystr_buf_clear(self._b)
  qdb_pystr_buf_clear(__pyx_v_self->_b);
 0674: 
+0675:     def __len__(self) -> int:
/* Python wrapper */
static Py_ssize_t __pyx_pw_7questdb_7ingress_6Buffer_11__len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Buffer_10__len__[] = "\n        The current number of bytes currently in the buffer.\n\n        Equivalent (but cheaper) to ``len(str(sender))``.\n        ";
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7questdb_7ingress_6Buffer_10__len__;
#endif
static Py_ssize_t __pyx_pw_7questdb_7ingress_6Buffer_11__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_6Buffer_10__len__(((struct __pyx_obj_7questdb_7ingress_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7questdb_7ingress_6Buffer_10__len__(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0676:         """
 0677:         The current number of bytes currently in the buffer.
 0678: 
 0679:         Equivalent (but cheaper) to ``len(str(sender))``.
 0680:         """
+0681:         return line_sender_buffer_size(self._impl)
  __pyx_r = line_sender_buffer_size(__pyx_v_self->_impl);
  goto __pyx_L0;
 0682: 
+0683:     def __str__(self) -> str:
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_13__str__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Buffer_12__str__[] = "Return the constructed buffer as a string. Use for debugging.";
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7questdb_7ingress_6Buffer_12__str__;
#endif
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_13__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_6Buffer_12__str__(((struct __pyx_obj_7questdb_7ingress_Buffer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Buffer_12__str__(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.Buffer.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0684:         """Return the constructed buffer as a string. Use for debugging."""
+0685:         return self._to_str()
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7questdb_7ingress_6Buffer__to_str(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0686: 
+0687:     cdef inline object _to_str(self):
static CYTHON_INLINE PyObject *__pyx_f_7questdb_7ingress_6Buffer__to_str(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self) {
  size_t __pyx_v_size;
  char const *__pyx_v_utf8;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_to_str", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.Buffer._to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0688:         cdef size_t size = 0
  __pyx_v_size = 0;
+0689:         cdef const char* utf8 = line_sender_buffer_peek(self._impl, &size)
  __pyx_v_utf8 = line_sender_buffer_peek(__pyx_v_self->_impl, (&__pyx_v_size));
+0690:         return PyUnicode_FromStringAndSize(utf8, <Py_ssize_t>size)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyUnicode_FromStringAndSize(__pyx_v_utf8, ((Py_ssize_t)__pyx_v_size)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 0691: 
+0692:     cdef inline void_int _set_marker(self) except -1:
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__set_marker(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self) {
  struct line_sender_error *__pyx_v_err;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_marker", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("questdb.ingress.Buffer._set_marker", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0693:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
+0694:         if not line_sender_buffer_set_marker(self._impl, &err):
  __pyx_t_1 = ((!(line_sender_buffer_set_marker(__pyx_v_self->_impl, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0695:             raise c_err_to_py(err)
    __pyx_t_2 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 695, __pyx_L1_error)
 0696: 
+0697:     cdef inline void_int _rewind_to_marker(self) except -1:
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__rewind_to_marker(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self) {
  struct line_sender_error *__pyx_v_err;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_rewind_to_marker", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("questdb.ingress.Buffer._rewind_to_marker", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0698:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
+0699:         if not line_sender_buffer_rewind_to_marker(self._impl, &err):
  __pyx_t_1 = ((!(line_sender_buffer_rewind_to_marker(__pyx_v_self->_impl, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0700:             raise c_err_to_py(err)
    __pyx_t_2 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 700, __pyx_L1_error)
 0701: 
+0702:     cdef inline _clear_marker(self):
static CYTHON_INLINE PyObject *__pyx_f_7questdb_7ingress_6Buffer__clear_marker(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_clear_marker", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0703:         line_sender_buffer_clear_marker(self._impl)
  line_sender_buffer_clear_marker(__pyx_v_self->_impl);
 0704: 
+0705:     cdef inline void_int _table(self, str table_name) except -1:
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__table(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, PyObject *__pyx_v_table_name) {
  struct line_sender_error *__pyx_v_err;
  struct line_sender_table_name __pyx_v_c_table_name;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_table", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.Buffer._table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0706:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
 0707:         cdef line_sender_table_name c_table_name
+0708:         str_to_table_name(
  __pyx_t_1 = __pyx_f_7questdb_7ingress_str_to_table_name(__pyx_f_7questdb_7ingress_6Buffer__cleared_b(__pyx_v_self), ((PyObject *)__pyx_v_table_name), (&__pyx_v_c_table_name)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 708, __pyx_L1_error)
 0709:             self._cleared_b(), <PyObject*>table_name, &c_table_name)
+0710:         if not line_sender_buffer_table(self._impl, c_table_name, &err):
  __pyx_t_2 = ((!(line_sender_buffer_table(__pyx_v_self->_impl, __pyx_v_c_table_name, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+0711:             raise c_err_to_py(err)
    __pyx_t_3 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 711, __pyx_L1_error)
 0712: 
+0713:     cdef inline qdb_pystr_buf* _cleared_b(self):
static CYTHON_INLINE struct qdb_pystr_buf *__pyx_f_7questdb_7ingress_6Buffer__cleared_b(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self) {
  struct qdb_pystr_buf *__pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_cleared_b", 0);
/* … */
  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0714:         qdb_pystr_buf_clear(self._b)
  qdb_pystr_buf_clear(__pyx_v_self->_b);
+0715:         return self._b
  __pyx_r = __pyx_v_self->_b;
  goto __pyx_L0;
 0716: 
+0717:     cdef inline void_int _symbol(self, str name, str value) except -1:
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__symbol(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  struct line_sender_error *__pyx_v_err;
  struct line_sender_column_name __pyx_v_c_name;
  struct line_sender_utf8 __pyx_v_c_value;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_symbol", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.Buffer._symbol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0718:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
 0719:         cdef line_sender_column_name c_name
 0720:         cdef line_sender_utf8 c_value
+0721:         str_to_column_name(self._cleared_b(), name, &c_name)
  __pyx_t_1 = __pyx_f_7questdb_7ingress_str_to_column_name(__pyx_f_7questdb_7ingress_6Buffer__cleared_b(__pyx_v_self), __pyx_v_name, (&__pyx_v_c_name)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 721, __pyx_L1_error)
+0722:         str_to_utf8(self._b, <PyObject*>value, &c_value)
  __pyx_t_1 = __pyx_f_7questdb_7ingress_str_to_utf8(__pyx_v_self->_b, ((PyObject *)__pyx_v_value), (&__pyx_v_c_value)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 722, __pyx_L1_error)
+0723:         if not line_sender_buffer_symbol(self._impl, c_name, c_value, &err):
  __pyx_t_2 = ((!(line_sender_buffer_symbol(__pyx_v_self->_impl, __pyx_v_c_name, __pyx_v_c_value, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+0724:             raise c_err_to_py(err)
    __pyx_t_3 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 724, __pyx_L1_error)
 0725: 
+0726:     cdef inline void_int _column_bool(
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__column_bool(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, struct line_sender_column_name __pyx_v_c_name, int __pyx_v_value) {
  struct line_sender_error *__pyx_v_err;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_column_bool", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("questdb.ingress.Buffer._column_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0727:             self, line_sender_column_name c_name, bint value) except -1:
+0728:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
+0729:         if not line_sender_buffer_column_bool(self._impl, c_name, value, &err):
  __pyx_t_1 = ((!(line_sender_buffer_column_bool(__pyx_v_self->_impl, __pyx_v_c_name, __pyx_v_value, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0730:             raise c_err_to_py(err)
    __pyx_t_2 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 730, __pyx_L1_error)
 0731: 
+0732:     cdef inline void_int _column_i64(
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__column_i64(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, struct line_sender_column_name __pyx_v_c_name, int64_t __pyx_v_value) {
  struct line_sender_error *__pyx_v_err;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_column_i64", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("questdb.ingress.Buffer._column_i64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0733:             self, line_sender_column_name c_name, int64_t value) except -1:
+0734:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
+0735:         if not line_sender_buffer_column_i64(self._impl, c_name, value, &err):
  __pyx_t_1 = ((!(line_sender_buffer_column_i64(__pyx_v_self->_impl, __pyx_v_c_name, __pyx_v_value, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0736:             raise c_err_to_py(err)
    __pyx_t_2 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 736, __pyx_L1_error)
+0737:         return 0
  __pyx_r = 0;
  goto __pyx_L0;
 0738: 
+0739:     cdef inline void_int _column_f64(
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__column_f64(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, struct line_sender_column_name __pyx_v_c_name, double __pyx_v_value) {
  struct line_sender_error *__pyx_v_err;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_column_f64", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("questdb.ingress.Buffer._column_f64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0740:             self, line_sender_column_name c_name, double value) except -1:
+0741:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
+0742:         if not line_sender_buffer_column_f64(self._impl, c_name, value, &err):
  __pyx_t_1 = ((!(line_sender_buffer_column_f64(__pyx_v_self->_impl, __pyx_v_c_name, __pyx_v_value, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0743:             raise c_err_to_py(err)
    __pyx_t_2 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 743, __pyx_L1_error)
 0744: 
+0745:     cdef inline void_int _column_str(
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__column_str(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, struct line_sender_column_name __pyx_v_c_name, PyObject *__pyx_v_value) {
  struct line_sender_error *__pyx_v_err;
  struct line_sender_utf8 __pyx_v_c_value;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_column_str", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.Buffer._column_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0746:             self, line_sender_column_name c_name, str value) except -1:
+0747:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
 0748:         cdef line_sender_utf8 c_value
+0749:         str_to_utf8(self._b, <PyObject*>value, &c_value)
  __pyx_t_1 = __pyx_f_7questdb_7ingress_str_to_utf8(__pyx_v_self->_b, ((PyObject *)__pyx_v_value), (&__pyx_v_c_value)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 749, __pyx_L1_error)
+0750:         if not line_sender_buffer_column_str(self._impl, c_name, c_value, &err):
  __pyx_t_2 = ((!(line_sender_buffer_column_str(__pyx_v_self->_impl, __pyx_v_c_name, __pyx_v_c_value, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_2)) {
/* … */
  }
+0751:             raise c_err_to_py(err)
    __pyx_t_3 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 751, __pyx_L1_error)
 0752: 
+0753:     cdef inline void_int _column_ts(
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__column_ts(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, struct line_sender_column_name __pyx_v_c_name, struct __pyx_obj_7questdb_7ingress_TimestampMicros *__pyx_v_ts) {
  struct line_sender_error *__pyx_v_err;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_column_ts", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("questdb.ingress.Buffer._column_ts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0754:             self, line_sender_column_name c_name, TimestampMicros ts) except -1:
+0755:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
+0756:         if not line_sender_buffer_column_ts(self._impl, c_name, ts._value, &err):
  __pyx_t_1 = ((!(line_sender_buffer_column_ts(__pyx_v_self->_impl, __pyx_v_c_name, __pyx_v_ts->_value, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0757:             raise c_err_to_py(err)
    __pyx_t_2 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 757, __pyx_L1_error)
 0758: 
+0759:     cdef inline void_int _column_dt(
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__column_dt(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, struct line_sender_column_name __pyx_v_c_name, PyDateTime_DateTime *__pyx_v_dt) {
  struct line_sender_error *__pyx_v_err;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_column_dt", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("questdb.ingress.Buffer._column_dt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0760:             self, line_sender_column_name c_name, datetime dt) except -1:
+0761:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
+0762:         if not line_sender_buffer_column_ts(
  __pyx_t_1 = ((!(line_sender_buffer_column_ts(__pyx_v_self->_impl, __pyx_v_c_name, __pyx_f_7questdb_7ingress_datetime_to_micros(__pyx_v_dt), (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
 0763:                 self._impl, c_name, datetime_to_micros(dt), &err):
+0764:             raise c_err_to_py(err)
    __pyx_t_2 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 764, __pyx_L1_error)
 0765: 
+0766:     cdef inline void_int _column(self, str name, object value) except -1:
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__column(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
  struct line_sender_column_name __pyx_v_c_name;
  PyObject *__pyx_v_valid = NULL;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_column", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("questdb.ingress.Buffer._column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_valid);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 0767:         cdef line_sender_column_name c_name
+0768:         str_to_column_name(self._cleared_b(), name, &c_name)
  __pyx_t_1 = __pyx_f_7questdb_7ingress_str_to_column_name(__pyx_f_7questdb_7ingress_6Buffer__cleared_b(__pyx_v_self), __pyx_v_name, (&__pyx_v_c_name)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 768, __pyx_L1_error)
+0769:         if PyBool_Check(<PyObject*>value):
  __pyx_t_2 = (PyBool_Check(((PyObject *)__pyx_v_value)) != 0);
  if (__pyx_t_2) {
/* … */
    goto __pyx_L3;
  }
+0770:             self._column_bool(c_name, value)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 770, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7questdb_7ingress_6Buffer__column_bool(__pyx_v_self, __pyx_v_c_name, __pyx_t_2); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 770, __pyx_L1_error)
+0771:         elif PyLong_CheckExact(<PyObject*>value):
  __pyx_t_2 = (PyLong_CheckExact(((PyObject *)__pyx_v_value)) != 0);
  if (__pyx_t_2) {
/* … */
    goto __pyx_L3;
  }
+0772:             self._column_i64(c_name, value)
    __pyx_t_3 = __Pyx_PyInt_As_int64_t(__pyx_v_value); if (unlikely((__pyx_t_3 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 772, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7questdb_7ingress_6Buffer__column_i64(__pyx_v_self, __pyx_v_c_name, __pyx_t_3); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 772, __pyx_L1_error)
+0773:         elif PyFloat_CheckExact(<PyObject*>value):
  __pyx_t_2 = (PyFloat_CheckExact(((PyObject *)__pyx_v_value)) != 0);
  if (__pyx_t_2) {
/* … */
    goto __pyx_L3;
  }
+0774:             self._column_f64(c_name, value)
    __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 774, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7questdb_7ingress_6Buffer__column_f64(__pyx_v_self, __pyx_v_c_name, __pyx_t_4); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 774, __pyx_L1_error)
+0775:         elif PyUnicode_CheckExact(<PyObject*>value):
  __pyx_t_2 = (PyUnicode_CheckExact(((PyObject *)__pyx_v_value)) != 0);
  if (__pyx_t_2) {
/* … */
    goto __pyx_L3;
  }
+0776:             self._column_str(c_name, value)
    if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 776, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7questdb_7ingress_6Buffer__column_str(__pyx_v_self, __pyx_v_c_name, ((PyObject*)__pyx_v_value)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 776, __pyx_L1_error)
+0777:         elif isinstance(value, TimestampMicros):
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_7questdb_7ingress_TimestampMicros); 
  __pyx_t_5 = (__pyx_t_2 != 0);
  if (__pyx_t_5) {
/* … */
    goto __pyx_L3;
  }
+0778:             self._column_ts(c_name, value)
    if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_7questdb_7ingress_TimestampMicros))))) __PYX_ERR(0, 778, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7questdb_7ingress_6Buffer__column_ts(__pyx_v_self, __pyx_v_c_name, ((struct __pyx_obj_7questdb_7ingress_TimestampMicros *)__pyx_v_value)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 778, __pyx_L1_error)
+0779:         elif isinstance(value, datetime):
  __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_7cpython_8datetime_datetime); 
  __pyx_t_2 = (__pyx_t_5 != 0);
  if (likely(__pyx_t_2)) {
/* … */
    goto __pyx_L3;
  }
+0780:             self._column_dt(c_name, value)
    if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(0, 780, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_7questdb_7ingress_6Buffer__column_dt(__pyx_v_self, __pyx_v_c_name, ((PyDateTime_DateTime *)__pyx_v_value)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 780, __pyx_L1_error)
 0781:         else:
+0782:             valid = ', '.join((
  /*else*/ {
/* … */
    __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__2, __pyx_tuple__35); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 782, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_valid = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;
+0783:                 'bool',
  __pyx_tuple__35 = PyTuple_Pack(6, __pyx_n_u_bool, __pyx_n_u_int, __pyx_n_u_float, __pyx_n_u_str, __pyx_n_u_TimestampMicros_2, __pyx_kp_u_datetime_datetime); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);
 0784:                 'int',
 0785:                 'float',
 0786:                 'str',
 0787:                 'TimestampMicros',
 0788:                 'datetime.datetime'))
+0789:             raise TypeError(
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 789, __pyx_L1_error)
  }
  __pyx_L3:;
+0790:                 f'Unsupported type: {_fqn(type(value))}. Must be one of: {valid}')
    __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 0;
    __pyx_t_8 = 127;
    __Pyx_INCREF(__pyx_kp_u_Unsupported_type);
    __pyx_t_7 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_Unsupported_type);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_Unsupported_type);
    __pyx_t_9 = __pyx_f_7questdb_7ingress__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_value)))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyUnicode_Unicode(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_8;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_INCREF(__pyx_kp_u_Must_be_one_of);
    __pyx_t_7 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_Must_be_one_of);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u_Must_be_one_of);
    __pyx_t_10 = __Pyx_PyUnicode_Unicode(__pyx_v_valid); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_8;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_10);
    __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_6, 4, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 0791: 
+0792:     cdef inline void_int _may_trigger_row_complete(self) except -1:
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__may_trigger_row_complete(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self) {
  CYTHON_UNUSED struct line_sender_error *__pyx_v_err;
  PyObject *__pyx_v_sender;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_may_trigger_row_complete", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.Buffer._may_trigger_row_complete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0793:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
+0794:         cdef PyObject* sender = NULL
  __pyx_v_sender = NULL;
+0795:         if self._row_complete_sender != None:
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->_row_complete_sender, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 795, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {
/* … */
  }
+0796:             sender = PyWeakref_GetObject(self._row_complete_sender)
    __pyx_t_1 = __pyx_v_self->_row_complete_sender;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = PyWeakref_GetObject(__pyx_t_1); if (unlikely(__pyx_t_3 == ((PyObject *)NULL))) __PYX_ERR(0, 796, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_sender = __pyx_t_3;
+0797:             if sender != NULL:
    __pyx_t_2 = ((__pyx_v_sender != NULL) != 0);
    if (__pyx_t_2) {
/* … */
    }
+0798:                 may_flush_on_row_complete(self, <Sender><object>sender)
      __pyx_t_4 = __pyx_f_7questdb_7ingress_may_flush_on_row_complete(__pyx_v_self, ((struct __pyx_obj_7questdb_7ingress_Sender *)__pyx_v_sender)); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 798, __pyx_L1_error)
 0799: 
+0800:     cdef inline void_int _at_ts(self, TimestampNanos ts) except -1:
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__at_ts(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, struct __pyx_obj_7questdb_7ingress_TimestampNanos *__pyx_v_ts) {
  struct line_sender_error *__pyx_v_err;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_at_ts", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("questdb.ingress.Buffer._at_ts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0801:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
+0802:         if not line_sender_buffer_at(self._impl, ts._value, &err):
  __pyx_t_1 = ((!(line_sender_buffer_at(__pyx_v_self->_impl, __pyx_v_ts->_value, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0803:             raise c_err_to_py(err)
    __pyx_t_2 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 803, __pyx_L1_error)
 0804: 
+0805:     cdef inline void_int _at_dt(self, datetime dt) except -1:
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__at_dt(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, PyDateTime_DateTime *__pyx_v_dt) {
  int64_t __pyx_v_value;
  struct line_sender_error *__pyx_v_err;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_at_dt", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("questdb.ingress.Buffer._at_dt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0806:         cdef int64_t value = datetime_to_nanos(dt)
  __pyx_v_value = __pyx_f_7questdb_7ingress_datetime_to_nanos(__pyx_v_dt);
+0807:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
+0808:         if not line_sender_buffer_at(self._impl, value, &err):
  __pyx_t_1 = ((!(line_sender_buffer_at(__pyx_v_self->_impl, __pyx_v_value, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0809:             raise c_err_to_py(err)
    __pyx_t_2 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 809, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 809, __pyx_L1_error)
 0810: 
+0811:     cdef inline void_int _at_now(self) except -1:
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__at_now(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self) {
  struct line_sender_error *__pyx_v_err;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_at_now", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("questdb.ingress.Buffer._at_now", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0812:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
+0813:         if not line_sender_buffer_at_now(self._impl, &err):
  __pyx_t_1 = ((!(line_sender_buffer_at_now(__pyx_v_self->_impl, (&__pyx_v_err)) != 0)) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+0814:             raise c_err_to_py(err)
    __pyx_t_2 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 814, __pyx_L1_error)
 0815: 
+0816:     cdef inline void_int _at(self, object ts) except -1:
static CYTHON_INLINE __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__at(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, PyObject *__pyx_v_ts) {
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_at", 0);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("questdb.ingress.Buffer._at", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+0817:         if ts is None:
  __pyx_t_1 = (__pyx_v_ts == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {
/* … */
    goto __pyx_L3;
  }
+0818:             self._at_now()
    __pyx_t_3 = __pyx_f_7questdb_7ingress_6Buffer__at_now(__pyx_v_self); if (unlikely(__pyx_t_3 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 818, __pyx_L1_error)
+0819:         elif isinstance(ts, TimestampNanos):
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_ts, __pyx_ptype_7questdb_7ingress_TimestampNanos); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {
/* … */
    goto __pyx_L3;
  }
+0820:             self._at_ts(ts)
    if (!(likely(((__pyx_v_ts) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ts, __pyx_ptype_7questdb_7ingress_TimestampNanos))))) __PYX_ERR(0, 820, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7questdb_7ingress_6Buffer__at_ts(__pyx_v_self, ((struct __pyx_obj_7questdb_7ingress_TimestampNanos *)__pyx_v_ts)); if (unlikely(__pyx_t_3 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 820, __pyx_L1_error)
+0821:         elif isinstance(ts, datetime):
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_ts, __pyx_ptype_7cpython_8datetime_datetime); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_2)) {
/* … */
    goto __pyx_L3;
  }
+0822:             self._at_dt(ts)
    if (!(likely(((__pyx_v_ts) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_ts, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(0, 822, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_7questdb_7ingress_6Buffer__at_dt(__pyx_v_self, ((PyDateTime_DateTime *)__pyx_v_ts)); if (unlikely(__pyx_t_3 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 822, __pyx_L1_error)
 0823:         else:
+0824:             raise TypeError(
  /*else*/ {
/* … */
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(0, 824, __pyx_L1_error)
  }
  __pyx_L3:;
+0825:                 f'Unsupported type: {_fqn(type(ts))}. Must be one of: ' +
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_Unsupported_type);
    __pyx_t_5 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_Unsupported_type);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Unsupported_type);
    __pyx_t_7 = __pyx_f_7questdb_7ingress__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_ts)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_kp_u_Must_be_one_of);
    __pyx_t_5 += 18;
    __Pyx_GIVEREF(__pyx_kp_u_Must_be_one_of);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_Must_be_one_of);
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_t_8, __pyx_kp_u_TimestampNanos_datetime_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 0826:                 'TimestampNanos, datetime, None')
 0827: 
+0828:     cdef void_int _row(
static __pyx_t_7questdb_7ingress_void_int __pyx_f_7questdb_7ingress_6Buffer__row(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, PyObject *__pyx_v_table_name, struct __pyx_opt_args_7questdb_7ingress_6Buffer__row *__pyx_optional_args) {
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("questdb.ingress.Buffer._row", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
struct __pyx_opt_args_7questdb_7ingress_6Buffer__row {
  int __pyx_n;
  PyObject *symbols;
  PyObject *columns;
  PyObject *at;
};
 0829:             self,
 0830:             str table_name,
+0831:             dict symbols=None,
  PyObject *__pyx_v_symbols = ((PyObject*)Py_None);
+0832:             dict columns=None,
  PyObject *__pyx_v_columns = ((PyObject*)Py_None);
+0833:             object at=None) except -1:
  PyObject *__pyx_v_at = ((PyObject *)Py_None);
  int __pyx_v_wrote_fields;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_value = NULL;
  __pyx_t_7questdb_7ingress_void_int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_row", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_symbols = __pyx_optional_args->symbols;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_columns = __pyx_optional_args->columns;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_at = __pyx_optional_args->at;
        }
      }
    }
  }
 0834:         """
 0835:         Add a row to the buffer.
 0836:         """
+0837:         cdef bint wrote_fields = False
  __pyx_v_wrote_fields = 0;
+0838:         self._set_marker()
  __pyx_t_1 = __pyx_f_7questdb_7ingress_6Buffer__set_marker(__pyx_v_self); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 838, __pyx_L1_error)
+0839:         try:
  {
    /*try:*/ {
/* … */
    }
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
/* … */
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }
+0840:             self._table(table_name)
      __pyx_t_1 = __pyx_f_7questdb_7ingress_6Buffer__table(__pyx_v_self, __pyx_v_table_name); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 840, __pyx_L3_error)
+0841:             if symbols is not None:
      __pyx_t_5 = (__pyx_v_symbols != ((PyObject*)Py_None));
      __pyx_t_6 = (__pyx_t_5 != 0);
      if (__pyx_t_6) {
/* … */
      }
+0842:                 for name, value in symbols.items():
        __pyx_t_8 = 0;
        if (unlikely(__pyx_v_symbols == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
          __PYX_ERR(0, 842, __pyx_L3_error)
        }
        __pyx_t_11 = __Pyx_dict_iterator(__pyx_v_symbols, 1, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 842, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_XDECREF(__pyx_t_7);
        __pyx_t_7 = __pyx_t_11;
        __pyx_t_11 = 0;
        while (1) {
          __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_9, &__pyx_t_8, &__pyx_t_11, &__pyx_t_12, NULL, __pyx_t_10);
          if (unlikely(__pyx_t_13 == 0)) break;
          if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 842, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_11);
          __pyx_t_11 = 0;
          __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_12);
          __pyx_t_12 = 0;
+0843:                     if value is not None:
          __pyx_t_6 = (__pyx_v_value != Py_None);
          __pyx_t_5 = (__pyx_t_6 != 0);
          if (__pyx_t_5) {
/* … */
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+0844:                         self._symbol(name, value)
            if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(0, 844, __pyx_L3_error)
            if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 844, __pyx_L3_error)
            __pyx_t_1 = __pyx_f_7questdb_7ingress_6Buffer__symbol(__pyx_v_self, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_value)); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 844, __pyx_L3_error)
+0845:                         wrote_fields = True
            __pyx_v_wrote_fields = 1;
+0846:             if columns is not None:
      __pyx_t_5 = (__pyx_v_columns != ((PyObject*)Py_None));
      __pyx_t_6 = (__pyx_t_5 != 0);
      if (__pyx_t_6) {
/* … */
      }
+0847:                 for name, value in columns.items():
        __pyx_t_9 = 0;
        if (unlikely(__pyx_v_columns == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
          __PYX_ERR(0, 847, __pyx_L3_error)
        }
        __pyx_t_12 = __Pyx_dict_iterator(__pyx_v_columns, 1, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_10)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 847, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_XDECREF(__pyx_t_7);
        __pyx_t_7 = __pyx_t_12;
        __pyx_t_12 = 0;
        while (1) {
          __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_8, &__pyx_t_9, &__pyx_t_12, &__pyx_t_11, NULL, __pyx_t_10);
          if (unlikely(__pyx_t_13 == 0)) break;
          if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 847, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_12);
          __pyx_t_12 = 0;
          __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_11);
          __pyx_t_11 = 0;
+0848:                     if value is not None:
          __pyx_t_6 = (__pyx_v_value != Py_None);
          __pyx_t_5 = (__pyx_t_6 != 0);
          if (__pyx_t_5) {
/* … */
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+0849:                         self._column(name, value)
            if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(0, 849, __pyx_L3_error)
            __pyx_t_1 = __pyx_f_7questdb_7ingress_6Buffer__column(__pyx_v_self, ((PyObject*)__pyx_v_name), __pyx_v_value); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 849, __pyx_L3_error)
+0850:                         wrote_fields = True
            __pyx_v_wrote_fields = 1;
+0851:             if wrote_fields:
      __pyx_t_5 = (__pyx_v_wrote_fields != 0);
      if (__pyx_t_5) {
/* … */
        goto __pyx_L17;
      }
+0852:                 self._at(at)
        __pyx_t_1 = __pyx_f_7questdb_7ingress_6Buffer__at(__pyx_v_self, __pyx_v_at); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 852, __pyx_L3_error)
+0853:                 self._clear_marker()
        __pyx_t_7 = __pyx_f_7questdb_7ingress_6Buffer__clear_marker(__pyx_v_self); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 853, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 0854:             else:
+0855:                 self._rewind_to_marker()
      /*else*/ {
        __pyx_t_1 = __pyx_f_7questdb_7ingress_6Buffer__rewind_to_marker(__pyx_v_self); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 855, __pyx_L3_error)
      }
      __pyx_L17:;
+0856:         except:
    /*except:*/ {
      __Pyx_AddTraceback("questdb.ingress.Buffer._row", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_11, &__pyx_t_12) < 0) __PYX_ERR(0, 856, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GOTREF(__pyx_t_12);
+0857:             self._rewind_to_marker()
      __pyx_t_1 = __pyx_f_7questdb_7ingress_6Buffer__rewind_to_marker(__pyx_v_self); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 857, __pyx_L5_except_error)
+0858:             raise
      __Pyx_GIVEREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_11, __pyx_t_12);
      __pyx_t_7 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; 
      __PYX_ERR(0, 858, __pyx_L5_except_error)
    }
    __pyx_L5_except_error:;
+0859:         if wrote_fields:
  __pyx_t_5 = (__pyx_v_wrote_fields != 0);
  if (__pyx_t_5) {
/* … */
  }
+0860:             self._may_trigger_row_complete()
    __pyx_t_1 = __pyx_f_7questdb_7ingress_6Buffer__may_trigger_row_complete(__pyx_v_self); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 860, __pyx_L1_error)
 0861: 
+0862:     def row(
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_15row(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Buffer_14row[] = "\n        Add a single row (line) to the buffer.\n\n        .. code-block:: python\n\n            # All fields specified.\n            buffer.row(\n                'table_name',\n                symbols={'sym1': 'abc', 'sym2': 'def', 'sym3': None},\n                columns={\n                    'col1': True,\n                    'col2': 123,\n                    'col3': 3.14,\n                    'col4': 'xyz',\n                    'col5': TimestampMicros(123456789),\n                    'col6': datetime(2019, 1, 1, 12, 0, 0),\n                    'col7': None},\n                at=TimestampNanos(123456789))\n\n            # Only symbols specified. Designated timestamp assigned by the db.\n            buffer.row(\n                'table_name',\n                symbols={'sym1': 'abc', 'sym2': 'def'})\n\n            # Float columns and timestamp specified as `datetime.datetime`.\n            # Pay special attention to the timezone, which if unspecified is\n            # assumed to be the local timezone (and not UTC).\n            buffer.row(\n                'sensor data',\n                columns={\n                    'temperature': 24.5,\n                    'humidity': 0.5},\n                at=datetime.datetime.now(tz=datetime.timezone.utc))\n\n\n        Python strings passed as values to ``symbols`` are going to be encoded\n        as the ``SYMBOL`` type in QuestDB, whilst Python strings passed as\n        values to ``columns`` are going to be encoded as the ``STRING`` type.\n\n        Refer to the\n        `QuestDB documentation <https://questdb.io/docs/concept/symbol/>`_ to\n        understand the difference between the ``SYMBOL`` and ``STRING`` types\n        (TL;DR: symbols are interned strings).\n\n        Column values can be specified with Python types directly and map as so:\n\n        .. list-table::\n            :header-rows: 1\n\n            * - Python type\n              - Serialized as ILP type\n            * - ``bool``\n              - `BOOLEAN <h""ttps://questdb.io/docs/reference/api/ilp/columnset-types#boolean>`_\n            * - ``int``\n              - `INTEGER <https://questdb.io/docs/reference/api/ilp/columnset-types#integer>`_\n            * - ``float``\n              - `FLOAT <https://questdb.io/docs/reference/api/ilp/columnset-types#float>`_\n            * - ``str``\n              - `STRING <https://questdb.io/docs/reference/api/ilp/columnset-types#string>`_\n            * - ``datetime.datetime`` and ``TimestampMicros``\n              - `TIMESTAMP <https://questdb.io/docs/reference/api/ilp/columnset-types#timestamp>`_\n            * - ``None``\n              - *Column is skipped and not serialized.*\n\n        If the destination table was already created, then the columns types\n        will be cast to the types of the existing columns whenever possible\n        (Refer to the QuestDB documentation pages linked above).\n\n        :param table_name: The name of the table to which the row belongs.\n        :param symbols: A dictionary of symbol column names to ``str`` values.\n            As a convenience, you can also pass a ``None`` value which will\n            have the same effect as skipping the key: If the column already\n            existed, it will be recorded as ``NULL``, otherwise it will not be\n            created.\n        :param columns: A dictionary of column names to ``bool``, ``int``,\n            ``float``, ``str``, ``TimestampMicros`` or ``datetime`` values.\n            As a convenience, you can also pass a ``None`` value which will\n            have the same effect as skipping the key: If the column already\n            existed, it will be recorded as ``NULL``, otherwise it will not be\n            created.\n        :param at: The timestamp of the row. If ``None``, timestamp is assigned\n            by the server. If ``datetime``, the timestamp is converted to\n            nanoseconds. A nanosecond unix epoch timestamp can be passed\n            explicitly as a ``TimestampNanos`` obj""ect.\n        ";
static PyMethodDef __pyx_mdef_7questdb_7ingress_6Buffer_15row = {"row", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7questdb_7ingress_6Buffer_15row, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7questdb_7ingress_6Buffer_14row};
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_15row(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_table_name = 0;
  PyObject *__pyx_v_symbols = 0;
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_v_at = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("row (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_table_name,&__pyx_n_s_symbols,&__pyx_n_s_columns,&__pyx_n_s_at,0};
    PyObject* values[4] = {0,0,0,0};
/* … */
  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Buffer_14row(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, PyObject *__pyx_v_table_name, PyObject *__pyx_v_symbols, PyObject *__pyx_v_columns, PyObject *__pyx_v_at) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("row", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("questdb.ingress.Buffer.row", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__74 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_table_name, __pyx_n_s_symbols, __pyx_n_s_columns, __pyx_n_s_at); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);
/* … */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_table_name, __pyx_n_u_unicode) < 0) __PYX_ERR(0, 862, __pyx_L1_error)
/* … */
  __pyx_t_16 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_6Buffer_15row, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Buffer_row, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_16, __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_Buffer->tp_dict, __pyx_n_s_row, __pyx_t_16) < 0) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_Buffer);
  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(2, 3, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_row, 862, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 862, __pyx_L1_error)
 0863:             self,
 0864:             table_name: str,
 0865:             *,
+0866:             symbols: Optional[Dict[str, Optional[str]]]=None,
    values[1] = ((PyObject *)Py_None);
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_Optional); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_Dict); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_Optional); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_16, ((PyObject *)(&PyUnicode_Type))); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
  PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(__pyx_t_18);
  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_18);
  __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_t_16); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_18); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_symbols, __pyx_t_16) < 0) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+0867:             columns: Optional[Dict[
  __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_Optional); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_Dict); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
/* … */
  __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
  PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_15);
  __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_17); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_columns, __pyx_t_17) < 0) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
 0868:                 str,
+0869:                 Union[None, bool, int, float, str, TimestampMicros, datetime]]
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_Union); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_17 = PyTuple_New(7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_17, 0, Py_None);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7cpython_4bool_bool));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7cpython_4bool_bool));
  PyTuple_SET_ITEM(__pyx_t_17, 1, ((PyObject *)__pyx_ptype_7cpython_4bool_bool));
  __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
  PyTuple_SET_ITEM(__pyx_t_17, 2, ((PyObject *)(&PyInt_Type)));
  __Pyx_INCREF(((PyObject *)(&PyFloat_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyFloat_Type)));
  PyTuple_SET_ITEM(__pyx_t_17, 3, ((PyObject *)(&PyFloat_Type)));
  __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
  PyTuple_SET_ITEM(__pyx_t_17, 4, ((PyObject *)(&PyUnicode_Type)));
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampMicros));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampMicros));
  PyTuple_SET_ITEM(__pyx_t_17, 5, ((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampMicros));
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  PyTuple_SET_ITEM(__pyx_t_17, 6, ((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_17); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+0870:                 ]=None,
    values[2] = ((PyObject *)Py_None);
+0871:             at: Union[None, TimestampNanos, datetime]=None):
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (kw_args > 0 && likely(kw_args <= 3)) {
        Py_ssize_t index;
        for (index = 1; index < 4 && kw_args > 0; index++) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
          if (value) { values[index] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "row") < 0)) __PYX_ERR(0, 862, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_table_name = ((PyObject*)values[0]);
    __pyx_v_symbols = values[1];
    __pyx_v_columns = values[2];
    __pyx_v_at = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("row", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 862, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("questdb.ingress.Buffer.row", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table_name), (&PyUnicode_Type), 1, "table_name", 1))) __PYX_ERR(0, 864, __pyx_L1_error)
  __pyx_r = __pyx_pf_7questdb_7ingress_6Buffer_14row(((struct __pyx_obj_7questdb_7ingress_Buffer *)__pyx_v_self), __pyx_v_table_name, __pyx_v_symbols, __pyx_v_columns, __pyx_v_at);
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_Union); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_15, 0, Py_None);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos));
  PyTuple_SET_ITEM(__pyx_t_15, 1, ((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos));
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  PyTuple_SET_ITEM(__pyx_t_15, 2, ((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_at, __pyx_t_16) < 0) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
 0872:         """
 0873:         Add a single row (line) to the buffer.
 0874: 
 0875:         .. code-block:: python
 0876: 
 0877:             # All fields specified.
 0878:             buffer.row(
 0879:                 'table_name',
 0880:                 symbols={'sym1': 'abc', 'sym2': 'def', 'sym3': None},
 0881:                 columns={
 0882:                     'col1': True,
 0883:                     'col2': 123,
 0884:                     'col3': 3.14,
 0885:                     'col4': 'xyz',
 0886:                     'col5': TimestampMicros(123456789),
 0887:                     'col6': datetime(2019, 1, 1, 12, 0, 0),
 0888:                     'col7': None},
 0889:                 at=TimestampNanos(123456789))
 0890: 
 0891:             # Only symbols specified. Designated timestamp assigned by the db.
 0892:             buffer.row(
 0893:                 'table_name',
 0894:                 symbols={'sym1': 'abc', 'sym2': 'def'})
 0895: 
 0896:             # Float columns and timestamp specified as `datetime.datetime`.
 0897:             # Pay special attention to the timezone, which if unspecified is
 0898:             # assumed to be the local timezone (and not UTC).
 0899:             buffer.row(
 0900:                 'sensor data',
 0901:                 columns={
 0902:                     'temperature': 24.5,
 0903:                     'humidity': 0.5},
 0904:                 at=datetime.datetime.now(tz=datetime.timezone.utc))
 0905: 
 0906: 
 0907:         Python strings passed as values to ``symbols`` are going to be encoded
 0908:         as the ``SYMBOL`` type in QuestDB, whilst Python strings passed as
 0909:         values to ``columns`` are going to be encoded as the ``STRING`` type.
 0910: 
 0911:         Refer to the
 0912:         `QuestDB documentation <https://questdb.io/docs/concept/symbol/>`_ to
 0913:         understand the difference between the ``SYMBOL`` and ``STRING`` types
 0914:         (TL;DR: symbols are interned strings).
 0915: 
 0916:         Column values can be specified with Python types directly and map as so:
 0917: 
 0918:         .. list-table::
 0919:             :header-rows: 1
 0920: 
 0921:             * - Python type
 0922:               - Serialized as ILP type
 0923:             * - ``bool``
 0924:               - `BOOLEAN <https://questdb.io/docs/reference/api/ilp/columnset-types#boolean>`_
 0925:             * - ``int``
 0926:               - `INTEGER <https://questdb.io/docs/reference/api/ilp/columnset-types#integer>`_
 0927:             * - ``float``
 0928:               - `FLOAT <https://questdb.io/docs/reference/api/ilp/columnset-types#float>`_
 0929:             * - ``str``
 0930:               - `STRING <https://questdb.io/docs/reference/api/ilp/columnset-types#string>`_
 0931:             * - ``datetime.datetime`` and ``TimestampMicros``
 0932:               - `TIMESTAMP <https://questdb.io/docs/reference/api/ilp/columnset-types#timestamp>`_
 0933:             * - ``None``
 0934:               - *Column is skipped and not serialized.*
 0935: 
 0936:         If the destination table was already created, then the columns types
 0937:         will be cast to the types of the existing columns whenever possible
 0938:         (Refer to the QuestDB documentation pages linked above).
 0939: 
 0940:         :param table_name: The name of the table to which the row belongs.
 0941:         :param symbols: A dictionary of symbol column names to ``str`` values.
 0942:             As a convenience, you can also pass a ``None`` value which will
 0943:             have the same effect as skipping the key: If the column already
 0944:             existed, it will be recorded as ``NULL``, otherwise it will not be
 0945:             created.
 0946:         :param columns: A dictionary of column names to ``bool``, ``int``,
 0947:             ``float``, ``str``, ``TimestampMicros`` or ``datetime`` values.
 0948:             As a convenience, you can also pass a ``None`` value which will
 0949:             have the same effect as skipping the key: If the column already
 0950:             existed, it will be recorded as ``NULL``, otherwise it will not be
 0951:             created.
 0952:         :param at: The timestamp of the row. If ``None``, timestamp is assigned
 0953:             by the server. If ``datetime``, the timestamp is converted to
 0954:             nanoseconds. A nanosecond unix epoch timestamp can be passed
 0955:             explicitly as a ``TimestampNanos`` object.
 0956:         """
+0957:         self._row(table_name, symbols, columns, at)
  if (!(likely(PyDict_CheckExact(__pyx_v_symbols))||((__pyx_v_symbols) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_symbols)->tp_name), 0))) __PYX_ERR(0, 957, __pyx_L1_error)
  if (!(likely(PyDict_CheckExact(__pyx_v_columns))||((__pyx_v_columns) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_columns)->tp_name), 0))) __PYX_ERR(0, 957, __pyx_L1_error)
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.symbols = ((PyObject*)__pyx_v_symbols);
  __pyx_t_2.columns = ((PyObject*)__pyx_v_columns);
  __pyx_t_2.at = __pyx_v_at;
  __pyx_t_1 = ((struct __pyx_vtabstruct_7questdb_7ingress_Buffer *)__pyx_v_self->__pyx_vtab)->_row(__pyx_v_self, __pyx_v_table_name, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 957, __pyx_L1_error)
+0958:         return self
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;
 0959: 
+0960:     def dataframe(
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_17dataframe(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Buffer_16dataframe[] = "\n        Add a pandas DataFrame to the buffer.\n\n        Also see the :func:`Sender.dataframe` method if you're\n        not using the buffer explicitly. It supports the same parameters\n        and also supports auto-flushing.\n\n        This feature requires the ``pandas``, ``numpy`` and ``pyarrow``\n        package to be installed.\n\n        :param df: The pandas DataFrame to serialize to the buffer.\n        :type df: pandas.DataFrame\n\n        :param table_name: The name of the table to which the rows belong.\n\n            If ``None``, the table name is taken from the ``table_name_col``\n            parameter. If both ``table_name`` and ``table_name_col`` are\n            ``None``, the table name is taken from the DataFrame's index\n            name (``df.index.name`` attribute).\n        :type table_name: str or None\n\n        :param table_name_col: The name or index of the column in the DataFrame\n            that contains the table name.\n            \n            If ``None``, the table name is taken\n            from the ``table_name`` parameter. If both ``table_name`` and\n            ``table_name_col`` are ``None``, the table name is taken from the\n            DataFrame's index name (``df.index.name`` attribute).\n\n            If ``table_name_col`` is an integer, it is interpreted as the index\n            of the column starting from ``0``. The index of the column can be\n            negative, in which case it is interpreted as an offset from the end\n            of the DataFrame. E.g. ``-1`` is the last column.\n        :type table_name_col: str or int or None\n\n        :param symbols: The columns to be serialized as symbols.\n        \n            If ``'auto'`` (default), all columns of dtype ``'categorical'`` are\n            serialized as symbols. If ``True``, all ``str`` columns are\n            serialized as symbols. If ``False``, no columns are serialized as\n            symbols.\n            \n            The list of symbols can also be s""pecified explicitly as a ``list``\n            of column names (``str``) or indices (``int``). Integer indices\n            start at ``0`` and can be negative, offset from the end of the\n            DataFrame. E.g. ``-1`` is the last column.\n\n            Only columns containing strings can be serialized as symbols.\n\n        :type symbols: str or bool or list of str or list of int\n\n        :param at: The designated timestamp of the rows.\n        \n            You can specify a single value for all rows or column name or index.\n            If ``None``, timestamp is assigned by the server for all rows.\n            To pass in a timestamp explicity as an integer use the\n            ``TimestampNanos`` wrapper type. To get the current timestamp,\n            use ``TimestampNanos.now()``.\n            When passing a ``datetime.datetime`` object, the timestamp is\n            converted to nanoseconds.\n            A ``datetime`` object is assumed to be in the local timezone unless\n            one is specified explicitly (so call\n            ``datetime.datetime.now(tz=datetime.timezone.utc)`` instead\n            of ``datetime.datetime.utcnow()`` for the current timestamp to\n            avoid bugs).\n\n            To specify a different timestamp for each row, pass in a column name\n            (``str``) or index (``int``, 0-based index, negative index\n            supported): In this case, the column needs to be of dtype\n            ``datetime64[ns]`` (assumed to be in the **UTC timezone** and not\n            local, due to differences in Pandas and Python datetime handling) or\n            ``datetime64[ns, tz]``. When a timezone is specified in the column,\n            it is converted to UTC automatically.\n\n            A timestamp column can also contain ``None`` values. The server will\n            assign the current timestamp to those rows.\n\n            **Note**: All timestamps are always converted to nanoseconds and in\n            the UTC timezone. Ti""mezone information is dropped before sending and\n            QuestDB will not store any timezone information.\n        :type at: TimestampNanos, datetime.datetime, int or str or None\n\n        **Note**: It is an error to specify both ``table_name`` and\n        ``table_name_col``.\n\n        **Note**: The \"index\" column of the DataFrame is never serialized,\n        even if it is named.\n\n        Example:\n\n        .. code-block:: python\n\n            import pandas as pd\n            import questdb.ingress as qi\n\n            buf = qi.Buffer()\n            # ...\n\n            df = pd.DataFrame({\n                'location': ['London', 'Managua', 'London'],\n                'temperature': [24.5, 35.0, 25.5],\n                'humidity': [0.5, 0.6, 0.45],\n                'ts': pd.date_range('2021-07-01', periods=3)})\n            buf.dataframe(\n                df, table_name='weather', at='ts', symbols=['location'])\n\n            # ...\n            sender.flush(buf)\n\n        **Pandas to ILP datatype mappings**\n\n        .. seealso:: https://questdb.io/docs/reference/api/ilp/columnset-types/\n\n        .. list-table:: Pandas Mappings\n            :header-rows: 1\n\n            * - Pandas ``dtype``\n              - Nulls\n              - ILP Datatype\n            * - ``'bool'``\n              - N\n              - ``BOOLEAN``\n            * - ``'boolean'``\n              - N **\316\261**\n              - ``BOOLEAN``\n            * - ``'object'`` (``bool`` objects)\n              - N **\316\261**\n              - ``BOOLEAN``\n            * - ``'uint8'``\n              - N\n              - ``INTEGER``\n            * - ``'int8'``\n              - N\n              - ``INTEGER``\n            * - ``'uint16'``\n              - N\n              - ``INTEGER``\n            * - ``'int16'``\n              - N\n              - ``INTEGER``\n            * - ``'uint32'``\n              - N\n              - ``INTEGER``\n            * - ``'int32'``\n              - N\n     ""         - ``INTEGER``\n            * - ``'uint64'``\n              - N\n              - ``INTEGER`` **\316\262**\n            * - ``'int64'``\n              - N\n              - ``INTEGER``\n            * - ``'UInt8'``\n              - Y\n              - ``INTEGER``\n            * - ``'Int8'``\n              - Y\n              - ``INTEGER``\n            * - ``'UInt16'``\n              - Y\n              - ``INTEGER``\n            * - ``'Int16'``\n              - Y\n              - ``INTEGER``\n            * - ``'UInt32'``\n              - Y\n              - ``INTEGER``\n            * - ``'Int32'``\n              - Y\n              - ``INTEGER``\n            * - ``'UInt64'``\n              - Y\n              - ``INTEGER`` **\316\262**\n            * - ``'Int64'``\n              - Y\n              - ``INTEGER``\n            * - ``'object'`` (``int`` objects)\n              - Y\n              - ``INTEGER`` **\316\262**\n            * - ``'float32'`` **\316\263**\n              - Y (``NaN``)\n              - ``FLOAT``\n            * - ``'float64'``\n              - Y (``NaN``)\n              - ``FLOAT``\n            * - ``'object'`` (``float`` objects)\n              - Y (``NaN``)\n              - ``FLOAT``\n            * - ``'string'`` (``str`` objects)\n              - Y\n              - ``STRING`` (default), ``SYMBOL`` via ``symbols`` arg. **\316\264**\n            * - ``'string[pyarrow]'``\n              - Y\n              - ``STRING`` (default), ``SYMBOL`` via ``symbols`` arg. **\316\264**\n            * - ``'category'`` (``str`` objects) **\316\265**\n              - Y\n              - ``SYMBOL`` (default), ``STRING`` via ``symbols`` arg. **\316\264**\n            * - ``'object'`` (``str`` objects)\n              - Y\n              - ``STRING`` (default), ``SYMBOL`` via ``symbols`` arg. **\316\264**\n            * - ``'datetime64[ns]'``\n              - Y\n              - ``TIMESTAMP`` **\316\266**\n            * - ``'datetime64[ns, tz]'``\n              - Y\n   ""           - ``TIMESTAMP`` **\316\266**\n\n        .. note::\n\n            * **\316\261**: Note some pandas dtypes allow nulls (e.g. ``'boolean'``),\n              where the QuestDB database does not.\n\n            * **\316\262**: The valid range for integer values is -2^63 to 2^63-1.\n              Any ``'uint64'``, ``'UInt64'`` or python ``int`` object values\n              outside this range will raise an error during serialization.\n\n            * **\316\263**: Upcast to 64-bit float during serialization.\n\n            * **\316\264**: Columns containing strings can also be used to specify the\n              table name. See ``table_name_col``.\n\n            * **\316\265**: We only support categories containing strings. If the\n              category contains non-string values, an error will be raised.\n\n            * **\316\266**: The '.dataframe()' method only supports datetimes with\n              nanosecond precision. The designated timestamp column (see ``at``\n              parameter) maintains the nanosecond precision, whilst values\n              stored as columns have their precision truncated to microseconds.\n              All dates are sent as UTC and any additional timezone information\n              is dropped. If no timezone is specified, we follow\n              the pandas convention of assuming the timezone is UTC.\n              Datetimes before 1970-01-01 00:00:00 UTC are not supported.\n              If a datetime value is specified as ``None`` (``NaT``), it is\n              interpreted as the current QuestDB server time set on receipt of\n              message.\n\n        **Error Handling and Recovery**\n\n        In case an exception is raised during dataframe serialization, the\n        buffer is left in its previous state.\n        The buffer remains in a valid state and can be used for further calls\n        even after an error.\n\n        For clarification, as an example, if an invalid ``None``\n        value appears at the 3rd row"" for a ``bool`` column, neither the 3rd nor\n        the preceding rows are added to the buffer.\n\n        **Note**: This differs from the :func:`Sender.dataframe` method, which\n        modifies this guarantee due to its ``auto_flush`` logic.\n\n        **Performance Considerations**\n\n        The Python GIL is released during serialization if it is not needed.\n        If any column requires the GIL, the entire serialization is done whilst\n        holding the GIL.\n\n        Column types that require the GIL are:\n\n        * Columns of ``str``, ``float`` or ``int`` or ``float`` Python objects.\n        * The ``'string[python]'`` dtype.\n        ";
static PyMethodDef __pyx_mdef_7questdb_7ingress_6Buffer_17dataframe = {"dataframe", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7questdb_7ingress_6Buffer_17dataframe, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7questdb_7ingress_6Buffer_16dataframe};
static PyObject *__pyx_pw_7questdb_7ingress_6Buffer_17dataframe(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_df = 0;
  PyObject *__pyx_v_table_name = 0;
  PyObject *__pyx_v_table_name_col = 0;
  PyObject *__pyx_v_symbols = 0;
  PyObject *__pyx_v_at = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dataframe (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_table_name,&__pyx_n_s_table_name_col,&__pyx_n_s_symbols,&__pyx_n_s_at,0};
    PyObject* values[5] = {0,0,0,0,0};
/* … */
  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Buffer_16dataframe(struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_self, PyObject *__pyx_v_df, PyObject *__pyx_v_table_name, PyObject *__pyx_v_table_name_col, PyObject *__pyx_v_symbols, PyObject *__pyx_v_at) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dataframe", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("questdb.ingress.Buffer.dataframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__76 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_df, __pyx_n_s_table_name, __pyx_n_s_table_name_col, __pyx_n_s_symbols, __pyx_n_s_at); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);
/* … */
  __pyx_t_16 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
/* … */
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_6Buffer_17dataframe, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Buffer_dataframe, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_17, __pyx_t_16);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_Buffer->tp_dict, __pyx_n_s_dataframe, __pyx_t_17) < 0) __PYX_ERR(0, 960, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_Buffer);
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(2, 4, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_dataframe, 960, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 960, __pyx_L1_error)
 0961:             self,
 0962:             df,  # : pd.DataFrame
 0963:             *,
+0964:             table_name: Optional[str] = None,
    values[1] = ((PyObject *)Py_None);
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Optional); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_1, ((PyObject *)(&PyUnicode_Type))); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_table_name, __pyx_t_15) < 0) __PYX_ERR(0, 960, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+0965:             table_name_col: Union[None, int, str] = None,
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)__pyx_n_u_auto);
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_Union); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_1, 0, Py_None);
  __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)(&PyInt_Type)));
  __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)(&PyUnicode_Type)));
  __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_table_name_col, __pyx_t_17) < 0) __PYX_ERR(0, 960, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+0966:             symbols: Union[str, bool, List[int], List[str]] = 'auto',
  __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_Union); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_List); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_1, ((PyObject *)(&PyInt_Type))); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_List); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_1, ((PyObject *)(&PyUnicode_Type))); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyUnicode_Type)));
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7cpython_4bool_bool));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7cpython_4bool_bool));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_ptype_7cpython_4bool_bool));
  __Pyx_GIVEREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_18);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_18);
  __pyx_t_15 = 0;
  __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_t_1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_symbols, __pyx_t_18) < 0) __PYX_ERR(0, 960, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+0967:             at: Union[None, int, str, TimestampNanos, datetime] = None):
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (kw_args > 0 && likely(kw_args <= 4)) {
        Py_ssize_t index;
        for (index = 1; index < 5 && kw_args > 0; index++) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
          if (value) { values[index] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dataframe") < 0)) __PYX_ERR(0, 960, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_df = values[0];
    __pyx_v_table_name = values[1];
    __pyx_v_table_name_col = values[2];
    __pyx_v_symbols = values[3];
    __pyx_v_at = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dataframe", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 960, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("questdb.ingress.Buffer.dataframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7questdb_7ingress_6Buffer_16dataframe(((struct __pyx_obj_7questdb_7ingress_Buffer *)__pyx_v_self), __pyx_v_df, __pyx_v_table_name, __pyx_v_table_name_col, __pyx_v_symbols, __pyx_v_at);
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_Union); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_1, 0, Py_None);
  __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)(&PyInt_Type)));
  __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)(&PyUnicode_Type)));
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos));
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_at, __pyx_t_17) < 0) __PYX_ERR(0, 960, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
 0968:         """
 0969:         Add a pandas DataFrame to the buffer.
 0970: 
 0971:         Also see the :func:`Sender.dataframe` method if you're
 0972:         not using the buffer explicitly. It supports the same parameters
 0973:         and also supports auto-flushing.
 0974: 
 0975:         This feature requires the ``pandas``, ``numpy`` and ``pyarrow``
 0976:         package to be installed.
 0977: 
 0978:         :param df: The pandas DataFrame to serialize to the buffer.
 0979:         :type df: pandas.DataFrame
 0980: 
 0981:         :param table_name: The name of the table to which the rows belong.
 0982: 
 0983:             If ``None``, the table name is taken from the ``table_name_col``
 0984:             parameter. If both ``table_name`` and ``table_name_col`` are
 0985:             ``None``, the table name is taken from the DataFrame's index
 0986:             name (``df.index.name`` attribute).
 0987:         :type table_name: str or None
 0988: 
 0989:         :param table_name_col: The name or index of the column in the DataFrame
 0990:             that contains the table name.
 0991: 
 0992:             If ``None``, the table name is taken
 0993:             from the ``table_name`` parameter. If both ``table_name`` and
 0994:             ``table_name_col`` are ``None``, the table name is taken from the
 0995:             DataFrame's index name (``df.index.name`` attribute).
 0996: 
 0997:             If ``table_name_col`` is an integer, it is interpreted as the index
 0998:             of the column starting from ``0``. The index of the column can be
 0999:             negative, in which case it is interpreted as an offset from the end
 1000:             of the DataFrame. E.g. ``-1`` is the last column.
 1001:         :type table_name_col: str or int or None
 1002: 
 1003:         :param symbols: The columns to be serialized as symbols.
 1004: 
 1005:             If ``'auto'`` (default), all columns of dtype ``'categorical'`` are
 1006:             serialized as symbols. If ``True``, all ``str`` columns are
 1007:             serialized as symbols. If ``False``, no columns are serialized as
 1008:             symbols.
 1009: 
 1010:             The list of symbols can also be specified explicitly as a ``list``
 1011:             of column names (``str``) or indices (``int``). Integer indices
 1012:             start at ``0`` and can be negative, offset from the end of the
 1013:             DataFrame. E.g. ``-1`` is the last column.
 1014: 
 1015:             Only columns containing strings can be serialized as symbols.
 1016: 
 1017:         :type symbols: str or bool or list of str or list of int
 1018: 
 1019:         :param at: The designated timestamp of the rows.
 1020: 
 1021:             You can specify a single value for all rows or column name or index.
 1022:             If ``None``, timestamp is assigned by the server for all rows.
 1023:             To pass in a timestamp explicity as an integer use the
 1024:             ``TimestampNanos`` wrapper type. To get the current timestamp,
 1025:             use ``TimestampNanos.now()``.
 1026:             When passing a ``datetime.datetime`` object, the timestamp is
 1027:             converted to nanoseconds.
 1028:             A ``datetime`` object is assumed to be in the local timezone unless
 1029:             one is specified explicitly (so call
 1030:             ``datetime.datetime.now(tz=datetime.timezone.utc)`` instead
 1031:             of ``datetime.datetime.utcnow()`` for the current timestamp to
 1032:             avoid bugs).
 1033: 
 1034:             To specify a different timestamp for each row, pass in a column name
 1035:             (``str``) or index (``int``, 0-based index, negative index
 1036:             supported): In this case, the column needs to be of dtype
 1037:             ``datetime64[ns]`` (assumed to be in the **UTC timezone** and not
 1038:             local, due to differences in Pandas and Python datetime handling) or
 1039:             ``datetime64[ns, tz]``. When a timezone is specified in the column,
 1040:             it is converted to UTC automatically.
 1041: 
 1042:             A timestamp column can also contain ``None`` values. The server will
 1043:             assign the current timestamp to those rows.
 1044: 
 1045:             **Note**: All timestamps are always converted to nanoseconds and in
 1046:             the UTC timezone. Timezone information is dropped before sending and
 1047:             QuestDB will not store any timezone information.
 1048:         :type at: TimestampNanos, datetime.datetime, int or str or None
 1049: 
 1050:         **Note**: It is an error to specify both ``table_name`` and
 1051:         ``table_name_col``.
 1052: 
 1053:         **Note**: The "index" column of the DataFrame is never serialized,
 1054:         even if it is named.
 1055: 
 1056:         Example:
 1057: 
 1058:         .. code-block:: python
 1059: 
 1060:             import pandas as pd
 1061:             import questdb.ingress as qi
 1062: 
 1063:             buf = qi.Buffer()
 1064:             # ...
 1065: 
 1066:             df = pd.DataFrame({
 1067:                 'location': ['London', 'Managua', 'London'],
 1068:                 'temperature': [24.5, 35.0, 25.5],
 1069:                 'humidity': [0.5, 0.6, 0.45],
 1070:                 'ts': pd.date_range('2021-07-01', periods=3)})
 1071:             buf.dataframe(
 1072:                 df, table_name='weather', at='ts', symbols=['location'])
 1073: 
 1074:             # ...
 1075:             sender.flush(buf)
 1076: 
 1077:         **Pandas to ILP datatype mappings**
 1078: 
 1079:         .. seealso:: https://questdb.io/docs/reference/api/ilp/columnset-types/
 1080: 
 1081:         .. list-table:: Pandas Mappings
 1082:             :header-rows: 1
 1083: 
 1084:             * - Pandas ``dtype``
 1085:               - Nulls
 1086:               - ILP Datatype
 1087:             * - ``'bool'``
 1088:               - N
 1089:               - ``BOOLEAN``
 1090:             * - ``'boolean'``
 1091:               - N **α**
 1092:               - ``BOOLEAN``
 1093:             * - ``'object'`` (``bool`` objects)
 1094:               - N **α**
 1095:               - ``BOOLEAN``
 1096:             * - ``'uint8'``
 1097:               - N
 1098:               - ``INTEGER``
 1099:             * - ``'int8'``
 1100:               - N
 1101:               - ``INTEGER``
 1102:             * - ``'uint16'``
 1103:               - N
 1104:               - ``INTEGER``
 1105:             * - ``'int16'``
 1106:               - N
 1107:               - ``INTEGER``
 1108:             * - ``'uint32'``
 1109:               - N
 1110:               - ``INTEGER``
 1111:             * - ``'int32'``
 1112:               - N
 1113:               - ``INTEGER``
 1114:             * - ``'uint64'``
 1115:               - N
 1116:               - ``INTEGER`` **β**
 1117:             * - ``'int64'``
 1118:               - N
 1119:               - ``INTEGER``
 1120:             * - ``'UInt8'``
 1121:               - Y
 1122:               - ``INTEGER``
 1123:             * - ``'Int8'``
 1124:               - Y
 1125:               - ``INTEGER``
 1126:             * - ``'UInt16'``
 1127:               - Y
 1128:               - ``INTEGER``
 1129:             * - ``'Int16'``
 1130:               - Y
 1131:               - ``INTEGER``
 1132:             * - ``'UInt32'``
 1133:               - Y
 1134:               - ``INTEGER``
 1135:             * - ``'Int32'``
 1136:               - Y
 1137:               - ``INTEGER``
 1138:             * - ``'UInt64'``
 1139:               - Y
 1140:               - ``INTEGER`` **β**
 1141:             * - ``'Int64'``
 1142:               - Y
 1143:               - ``INTEGER``
 1144:             * - ``'object'`` (``int`` objects)
 1145:               - Y
 1146:               - ``INTEGER`` **β**
 1147:             * - ``'float32'`` **γ**
 1148:               - Y (``NaN``)
 1149:               - ``FLOAT``
 1150:             * - ``'float64'``
 1151:               - Y (``NaN``)
 1152:               - ``FLOAT``
 1153:             * - ``'object'`` (``float`` objects)
 1154:               - Y (``NaN``)
 1155:               - ``FLOAT``
 1156:             * - ``'string'`` (``str`` objects)
 1157:               - Y
 1158:               - ``STRING`` (default), ``SYMBOL`` via ``symbols`` arg. **δ**
 1159:             * - ``'string[pyarrow]'``
 1160:               - Y
 1161:               - ``STRING`` (default), ``SYMBOL`` via ``symbols`` arg. **δ**
 1162:             * - ``'category'`` (``str`` objects) **ε**
 1163:               - Y
 1164:               - ``SYMBOL`` (default), ``STRING`` via ``symbols`` arg. **δ**
 1165:             * - ``'object'`` (``str`` objects)
 1166:               - Y
 1167:               - ``STRING`` (default), ``SYMBOL`` via ``symbols`` arg. **δ**
 1168:             * - ``'datetime64[ns]'``
 1169:               - Y
 1170:               - ``TIMESTAMP`` **ζ**
 1171:             * - ``'datetime64[ns, tz]'``
 1172:               - Y
 1173:               - ``TIMESTAMP`` **ζ**
 1174: 
 1175:         .. note::
 1176: 
 1177:             * **α**: Note some pandas dtypes allow nulls (e.g. ``'boolean'``),
 1178:               where the QuestDB database does not.
 1179: 
 1180:             * **β**: The valid range for integer values is -2^63 to 2^63-1.
 1181:               Any ``'uint64'``, ``'UInt64'`` or python ``int`` object values
 1182:               outside this range will raise an error during serialization.
 1183: 
 1184:             * **γ**: Upcast to 64-bit float during serialization.
 1185: 
 1186:             * **δ**: Columns containing strings can also be used to specify the
 1187:               table name. See ``table_name_col``.
 1188: 
 1189:             * **ε**: We only support categories containing strings. If the
 1190:               category contains non-string values, an error will be raised.
 1191: 
 1192:             * **ζ**: The '.dataframe()' method only supports datetimes with
 1193:               nanosecond precision. The designated timestamp column (see ``at``
 1194:               parameter) maintains the nanosecond precision, whilst values
 1195:               stored as columns have their precision truncated to microseconds.
 1196:               All dates are sent as UTC and any additional timezone information
 1197:               is dropped. If no timezone is specified, we follow
 1198:               the pandas convention of assuming the timezone is UTC.
 1199:               Datetimes before 1970-01-01 00:00:00 UTC are not supported.
 1200:               If a datetime value is specified as ``None`` (``NaT``), it is
 1201:               interpreted as the current QuestDB server time set on receipt of
 1202:               message.
 1203: 
 1204:         **Error Handling and Recovery**
 1205: 
 1206:         In case an exception is raised during dataframe serialization, the
 1207:         buffer is left in its previous state.
 1208:         The buffer remains in a valid state and can be used for further calls
 1209:         even after an error.
 1210: 
 1211:         For clarification, as an example, if an invalid ``None``
 1212:         value appears at the 3rd row for a ``bool`` column, neither the 3rd nor
 1213:         the preceding rows are added to the buffer.
 1214: 
 1215:         **Note**: This differs from the :func:`Sender.dataframe` method, which
 1216:         modifies this guarantee due to its ``auto_flush`` logic.
 1217: 
 1218:         **Performance Considerations**
 1219: 
 1220:         The Python GIL is released during serialization if it is not needed.
 1221:         If any column requires the GIL, the entire serialization is done whilst
 1222:         holding the GIL.
 1223: 
 1224:         Column types that require the GIL are:
 1225: 
 1226:         * Columns of ``str``, ``float`` or ``int`` or ``float`` Python objects.
 1227:         * The ``'string[python]'`` dtype.
 1228:         """
+1229:         _dataframe(
  __pyx_t_1 = __pyx_f_7questdb_7ingress__dataframe(__pyx_f_7questdb_7ingress_auto_flush_blank(), __pyx_v_self->_impl, __pyx_v_self->_b, __pyx_v_df, __pyx_v_table_name, __pyx_v_table_name_col, __pyx_v_symbols, __pyx_v_at); if (unlikely(__pyx_t_1 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 1229, __pyx_L1_error)
 1230:             auto_flush_blank(),
 1231:             self._impl,
 1232:             self._b,
 1233:             df,
 1234:             table_name,
 1235:             table_name_col,
 1236:             symbols,
 1237:             at)
 1238: 
 1239: 
+1240: _FLUSH_FMT = ('{} - See https://py-questdb-client.readthedocs.io/en/'
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FLUSH_FMT, __pyx_kp_u_See_https_py_questdb_client_rea) < 0) __PYX_ERR(0, 1240, __pyx_L1_error)
 1241:     'v1.1.0'
 1242:     '/troubleshooting.html#inspecting-and-debugging-errors#flush-failed')
 1243: 
 1244: 
+1245: cdef class Sender:
struct __pyx_vtabstruct_7questdb_7ingress_Sender {
  PyObject *(*flush)(struct __pyx_obj_7questdb_7ingress_Sender *, int __pyx_skip_dispatch, struct __pyx_opt_args_7questdb_7ingress_6Sender_flush *__pyx_optional_args);
  PyObject *(*_close)(struct __pyx_obj_7questdb_7ingress_Sender *);
  PyObject *(*close)(struct __pyx_obj_7questdb_7ingress_Sender *, int __pyx_skip_dispatch, struct __pyx_opt_args_7questdb_7ingress_6Sender_close *__pyx_optional_args);
};
static struct __pyx_vtabstruct_7questdb_7ingress_Sender *__pyx_vtabptr_7questdb_7ingress_Sender;

 1246:     """
 1247:     A sender is a client that inserts rows into QuestDB via the ILP protocol.
 1248: 
 1249:     **Inserting two rows**
 1250: 
 1251:     In this example, data will be flushed and sent at the end of the ``with``
 1252:     block.
 1253: 
 1254:     .. code-block:: python
 1255: 
 1256:         with Sender('localhost', 9009) as sender:
 1257:             sender.row(
 1258:                 'weather_sensor',
 1259:                 symbols={'id': 'toronto1'},
 1260:                 columns={'temperature': 23.5, 'humidity': 0.49})
 1261:             sensor.row(
 1262:                 'weather_sensor',
 1263:                 symbols={'id': 'dubai2'},
 1264:                 columns={'temperature': 41.2, 'humidity': 0.34})
 1265: 
 1266:     The ``Sender`` object holds an internal buffer. The call to ``.row()``
 1267:     simply forwards all arguments to the :func:`Buffer.row` method.
 1268: 
 1269: 
 1270:     **Explicit flushing**
 1271: 
 1272:     An explicit call to :func:`Sender.flush` will send any pending data
 1273:     immediately.
 1274: 
 1275:     .. code-block:: python
 1276: 
 1277:         with Sender('localhost', 9009) as sender:
 1278:             sender.row(
 1279:                 'weather_sensor',
 1280:                 symbols={'id': 'toronto1'},
 1281:                 columns={'temperature': 23.5, 'humidity': 0.49})
 1282:             sender.flush()
 1283:             sender.row(
 1284:                 'weather_sensor',
 1285:                 symbols={'id': 'dubai2'},
 1286:                 columns={'temperature': 41.2, 'humidity': 0.34})
 1287:             sender.flush()
 1288: 
 1289: 
 1290:     **Auto-flushing (on by default, watermark at 63KiB)**
 1291: 
 1292:     To avoid accumulating very large buffers, the sender will flush the buffer
 1293:     automatically once its buffer reaches a certain byte-size watermark.
 1294: 
 1295:     You can control this behavior by setting the ``auto_flush`` argument.
 1296: 
 1297:     .. code-block:: python
 1298: 
 1299:         # Never flushes automatically.
 1300:         sender = Sender('localhost', 9009, auto_flush=False)
 1301:         sender = Sender('localhost', 9009, auto_flush=None) # Ditto.
 1302:         sender = Sender('localhost', 9009, auto_flush=0)  # Ditto.
 1303: 
 1304:         # Flushes automatically when the buffer reaches 1KiB.
 1305:         sender = Sender('localhost', 9009, auto_flush=1024)
 1306: 
 1307:         # Flushes automatically after every row.
 1308:         sender = Sender('localhost', 9009, auto_flush=True)
 1309:         sender = Sender('localhost', 9009, auto_flush=1)  # Ditto.
 1310: 
 1311: 
 1312:     **Authentication and TLS Encryption**
 1313: 
 1314:     This implementation supports authentication and TLS full-connection
 1315:     encryption.
 1316: 
 1317:     The ``Sender(.., auth=..)`` argument is a tuple of ``(kid, d, x, y)`` as
 1318:     documented on the `QuestDB ILP authentication
 1319:     <https://questdb.io/docs/reference/api/ilp/authenticate>`_ documentation.
 1320:     Authentication is optional and disabled by default.
 1321: 
 1322:     The ``Sender(.., tls=..)`` argument is one of:
 1323: 
 1324:     * ``False``: No TLS encryption (default).
 1325: 
 1326:     * ``True``: TLS encryption, accepting all common certificates as recognized
 1327:       by the `webpki-roots <https://crates.io/crates/webpki-roots>`_ Rust crate
 1328:       which in turn relies on https://mkcert.org/.
 1329: 
 1330:     * A ``str`` or ``pathlib.Path``: Path to a PEM-encoded certificate authority
 1331:       file. This is useful for testing with self-signed certificates.
 1332: 
 1333:     * A special ``'insecure_skip_verify'`` string: Dangerously disable all
 1334:       TLS certificate verification (do *NOT* use in production environments).
 1335: 
 1336:     **Positional constructor arguments for the Sender(..)**
 1337: 
 1338:     * ``host``: Hostname or IP address of the QuestDB server.
 1339: 
 1340:     * ``port``: Port number of the QuestDB server.
 1341: 
 1342: 
 1343:     **Keyword-only constructor arguments for the Sender(..)**
 1344: 
 1345:     * ``interface`` (``str``): Network interface to bind to.
 1346:       Set this if you have an accelerated network interface (e.g. Solarflare)
 1347:       and want to use it.
 1348: 
 1349:     * ``auth`` (``tuple``): Authentication tuple or ``None`` (default).
 1350:       *See above for details*.
 1351: 
 1352:     * ``tls`` (``bool``, ``pathlib.Path`` or ``str``): TLS configuration or
 1353:       ``False`` (default). *See above for details*.
 1354: 
 1355:     * ``read_timeout`` (``int``): How long to wait for messages from the QuestDB server
 1356:       during the TLS handshake or authentication process.
 1357:       This field is expressed in milliseconds. The default is 15 seconds.
 1358: 
 1359:     * ``init_capacity`` (``int``): Initial buffer capacity of the internal buffer.
 1360:       *Default: 65536 (64KiB).*
 1361:       *See Buffer's constructor for more details.*
 1362: 
 1363:     * ``max_name_length`` (``int``): Maximum length of a table or column name.
 1364:       *See Buffer's constructor for more details.*
 1365: 
 1366:     * ``auto_flush`` (``bool`` or ``int``): Whether to automatically flush the
 1367:       buffer when it reaches a certain byte-size watermark.
 1368:       *Default: 64512 (63KiB).*
 1369:       *See above for details.*
 1370:     """
 1371: 
 1372:     # We need the Buffer held by a Sender can hold a weakref to its Sender.
 1373:     # This avoids a circular reference that requires the GC to clean up.
 1374:     cdef object __weakref__
 1375: 
 1376:     cdef line_sender_opts* _opts
 1377:     cdef line_sender* _impl
 1378:     cdef Buffer _buffer
 1379:     cdef bint _auto_flush_enabled
 1380:     cdef ssize_t _auto_flush_watermark
 1381:     cdef size_t _init_capacity
 1382:     cdef size_t _max_name_len
 1383: 
+1384:     def __cinit__(
/* Python wrapper */
static int __pyx_pw_7questdb_7ingress_6Sender_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7questdb_7ingress_6Sender_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_host = 0;
  PyObject *__pyx_v_port = 0;
  PyObject *__pyx_v_interface = 0;
  PyObject *__pyx_v_auth = 0;
  PyObject *__pyx_v_tls = 0;
  uint64_t __pyx_v_read_timeout;
  uint64_t __pyx_v_init_capacity;
  uint64_t __pyx_v_max_name_len;
  PyObject *__pyx_v_auto_flush = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,&__pyx_n_s_port,&__pyx_n_s_interface,&__pyx_n_s_auth,&__pyx_n_s_tls,&__pyx_n_s_read_timeout,&__pyx_n_s_init_capacity,&__pyx_n_s_max_name_len,&__pyx_n_s_auto_flush,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
/* … */
  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_7questdb_7ingress_6Sender___cinit__(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_interface, PyObject *__pyx_v_auth, PyObject *__pyx_v_tls, uint64_t __pyx_v_read_timeout, uint64_t __pyx_v_init_capacity, uint64_t __pyx_v_max_name_len, PyObject *__pyx_v_auto_flush) {
  CYTHON_UNUSED struct line_sender_error *__pyx_v_err;
  struct line_sender_utf8 __pyx_v_host_utf8;
  PyObject *__pyx_v_port_str = 0;
  struct line_sender_utf8 __pyx_v_port_utf8;
  struct line_sender_utf8 __pyx_v_interface_utf8;
  PyObject *__pyx_v_a_key_id = 0;
  struct line_sender_utf8 __pyx_v_a_key_id_utf8;
  PyObject *__pyx_v_a_priv_key = 0;
  struct line_sender_utf8 __pyx_v_a_priv_key_utf8;
  PyObject *__pyx_v_a_pub_key_x = 0;
  struct line_sender_utf8 __pyx_v_a_pub_key_x_utf8;
  PyObject *__pyx_v_a_pub_key_y = 0;
  struct line_sender_utf8 __pyx_v_a_pub_key_y_utf8;
  struct line_sender_utf8 __pyx_v_ca_utf8;
  struct qdb_pystr_buf *__pyx_v_b;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_tls);
/* … */
  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("questdb.ingress.Sender.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_port_str);
  __Pyx_XDECREF(__pyx_v_a_key_id);
  __Pyx_XDECREF(__pyx_v_a_priv_key);
  __Pyx_XDECREF(__pyx_v_a_pub_key_x);
  __Pyx_XDECREF(__pyx_v_a_pub_key_y);
  __Pyx_XDECREF(__pyx_v_tls);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 1385:             self,
 1386:             str host,
 1387:             object port,
 1388:             *,
+1389:             str interface=None,
    values[2] = ((PyObject*)Py_None);
+1390:             tuple auth=None,
    values[3] = ((PyObject*)Py_None);
+1391:             object tls=False,
    values[4] = ((PyObject *)Py_False);
    values[8] = ((PyObject *)__pyx_int_64512);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_host)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 1384, __pyx_L3_error)
        }
      }
      if (kw_args > 0 && likely(kw_args <= 7)) {
        Py_ssize_t index;
        for (index = 2; index < 9 && kw_args > 0; index++) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
          if (value) { values[index] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1384, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_host = ((PyObject*)values[0]);
    __pyx_v_port = values[1];
    __pyx_v_interface = ((PyObject*)values[2]);
    __pyx_v_auth = ((PyObject*)values[3]);
    __pyx_v_tls = values[4];
    if (values[5]) {
      __pyx_v_read_timeout = __Pyx_PyInt_As_uint64_t(values[5]); if (unlikely((__pyx_v_read_timeout == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1392, __pyx_L3_error)
    } else {
      __pyx_v_read_timeout = ((uint64_t)0x3A98);
    }
    if (values[6]) {
      __pyx_v_init_capacity = __Pyx_PyInt_As_uint64_t(values[6]); if (unlikely((__pyx_v_init_capacity == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1393, __pyx_L3_error)
    } else {
      __pyx_v_init_capacity = ((uint64_t)0x10000);
    }
    if (values[7]) {
      __pyx_v_max_name_len = __Pyx_PyInt_As_uint64_t(values[7]); if (unlikely((__pyx_v_max_name_len == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1394, __pyx_L3_error)
    } else {
      __pyx_v_max_name_len = ((uint64_t)0x7F);
    }
    __pyx_v_auto_flush = values[8];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1384, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("questdb.ingress.Sender.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_host), (&PyUnicode_Type), 1, "host", 1))) __PYX_ERR(0, 1386, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interface), (&PyUnicode_Type), 1, "interface", 1))) __PYX_ERR(0, 1389, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_auth), (&PyTuple_Type), 1, "auth", 1))) __PYX_ERR(0, 1390, __pyx_L1_error)
  __pyx_r = __pyx_pf_7questdb_7ingress_6Sender___cinit__(((struct __pyx_obj_7questdb_7ingress_Sender *)__pyx_v_self), __pyx_v_host, __pyx_v_port, __pyx_v_interface, __pyx_v_auth, __pyx_v_tls, __pyx_v_read_timeout, __pyx_v_init_capacity, __pyx_v_max_name_len, __pyx_v_auto_flush);
 1392:             uint64_t read_timeout=15000,
 1393:             uint64_t init_capacity=65536,  # 64KiB
 1394:             uint64_t max_name_len=127,
 1395:             object auto_flush=64512):  # 63KiB
+1396:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
 1397: 
 1398:         cdef line_sender_utf8 host_utf8
 1399: 
 1400:         cdef str port_str
 1401:         cdef line_sender_utf8 port_utf8
 1402: 
 1403:         cdef str interface_str
 1404:         cdef line_sender_utf8 interface_utf8
 1405: 
 1406:         cdef str a_key_id
 1407:         cdef bytes a_key_id_owner
 1408:         cdef line_sender_utf8 a_key_id_utf8
 1409: 
 1410:         cdef str a_priv_key
 1411:         cdef bytes a_priv_key_owner
 1412:         cdef line_sender_utf8 a_priv_key_utf8
 1413: 
 1414:         cdef str a_pub_key_x
 1415:         cdef bytes a_pub_key_x_owner
 1416:         cdef line_sender_utf8 a_pub_key_x_utf8
 1417: 
 1418:         cdef str a_pub_key_y
 1419:         cdef bytes a_pub_key_y_owner
 1420:         cdef line_sender_utf8 a_pub_key_y_utf8
 1421: 
 1422:         cdef line_sender_utf8 ca_utf8
 1423: 
 1424:         cdef qdb_pystr_buf* b
 1425: 
+1426:         self._opts = NULL
  __pyx_v_self->_opts = NULL;
+1427:         self._impl = NULL
  __pyx_v_self->_impl = NULL;
 1428: 
+1429:         self._init_capacity = init_capacity
  __pyx_v_self->_init_capacity = __pyx_v_init_capacity;
+1430:         self._max_name_len = max_name_len
  __pyx_v_self->_max_name_len = __pyx_v_max_name_len;
 1431: 
+1432:         self._buffer = Buffer(
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7questdb_7ingress_Buffer), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_buffer);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_buffer));
  __pyx_v_self->_buffer = ((struct __pyx_obj_7questdb_7ingress_Buffer *)__pyx_t_2);
  __pyx_t_2 = 0;
+1433:             init_capacity=init_capacity,
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_v_init_capacity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_init_capacity, __pyx_t_2) < 0) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+1434:             max_name_len=max_name_len)
  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_v_max_name_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_max_name_len, __pyx_t_2) < 0) __PYX_ERR(0, 1433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 1435: 
+1436:         b = self._buffer._b
  __pyx_t_3 = __pyx_v_self->_buffer->_b;
  __pyx_v_b = __pyx_t_3;
 1437: 
+1438:         if PyLong_CheckExact(<PyObject*>port):
  __pyx_t_4 = (PyLong_CheckExact(((PyObject *)__pyx_v_port)) != 0);
  if (__pyx_t_4) {
/* … */
    goto __pyx_L3;
  }
+1439:             port_str = str(port)
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_port); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_port_str = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
+1440:         elif PyUnicode_CheckExact(<PyObject*>port):
  __pyx_t_4 = (PyUnicode_CheckExact(((PyObject *)__pyx_v_port)) != 0);
  if (likely(__pyx_t_4)) {
/* … */
    goto __pyx_L3;
  }
+1441:             port_str = port
    if (!(likely(PyUnicode_CheckExact(__pyx_v_port))||((__pyx_v_port) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_port)->tp_name), 0))) __PYX_ERR(0, 1441, __pyx_L1_error)
    __pyx_t_2 = __pyx_v_port;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_port_str = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
 1442:         else:
+1443:             raise TypeError(
  /*else*/ {
/* … */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1443, __pyx_L1_error)
  }
  __pyx_L3:;
+1444:                 f'port must be an int or a str, not {_fqn(type(port))}')
    __pyx_t_2 = __pyx_f_7questdb_7ingress__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_port)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_port_must_be_an_int_or_a_str_not, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 1445: 
+1446:         str_to_utf8(b, <PyObject*>host, &host_utf8)
  __pyx_t_5 = __pyx_f_7questdb_7ingress_str_to_utf8(__pyx_v_b, ((PyObject *)__pyx_v_host), (&__pyx_v_host_utf8)); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 1446, __pyx_L1_error)
+1447:         str_to_utf8(b, <PyObject*>port_str, &port_utf8)
  __pyx_t_5 = __pyx_f_7questdb_7ingress_str_to_utf8(__pyx_v_b, ((PyObject *)__pyx_v_port_str), (&__pyx_v_port_utf8)); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 1447, __pyx_L1_error)
+1448:         self._opts = line_sender_opts_new_service(host_utf8, port_utf8)
  __pyx_v_self->_opts = line_sender_opts_new_service(__pyx_v_host_utf8, __pyx_v_port_utf8);
 1449: 
+1450:         if interface is not None:
  __pyx_t_4 = (__pyx_v_interface != ((PyObject*)Py_None));
  __pyx_t_6 = (__pyx_t_4 != 0);
  if (__pyx_t_6) {
/* … */
  }
+1451:             str_to_utf8(b, <PyObject*>interface, &interface_utf8)
    __pyx_t_5 = __pyx_f_7questdb_7ingress_str_to_utf8(__pyx_v_b, ((PyObject *)__pyx_v_interface), (&__pyx_v_interface_utf8)); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 1451, __pyx_L1_error)
+1452:             line_sender_opts_net_interface(self._opts, interface_utf8)
    line_sender_opts_net_interface(__pyx_v_self->_opts, __pyx_v_interface_utf8);
 1453: 
+1454:         if auth is not None:
  __pyx_t_6 = (__pyx_v_auth != ((PyObject*)Py_None));
  __pyx_t_4 = (__pyx_t_6 != 0);
  if (__pyx_t_4) {
/* … */
  }
+1455:             (a_key_id,
    if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 1455, __pyx_L1_error)
    if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1455, __pyx_L1_error)
    if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_7)->tp_name), 0))) __PYX_ERR(0, 1455, __pyx_L1_error)
    if (!(likely(PyUnicode_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 1455, __pyx_L1_error)
    __pyx_v_a_key_id = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_v_a_priv_key = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_v_a_pub_key_x = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_v_a_pub_key_y = ((PyObject*)__pyx_t_8);
    __pyx_t_8 = 0;
 1456:              a_priv_key,
 1457:              a_pub_key_x,
+1458:              a_pub_key_y) = auth
    if (likely(__pyx_v_auth != Py_None)) {
      PyObject* sequence = __pyx_v_auth;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 4)) {
        if (size > 4) __Pyx_RaiseTooManyValuesError(4);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 1455, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); 
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_7,&__pyx_t_8};
        for (i=0; i < 4; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1455, __pyx_L1_error)
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
    } else {
      __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 1455, __pyx_L1_error)
    }
+1459:             str_to_utf8(b, <PyObject*>a_key_id, &a_key_id_utf8)
    __pyx_t_5 = __pyx_f_7questdb_7ingress_str_to_utf8(__pyx_v_b, ((PyObject *)__pyx_v_a_key_id), (&__pyx_v_a_key_id_utf8)); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 1459, __pyx_L1_error)
+1460:             str_to_utf8(b, <PyObject*>a_priv_key, &a_priv_key_utf8)
    __pyx_t_5 = __pyx_f_7questdb_7ingress_str_to_utf8(__pyx_v_b, ((PyObject *)__pyx_v_a_priv_key), (&__pyx_v_a_priv_key_utf8)); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 1460, __pyx_L1_error)
+1461:             str_to_utf8(b, <PyObject*>a_pub_key_x, &a_pub_key_x_utf8)
    __pyx_t_5 = __pyx_f_7questdb_7ingress_str_to_utf8(__pyx_v_b, ((PyObject *)__pyx_v_a_pub_key_x), (&__pyx_v_a_pub_key_x_utf8)); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 1461, __pyx_L1_error)
+1462:             str_to_utf8(b, <PyObject*>a_pub_key_y, &a_pub_key_y_utf8)
    __pyx_t_5 = __pyx_f_7questdb_7ingress_str_to_utf8(__pyx_v_b, ((PyObject *)__pyx_v_a_pub_key_y), (&__pyx_v_a_pub_key_y_utf8)); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 1462, __pyx_L1_error)
+1463:             line_sender_opts_auth(
    line_sender_opts_auth(__pyx_v_self->_opts, __pyx_v_a_key_id_utf8, __pyx_v_a_priv_key_utf8, __pyx_v_a_pub_key_x_utf8, __pyx_v_a_pub_key_y_utf8);
 1464:                 self._opts,
 1465:                 a_key_id_utf8,
 1466:                 a_priv_key_utf8,
 1467:                 a_pub_key_x_utf8,
 1468:                 a_pub_key_y_utf8)
 1469: 
+1470:         if tls:
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_tls); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1470, __pyx_L1_error)
  if (__pyx_t_4) {
/* … */
  }
+1471:             if tls is True:
    __pyx_t_4 = (__pyx_v_tls == Py_True);
    __pyx_t_6 = (__pyx_t_4 != 0);
    if (__pyx_t_6) {
/* … */
      goto __pyx_L7;
    }
+1472:                 line_sender_opts_tls(self._opts)
      line_sender_opts_tls(__pyx_v_self->_opts);
+1473:             elif isinstance(tls, str):
    __pyx_t_6 = PyUnicode_Check(__pyx_v_tls); 
    __pyx_t_4 = (__pyx_t_6 != 0);
    if (__pyx_t_4) {
/* … */
      goto __pyx_L7;
    }
+1474:                 if tls == 'insecure_skip_verify':
      __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_v_tls, __pyx_n_u_insecure_skip_verify, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1474, __pyx_L1_error)
      if (__pyx_t_4) {
/* … */
        goto __pyx_L8;
      }
+1475:                     line_sender_opts_tls_insecure_skip_verify(self._opts)
        line_sender_opts_tls_insecure_skip_verify(__pyx_v_self->_opts);
 1476:                 else:
+1477:                     str_to_utf8(b, <PyObject*>tls, &ca_utf8)
      /*else*/ {
        __pyx_t_5 = __pyx_f_7questdb_7ingress_str_to_utf8(__pyx_v_b, ((PyObject *)__pyx_v_tls), (&__pyx_v_ca_utf8)); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 1477, __pyx_L1_error)
+1478:                     line_sender_opts_tls_ca(self._opts, ca_utf8)
        line_sender_opts_tls_ca(__pyx_v_self->_opts, __pyx_v_ca_utf8);
      }
      __pyx_L8:;
+1479:             elif isinstance(tls, pathlib.Path):
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_pathlib); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_4 = PyObject_IsInstance(__pyx_v_tls, __pyx_t_7); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1479, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = (__pyx_t_4 != 0);
    if (likely(__pyx_t_6)) {
/* … */
      goto __pyx_L7;
    }
+1480:                 tls = str(tls)
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_tls); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1480, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF_SET(__pyx_v_tls, __pyx_t_7);
      __pyx_t_7 = 0;
+1481:                 str_to_utf8(b, <PyObject*>tls, &ca_utf8)
      __pyx_t_5 = __pyx_f_7questdb_7ingress_str_to_utf8(__pyx_v_b, ((PyObject *)__pyx_v_tls), (&__pyx_v_ca_utf8)); if (unlikely(__pyx_t_5 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 1481, __pyx_L1_error)
+1482:                 line_sender_opts_tls_ca(self._opts, ca_utf8)
      line_sender_opts_tls_ca(__pyx_v_self->_opts, __pyx_v_ca_utf8);
 1483:             else:
+1484:                 raise TypeError(
    /*else*/ {
/* … */
      __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1484, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(0, 1484, __pyx_L1_error)
    }
    __pyx_L7:;
+1485:                     'tls must be a bool, a path or string pointing to CA file '
      __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_tls_must_be_a_bool_a_path_or_str, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1485, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+1486:                     f'or "insecure_skip_verify", not {_fqn(type(tls))}')
      __pyx_t_7 = __pyx_f_7questdb_7ingress__fqn(((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_tls)))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1486, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1486, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 1487: 
+1488:         if read_timeout is not None:
  __pyx_t_8 = __Pyx_PyInt_From_uint64_t(__pyx_v_read_timeout); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = (__pyx_t_8 != Py_None);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_4 = (__pyx_t_6 != 0);
  if (__pyx_t_4) {
/* … */
  }
+1489:             line_sender_opts_read_timeout(self._opts, read_timeout)
    line_sender_opts_read_timeout(__pyx_v_self->_opts, __pyx_v_read_timeout);
 1490: 
+1491:         self._auto_flush_enabled = not not auto_flush
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_auto_flush); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1491, __pyx_L1_error)
  __pyx_v_self->_auto_flush_enabled = (!((!__pyx_t_4) != 0));
+1492:         self._auto_flush_watermark = int(auto_flush) \
    __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_auto_flush); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = PyInt_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1492, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = __pyx_t_10;
  } else {
    __pyx_t_9 = 0;
  }
  __pyx_v_self->_auto_flush_watermark = __pyx_t_9;
+1493:             if self._auto_flush_enabled else 0
  if ((__pyx_v_self->_auto_flush_enabled != 0)) {
+1494:         if self._auto_flush_watermark < 0:
  __pyx_t_4 = ((__pyx_v_self->_auto_flush_watermark < 0) != 0);
  if (unlikely(__pyx_t_4)) {
/* … */
  }
+1495:             raise ValueError(
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(0, 1495, __pyx_L1_error)
+1496:                 'auto_flush_watermark must be >= 0, '
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_auto_flush_watermark_must_be_0_n, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+1497:                 f'not {self._auto_flush_watermark}')
    __pyx_t_8 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_self->_auto_flush_watermark, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
 1498: 
+1499:         qdb_pystr_buf_clear(b)
  qdb_pystr_buf_clear(__pyx_v_b);
 1500: 
+1501:     def new_buffer(self):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_3new_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Sender_2new_buffer[] = "\n        Make a new configured buffer.\n\n        The buffer is set up with the configured `init_capacity` and\n        `max_name_len`.\n        ";
static PyMethodDef __pyx_mdef_7questdb_7ingress_6Sender_3new_buffer = {"new_buffer", (PyCFunction)__pyx_pw_7questdb_7ingress_6Sender_3new_buffer, METH_NOARGS, __pyx_doc_7questdb_7ingress_6Sender_2new_buffer};
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_3new_buffer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("new_buffer (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_6Sender_2new_buffer(((struct __pyx_obj_7questdb_7ingress_Sender *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Sender_2new_buffer(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("new_buffer", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("questdb.ingress.Sender.new_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 1501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);
/* … */
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_6Sender_3new_buffer, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sender_new_buffer, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_Sender->tp_dict, __pyx_n_s_new_buffer, __pyx_t_17) < 0) __PYX_ERR(0, 1501, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_Sender);
  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_new_buffer, 1501, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 1501, __pyx_L1_error)
 1502:         """
 1503:         Make a new configured buffer.
 1504: 
 1505:         The buffer is set up with the configured `init_capacity` and
 1506:         `max_name_len`.
 1507:         """
+1508:         return Buffer(
  __Pyx_XDECREF(__pyx_r);
/* … */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7questdb_7ingress_Buffer), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;
+1509:             init_capacity=self._init_capacity,
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_init_capacity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_init_capacity, __pyx_t_2) < 0) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+1510:             max_name_len=self._max_name_len)
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_max_name_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_max_name_len, __pyx_t_2) < 0) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 1511: 
 1512:     @property
+1513:     def init_capacity(self) -> int:
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_13init_capacity_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_13init_capacity_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_6Sender_13init_capacity___get__(((struct __pyx_obj_7questdb_7ingress_Sender *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Sender_13init_capacity___get__(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.Sender.init_capacity.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 1514:         """The initial capacity of the sender's internal buffer."""
+1515:         return self._init_capacity
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_init_capacity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 1516: 
 1517:     @property
+1518:     def max_name_len(self) -> int:
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_12max_name_len_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_12max_name_len_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_6Sender_12max_name_len___get__(((struct __pyx_obj_7questdb_7ingress_Sender *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Sender_12max_name_len___get__(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.Sender.max_name_len.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 1519:         """Maximum length of a table or column name."""
+1520:         return self._max_name_len
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->_max_name_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 1521: 
+1522:     def connect(self):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_5connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Sender_4connect[] = "\n        Connect to the QuestDB server.\n\n        This method is synchronous and will block until the connection is\n        established.\n\n        If the connection is set up with authentication and/or TLS, this\n        method will return only *after* the handshake(s) is/are complete.\n        ";
static PyMethodDef __pyx_mdef_7questdb_7ingress_6Sender_5connect = {"connect", (PyCFunction)__pyx_pw_7questdb_7ingress_6Sender_5connect, METH_NOARGS, __pyx_doc_7questdb_7ingress_6Sender_4connect};
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_5connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_6Sender_4connect(((struct __pyx_obj_7questdb_7ingress_Sender *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Sender_4connect(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self) {
  struct line_sender_error *__pyx_v_err;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("questdb.ingress.Sender.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__84 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_err); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);
/* … */
  __pyx_t_17 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_6Sender_5connect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sender_connect, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_Sender->tp_dict, __pyx_n_s_connect, __pyx_t_17) < 0) __PYX_ERR(0, 1522, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_Sender);
  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_connect, 1522, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 1522, __pyx_L1_error)
 1523:         """
 1524:         Connect to the QuestDB server.
 1525: 
 1526:         This method is synchronous and will block until the connection is
 1527:         established.
 1528: 
 1529:         If the connection is set up with authentication and/or TLS, this
 1530:         method will return only *after* the handshake(s) is/are complete.
 1531:         """
+1532:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
+1533:         if self._opts == NULL:
  __pyx_t_1 = ((__pyx_v_self->_opts == NULL) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+1534:             raise IngressError(
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_IngressError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
+1535:                 IngressErrorCode.InvalidApiCall,
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_IngressErrorCode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InvalidApiCall); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_kp_u_connect_can_t_be_called_after_cl};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1534, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_kp_u_connect_can_t_be_called_after_cl};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1534, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_5);
      __Pyx_INCREF(__pyx_kp_u_connect_can_t_be_called_after_cl);
      __Pyx_GIVEREF(__pyx_kp_u_connect_can_t_be_called_after_cl);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_u_connect_can_t_be_called_after_cl);
      __pyx_t_5 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1534, __pyx_L1_error)
 1536:                 'connect() can\'t be called after close().')
+1537:         self._impl = line_sender_connect(self._opts, &err)
  __pyx_v_self->_impl = line_sender_connect(__pyx_v_self->_opts, (&__pyx_v_err));
+1538:         if self._impl == NULL:
  __pyx_t_1 = ((__pyx_v_self->_impl == NULL) != 0);
  if (unlikely(__pyx_t_1)) {
/* … */
  }
+1539:             raise c_err_to_py(err)
    __pyx_t_2 = __pyx_f_7questdb_7ingress_c_err_to_py(__pyx_v_err); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1539, __pyx_L1_error)
+1540:         line_sender_opts_free(self._opts)
  line_sender_opts_free(__pyx_v_self->_opts);
+1541:         self._opts = NULL
  __pyx_v_self->_opts = NULL;
 1542: 
 1543:         # Request callbacks when rows are complete.
+1544:         if self._buffer is not None:
  __pyx_t_1 = (((PyObject *)__pyx_v_self->_buffer) != Py_None);
  __pyx_t_8 = (__pyx_t_1 != 0);
  if (__pyx_t_8) {
/* … */
  }
+1545:             self._buffer._row_complete_sender = PyWeakref_NewRef(self, None)
    __pyx_t_2 = PyWeakref_NewRef(((PyObject *)__pyx_v_self), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_buffer->_row_complete_sender);
    __Pyx_DECREF(__pyx_v_self->_buffer->_row_complete_sender);
    __pyx_v_self->_buffer->_row_complete_sender = __pyx_t_2;
    __pyx_t_2 = 0;
 1546: 
+1547:     def __enter__(self) -> Sender:
/* Python wrapper */
static struct __pyx_obj_7questdb_7ingress_Sender *__pyx_pw_7questdb_7ingress_6Sender_7__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Sender_6__enter__[] = "Call :func:`Sender.connect` at the start of a ``with`` block.";
static PyMethodDef __pyx_mdef_7questdb_7ingress_6Sender_7__enter__ = {"__enter__", (PyCFunction)__pyx_pw_7questdb_7ingress_6Sender_7__enter__, METH_NOARGS, __pyx_doc_7questdb_7ingress_6Sender_6__enter__};
static struct __pyx_obj_7questdb_7ingress_Sender *__pyx_pw_7questdb_7ingress_6Sender_7__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  struct __pyx_obj_7questdb_7ingress_Sender *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_6Sender_6__enter__(((struct __pyx_obj_7questdb_7ingress_Sender *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_7questdb_7ingress_Sender *__pyx_pf_7questdb_7ingress_6Sender_6__enter__(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self) {
  struct __pyx_obj_7questdb_7ingress_Sender *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("questdb.ingress.Sender.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 1547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);
/* … */
  __pyx_t_17 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  if (PyDict_SetItem(__pyx_t_17, __pyx_n_s_return, __pyx_n_u_Sender) < 0) __PYX_ERR(0, 1547, __pyx_L1_error)
  __pyx_t_16 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_6Sender_7__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sender___enter, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_16, __pyx_t_17);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_Sender->tp_dict, __pyx_n_s_enter, __pyx_t_16) < 0) __PYX_ERR(0, 1547, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_Sender);
  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_enter, 1547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 1547, __pyx_L1_error)
 1548:         """Call :func:`Sender.connect` at the start of a ``with`` block."""
+1549:         self.connect()
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_connect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1550:         return self
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;
 1551: 
+1552:     def __str__(self) -> str:
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_9__str__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Sender_8__str__[] = "\n        Inspect the contents of the internal buffer.\n\n        The ``str`` value returned represents the unsent data.\n\n        Also see :func:`Sender.__len__`.\n        ";
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7questdb_7ingress_6Sender_8__str__;
#endif
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_9__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_6Sender_8__str__(((struct __pyx_obj_7questdb_7ingress_Sender *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Sender_8__str__(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.Sender.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 1553:         """
 1554:         Inspect the contents of the internal buffer.
 1555: 
 1556:         The ``str`` value returned represents the unsent data.
 1557: 
 1558:         Also see :func:`Sender.__len__`.
 1559:         """
+1560:         return str(self._buffer)
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), ((PyObject *)__pyx_v_self->_buffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;
 1561: 
+1562:     def __len__(self) -> int:
/* Python wrapper */
static Py_ssize_t __pyx_pw_7questdb_7ingress_6Sender_11__len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Sender_10__len__[] = "\n        Number of bytes of unsent data in the internal buffer.\n\n        Equivalent (but cheaper) to ``len(str(sender))``.\n        ";
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_7questdb_7ingress_6Sender_10__len__;
#endif
static Py_ssize_t __pyx_pw_7questdb_7ingress_6Sender_11__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7questdb_7ingress_6Sender_10__len__(((struct __pyx_obj_7questdb_7ingress_Sender *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_7questdb_7ingress_6Sender_10__len__(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);
/* … */
  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.Sender.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 1563:         """
 1564:         Number of bytes of unsent data in the internal buffer.
 1565: 
 1566:         Equivalent (but cheaper) to ``len(str(sender))``.
 1567:         """
+1568:         return len(self._buffer)
  __pyx_t_1 = ((PyObject *)__pyx_v_self->_buffer);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;
 1569: 
+1570:     def row(self,
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_13row(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Sender_12row[] = "\n        Write a row to the internal buffer.\n\n        This may be sent automatically depending on the ``auto_flush`` setting\n        in the constructor.\n\n        Refer to the :func:`Buffer.row` documentation for details on arguments.\n        ";
static PyMethodDef __pyx_mdef_7questdb_7ingress_6Sender_13row = {"row", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7questdb_7ingress_6Sender_13row, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7questdb_7ingress_6Sender_12row};
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_13row(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_table_name = 0;
  PyObject *__pyx_v_symbols = 0;
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_v_at = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("row (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_table_name,&__pyx_n_s_symbols,&__pyx_n_s_columns,&__pyx_n_s_at,0};
    PyObject* values[4] = {0,0,0,0};
/* … */
  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Sender_12row(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self, PyObject *__pyx_v_table_name, PyObject *__pyx_v_symbols, PyObject *__pyx_v_columns, PyObject *__pyx_v_at) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("row", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("questdb.ingress.Sender.row", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__88 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_table_name, __pyx_n_s_symbols, __pyx_n_s_columns, __pyx_n_s_at); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);
/* … */
  __pyx_t_16 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_table_name, __pyx_n_u_unicode) < 0) __PYX_ERR(0, 1570, __pyx_L1_error)
/* … */
  __pyx_t_18 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_6Sender_13row, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sender_row, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_18, __pyx_t_16);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_Sender->tp_dict, __pyx_n_s_row, __pyx_t_18) < 0) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_Sender);
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(2, 3, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_row, 1570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 1570, __pyx_L1_error)
 1571:             table_name: str,
 1572:             *,
+1573:             symbols: Optional[Dict[str, str]]=None,
    values[1] = ((PyObject *)Py_None);
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_Optional); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
  PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)(&PyUnicode_Type)));
  __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
  PyTuple_SET_ITEM(__pyx_t_18, 1, ((PyObject *)(&PyUnicode_Type)));
  __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_18); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_t_15); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_symbols, __pyx_t_18) < 0) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+1574:             columns: Optional[Dict[
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_Optional); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_Dict); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
/* … */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_19);
  __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_18, __pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_columns, __pyx_t_1) < 0) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 1575:                 str,
+1576:                 Union[bool, int, float, str, TimestampMicros, datetime]]]=None,
    values[2] = ((PyObject *)Py_None);
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_Union); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7cpython_4bool_bool));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7cpython_4bool_bool));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_ptype_7cpython_4bool_bool));
  __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)(&PyInt_Type)));
  __Pyx_INCREF(((PyObject *)(&PyFloat_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyFloat_Type)));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)(&PyFloat_Type)));
  __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)(&PyUnicode_Type)));
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampMicros));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampMicros));
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampMicros));
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_t_17, __pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1577:             at: Union[None, TimestampNanos, datetime]=None):
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_table_name)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (kw_args > 0 && likely(kw_args <= 3)) {
        Py_ssize_t index;
        for (index = 1; index < 4 && kw_args > 0; index++) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
          if (value) { values[index] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "row") < 0)) __PYX_ERR(0, 1570, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_table_name = ((PyObject*)values[0]);
    __pyx_v_symbols = values[1];
    __pyx_v_columns = values[2];
    __pyx_v_at = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("row", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1570, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("questdb.ingress.Sender.row", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_table_name), (&PyUnicode_Type), 1, "table_name", 1))) __PYX_ERR(0, 1571, __pyx_L1_error)
  __pyx_r = __pyx_pf_7questdb_7ingress_6Sender_12row(((struct __pyx_obj_7questdb_7ingress_Sender *)__pyx_v_self), __pyx_v_table_name, __pyx_v_symbols, __pyx_v_columns, __pyx_v_at);
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Union); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_19 = PyTuple_New(3); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_19, 0, Py_None);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos));
  PyTuple_SET_ITEM(__pyx_t_19, 1, ((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos));
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  PyTuple_SET_ITEM(__pyx_t_19, 2, ((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_t_16, __pyx_n_s_at, __pyx_t_18) < 0) __PYX_ERR(0, 1570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
 1578:         """
 1579:         Write a row to the internal buffer.
 1580: 
 1581:         This may be sent automatically depending on the ``auto_flush`` setting
 1582:         in the constructor.
 1583: 
 1584:         Refer to the :func:`Buffer.row` documentation for details on arguments.
 1585:         """
+1586:         self._buffer.row(table_name, symbols=symbols, columns=columns, at=at)
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_buffer), __pyx_n_s_row); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_table_name);
  __Pyx_GIVEREF(__pyx_v_table_name);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_table_name);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_symbols, __pyx_v_symbols) < 0) __PYX_ERR(0, 1586, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_columns, __pyx_v_columns) < 0) __PYX_ERR(0, 1586, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_at, __pyx_v_at) < 0) __PYX_ERR(0, 1586, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 1587: 
+1588:     def dataframe(
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_15dataframe(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Sender_14dataframe[] = "\n        Write a Pandas DataFrame to the internal buffer.\n\n        Example:\n\n        .. code-block:: python\n\n            import pandas as pd\n            import questdb.ingress as qi\n\n            df = pd.DataFrame({\n                'car': pd.Categorical(['Nic 42', 'Eddi', 'Nic 42', 'Eddi']),\n                'position': [1, 2, 1, 2],\n                'speed': [89.3, 98.2, 3, 4],\n                'lat_gforce': [0.1, -0.2, -0.6, 0.4],\n                'accelleration': [0.1, -0.2, 0.6, 4.4],\n                'tyre_pressure': [2.6, 2.5, 2.6, 2.5],\n                'ts': [\n                    pd.Timestamp('2022-08-09 13:56:00'),\n                    pd.Timestamp('2022-08-09 13:56:01'),\n                    pd.Timestamp('2022-08-09 13:56:02'),\n                    pd.Timestamp('2022-08-09 13:56:03')]})\n\n            with qi.Sender('localhost', 9000) as sender:\n                sender.dataframe(df, table_name='race_metrics', at='ts')\n\n        This method builds on top of the :func:`Buffer.dataframe` method.\n        See its documentation for details on arguments.\n\n        Additionally, this method also supports auto-flushing the buffer\n        as specified in the ``Sender``'s ``auto_flush`` constructor argument.\n        Auto-flushing is implemented incrementally, meanting that when\n        calling ``sender.dataframe(df)`` with a large ``df``, the sender may\n        have sent some of the rows to the server already whist the rest of the\n        rows are going to be sent at the next auto-flush or next explicit call\n        to :func:`Sender.flush`.\n\n        In case of data errors with auto-flushing enabled, some of the rows\n        may have been transmitted to the server already.\n        ";
static PyMethodDef __pyx_mdef_7questdb_7ingress_6Sender_15dataframe = {"dataframe", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7questdb_7ingress_6Sender_15dataframe, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7questdb_7ingress_6Sender_14dataframe};
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_15dataframe(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_df = 0;
  PyObject *__pyx_v_table_name = 0;
  PyObject *__pyx_v_table_name_col = 0;
  PyObject *__pyx_v_symbols = 0;
  PyObject *__pyx_v_at = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dataframe (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_table_name,&__pyx_n_s_table_name_col,&__pyx_n_s_symbols,&__pyx_n_s_at,0};
    PyObject* values[5] = {0,0,0,0,0};
/* … */
  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Sender_14dataframe(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self, PyObject *__pyx_v_df, PyObject *__pyx_v_table_name, PyObject *__pyx_v_table_name_col, PyObject *__pyx_v_symbols, PyObject *__pyx_v_at) {
  struct __pyx_t_7questdb_7ingress_auto_flush_t __pyx_v_af;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dataframe", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("questdb.ingress.Sender.dataframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__90 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_df, __pyx_n_s_table_name, __pyx_n_s_table_name_col, __pyx_n_s_symbols, __pyx_n_s_at, __pyx_n_s_af); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 1588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);
/* … */
  __pyx_t_18 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
/* … */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_6Sender_15dataframe, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sender_dataframe, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_1, __pyx_t_18);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_Sender->tp_dict, __pyx_n_s_dataframe, __pyx_t_1) < 0) __PYX_ERR(0, 1588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_Sender);
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(2, 4, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_dataframe, 1588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 1588, __pyx_L1_error)
 1589:             self,
 1590:             df,  # : pd.DataFrame
 1591:             *,
+1592:             table_name: Optional[str] = None,
    values[1] = ((PyObject *)Py_None);
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_Optional); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_t_16, ((PyObject *)(&PyUnicode_Type))); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_table_name, __pyx_t_19) < 0) __PYX_ERR(0, 1588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
+1593:             table_name_col: Union[None, int, str] = None,
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)__pyx_n_u_auto);
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_Union); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_16, 0, Py_None);
  __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
  PyTuple_SET_ITEM(__pyx_t_16, 1, ((PyObject *)(&PyInt_Type)));
  __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
  PyTuple_SET_ITEM(__pyx_t_16, 2, ((PyObject *)(&PyUnicode_Type)));
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_19, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_table_name_col, __pyx_t_1) < 0) __PYX_ERR(0, 1588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+1594:             symbols: Union[str, bool, List[int], List[str]] = 'auto',
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Union); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_List); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_t_16, ((PyObject *)(&PyInt_Type))); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_List); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_16, ((PyObject *)(&PyUnicode_Type))); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_16 = PyTuple_New(4); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
  PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)(&PyUnicode_Type)));
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7cpython_4bool_bool));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7cpython_4bool_bool));
  PyTuple_SET_ITEM(__pyx_t_16, 1, ((PyObject *)__pyx_ptype_7cpython_4bool_bool));
  __Pyx_GIVEREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_19);
  __Pyx_GIVEREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_15);
  __pyx_t_19 = 0;
  __pyx_t_15 = 0;
  __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_symbols, __pyx_t_15) < 0) __PYX_ERR(0, 1588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+1595:             at: Union[None, int, str, TimestampNanos, datetime] = None):
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (kw_args > 0 && likely(kw_args <= 4)) {
        Py_ssize_t index;
        for (index = 1; index < 5 && kw_args > 0; index++) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
          if (value) { values[index] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dataframe") < 0)) __PYX_ERR(0, 1588, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_df = values[0];
    __pyx_v_table_name = values[1];
    __pyx_v_table_name_col = values[2];
    __pyx_v_symbols = values[3];
    __pyx_v_at = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dataframe", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1588, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("questdb.ingress.Sender.dataframe", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7questdb_7ingress_6Sender_14dataframe(((struct __pyx_obj_7questdb_7ingress_Sender *)__pyx_v_self), __pyx_v_df, __pyx_v_table_name, __pyx_v_table_name_col, __pyx_v_symbols, __pyx_v_at);
/* … */
  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_Union); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = PyTuple_New(5); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_16, 0, Py_None);
  __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
  PyTuple_SET_ITEM(__pyx_t_16, 1, ((PyObject *)(&PyInt_Type)));
  __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
  PyTuple_SET_ITEM(__pyx_t_16, 2, ((PyObject *)(&PyUnicode_Type)));
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos));
  PyTuple_SET_ITEM(__pyx_t_16, 3, ((PyObject *)__pyx_ptype_7questdb_7ingress_TimestampNanos));
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  PyTuple_SET_ITEM(__pyx_t_16, 4, ((PyObject *)__pyx_ptype_7cpython_8datetime_datetime));
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_at, __pyx_t_1) < 0) __PYX_ERR(0, 1588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 1596:         """
 1597:         Write a Pandas DataFrame to the internal buffer.
 1598: 
 1599:         Example:
 1600: 
 1601:         .. code-block:: python
 1602: 
 1603:             import pandas as pd
 1604:             import questdb.ingress as qi
 1605: 
 1606:             df = pd.DataFrame({
 1607:                 'car': pd.Categorical(['Nic 42', 'Eddi', 'Nic 42', 'Eddi']),
 1608:                 'position': [1, 2, 1, 2],
 1609:                 'speed': [89.3, 98.2, 3, 4],
 1610:                 'lat_gforce': [0.1, -0.2, -0.6, 0.4],
 1611:                 'accelleration': [0.1, -0.2, 0.6, 4.4],
 1612:                 'tyre_pressure': [2.6, 2.5, 2.6, 2.5],
 1613:                 'ts': [
 1614:                     pd.Timestamp('2022-08-09 13:56:00'),
 1615:                     pd.Timestamp('2022-08-09 13:56:01'),
 1616:                     pd.Timestamp('2022-08-09 13:56:02'),
 1617:                     pd.Timestamp('2022-08-09 13:56:03')]})
 1618: 
 1619:             with qi.Sender('localhost', 9000) as sender:
 1620:                 sender.dataframe(df, table_name='race_metrics', at='ts')
 1621: 
 1622:         This method builds on top of the :func:`Buffer.dataframe` method.
 1623:         See its documentation for details on arguments.
 1624: 
 1625:         Additionally, this method also supports auto-flushing the buffer
 1626:         as specified in the ``Sender``'s ``auto_flush`` constructor argument.
 1627:         Auto-flushing is implemented incrementally, meanting that when
 1628:         calling ``sender.dataframe(df)`` with a large ``df``, the sender may
 1629:         have sent some of the rows to the server already whist the rest of the
 1630:         rows are going to be sent at the next auto-flush or next explicit call
 1631:         to :func:`Sender.flush`.
 1632: 
 1633:         In case of data errors with auto-flushing enabled, some of the rows
 1634:         may have been transmitted to the server already.
 1635:         """
+1636:         cdef auto_flush_t af = auto_flush_blank()
  __pyx_v_af = __pyx_f_7questdb_7ingress_auto_flush_blank();
+1637:         if self._auto_flush_enabled:
  __pyx_t_1 = (__pyx_v_self->_auto_flush_enabled != 0);
  if (__pyx_t_1) {
/* … */
  }
+1638:             af.sender = self._impl
    __pyx_t_2 = __pyx_v_self->_impl;
    __pyx_v_af.sender = __pyx_t_2;
+1639:             af.watermark = self._auto_flush_watermark
    __pyx_t_3 = __pyx_v_self->_auto_flush_watermark;
    __pyx_v_af.watermark = __pyx_t_3;
+1640:         _dataframe(
  __pyx_t_4 = __pyx_f_7questdb_7ingress__dataframe(__pyx_v_af, __pyx_v_self->_buffer->_impl, __pyx_v_self->_buffer->_b, __pyx_v_df, __pyx_v_table_name, __pyx_v_table_name_col, __pyx_v_symbols, __pyx_v_at); if (unlikely(__pyx_t_4 == ((__pyx_t_7questdb_7ingress_void_int)-1))) __PYX_ERR(0, 1640, __pyx_L1_error)
 1641:             af,
 1642:             self._buffer._impl,
 1643:             self._buffer._b,
 1644:             df,
 1645:             table_name,
 1646:             table_name_col,
 1647:             symbols,
 1648:             at)
 1649: 
+1650:     cpdef flush(self, Buffer buffer=None, bint clear=True):
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_17flush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7questdb_7ingress_6Sender_flush(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7questdb_7ingress_6Sender_flush *__pyx_optional_args) {
  struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_buffer = ((struct __pyx_obj_7questdb_7ingress_Buffer *)Py_None);
  int __pyx_v_clear = ((int)1);
  struct line_sender *__pyx_v_sender;
  struct line_sender_error *__pyx_v_err;
  struct line_sender_buffer *__pyx_v_c_buf;
  PyThreadState *__pyx_v_gs;
  int __pyx_v_ok;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_buffer = __pyx_optional_args->buffer;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_clear = __pyx_optional_args->clear;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flush); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1650, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7questdb_7ingress_6Sender_17flush)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1650, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        __pyx_t_6 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_6 = 1;
          }
        }
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_buffer), __pyx_t_3};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1650, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
          PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_buffer), __pyx_t_3};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1650, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1650, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
          }
          __Pyx_INCREF(((PyObject *)__pyx_v_buffer));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_buffer));
          PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_buffer));
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1650, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("questdb.ingress.Sender.flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_17flush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Sender_16flush[] = "\n        If called with no arguments, immediately flushes the internal buffer.\n\n        Alternatively you can flush a buffer that was constructed explicitly\n        by passing ``buffer``.\n\n        The buffer will be cleared by default, unless ``clear`` is set to\n        ``False``.\n\n        This method does nothing if the provided or internal buffer is empty.\n\n        :param buffer: The buffer to flush. If ``None``, the internal buffer\n            is flushed.\n\n        :param clear: If ``True``, the flushed buffer is cleared (default).\n            If ``False``, the flushed buffer is left in the internal buffer.\n            Note that ``clear=False`` is only supported if ``buffer`` is also\n            specified.\n\n        The Python GIL is released during the network IO operation.\n        ";
static PyMethodDef __pyx_mdef_7questdb_7ingress_6Sender_17flush = {"flush", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7questdb_7ingress_6Sender_17flush, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7questdb_7ingress_6Sender_16flush};
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_17flush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_buffer = 0;
  int __pyx_v_clear;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buffer,&__pyx_n_s_clear,0};
    PyObject* values[2] = {0,0};
    values[0] = (PyObject *)((struct __pyx_obj_7questdb_7ingress_Buffer *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_clear);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flush") < 0)) __PYX_ERR(0, 1650, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_buffer = ((struct __pyx_obj_7questdb_7ingress_Buffer *)values[0]);
    if (values[1]) {
      __pyx_v_clear = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_clear == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1650, __pyx_L3_error)
    } else {
      __pyx_v_clear = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("flush", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1650, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("questdb.ingress.Sender.flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_buffer), __pyx_ptype_7questdb_7ingress_Buffer, 1, "buffer", 0))) __PYX_ERR(0, 1650, __pyx_L1_error)
  __pyx_r = __pyx_pf_7questdb_7ingress_6Sender_16flush(((struct __pyx_obj_7questdb_7ingress_Sender *)__pyx_v_self), __pyx_v_buffer, __pyx_v_clear);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Sender_16flush(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self, struct __pyx_obj_7questdb_7ingress_Buffer *__pyx_v_buffer, int __pyx_v_clear) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flush", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.buffer = __pyx_v_buffer;
  __pyx_t_2.clear = __pyx_v_clear;
  __pyx_t_1 = __pyx_vtabptr_7questdb_7ingress_Sender->flush(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.Sender.flush", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__92 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_buffer, __pyx_n_s_clear); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 1650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);
/* … */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_6Sender_17flush, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sender_flush, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_Sender->tp_dict, __pyx_n_s_flush, __pyx_t_1) < 0) __PYX_ERR(0, 1650, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_Sender);
  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_flush, 1650, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 1650, __pyx_L1_error)
/* … */
struct __pyx_opt_args_7questdb_7ingress_6Sender_flush {
  int __pyx_n;
  struct __pyx_obj_7questdb_7ingress_Buffer *buffer;
  int clear;
};
 1651:         """
 1652:         If called with no arguments, immediately flushes the internal buffer.
 1653: 
 1654:         Alternatively you can flush a buffer that was constructed explicitly
 1655:         by passing ``buffer``.
 1656: 
 1657:         The buffer will be cleared by default, unless ``clear`` is set to
 1658:         ``False``.
 1659: 
 1660:         This method does nothing if the provided or internal buffer is empty.
 1661: 
 1662:         :param buffer: The buffer to flush. If ``None``, the internal buffer
 1663:             is flushed.
 1664: 
 1665:         :param clear: If ``True``, the flushed buffer is cleared (default).
 1666:             If ``False``, the flushed buffer is left in the internal buffer.
 1667:             Note that ``clear=False`` is only supported if ``buffer`` is also
 1668:             specified.
 1669: 
 1670:         The Python GIL is released during the network IO operation.
 1671:         """
+1672:         cdef line_sender* sender = self._impl
  __pyx_t_8 = __pyx_v_self->_impl;
  __pyx_v_sender = __pyx_t_8;
+1673:         cdef line_sender_error* err = NULL
  __pyx_v_err = NULL;
+1674:         cdef line_sender_buffer* c_buf = NULL
  __pyx_v_c_buf = NULL;
+1675:         cdef PyThreadState* gs = NULL  # GIL state. NULL means we have the GIL.
  __pyx_v_gs = NULL;
+1676:         cdef bint ok = False
  __pyx_v_ok = 0;
 1677: 
+1678:         if buffer is None and not clear:
  __pyx_t_10 = (((PyObject *)__pyx_v_buffer) == Py_None);
  __pyx_t_11 = (__pyx_t_10 != 0);
  if (__pyx_t_11) {
  } else {
    __pyx_t_9 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_11 = ((!(__pyx_v_clear != 0)) != 0);
  __pyx_t_9 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_9)) {
/* … */
  }
+1679:             raise ValueError('The internal buffer must always be cleared.')
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1679, __pyx_L1_error)
/* … */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_u_The_internal_buffer_must_always); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 1679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);
 1680: 
+1681:         if sender == NULL:
  __pyx_t_9 = ((__pyx_v_sender == NULL) != 0);
  if (unlikely(__pyx_t_9)) {
/* … */
  }
+1682:             raise IngressError(
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IngressError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
+1683:                 IngressErrorCode.InvalidApiCall,
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_IngressErrorCode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InvalidApiCall); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_7, __pyx_kp_u_flush_can_t_be_called_Not_connec};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1682, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_7, __pyx_kp_u_flush_can_t_be_called_Not_connec};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1682, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1682, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_t_7);
      __Pyx_INCREF(__pyx_kp_u_flush_can_t_be_called_Not_connec);
      __Pyx_GIVEREF(__pyx_kp_u_flush_can_t_be_called_Not_connec);
      PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_kp_u_flush_can_t_be_called_Not_connec);
      __pyx_t_7 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1682, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1682, __pyx_L1_error)
 1684:                 'flush() can\'t be called: Not connected.')
+1685:         if buffer is not None:
  __pyx_t_9 = (((PyObject *)__pyx_v_buffer) != Py_None);
  __pyx_t_11 = (__pyx_t_9 != 0);
  if (__pyx_t_11) {
/* … */
    goto __pyx_L7;
  }
+1686:             c_buf = buffer._impl
    __pyx_t_12 = __pyx_v_buffer->_impl;
    __pyx_v_c_buf = __pyx_t_12;
 1687:         else:
+1688:             c_buf = self._buffer._impl
  /*else*/ {
    __pyx_t_12 = __pyx_v_self->_buffer->_impl;
    __pyx_v_c_buf = __pyx_t_12;
  }
  __pyx_L7:;
+1689:         if line_sender_buffer_size(c_buf) == 0:
  __pyx_t_11 = ((line_sender_buffer_size(__pyx_v_c_buf) == 0) != 0);
  if (__pyx_t_11) {
/* … */
  }
+1690:             return
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
 1691: 
 1692:         # We might be blocking on IO, so temporarily release the GIL.
+1693:         _ensure_doesnt_have_gil(&gs)
  (void)(__pyx_f_7questdb_7ingress__ensure_doesnt_have_gil((&__pyx_v_gs)));
+1694:         if clear:
  __pyx_t_11 = (__pyx_v_clear != 0);
  if (__pyx_t_11) {
/* … */
    goto __pyx_L9;
  }
+1695:             ok = line_sender_flush(sender, c_buf, &err)
    __pyx_v_ok = line_sender_flush(__pyx_v_sender, __pyx_v_c_buf, (&__pyx_v_err));
 1696:         else:
+1697:             ok = line_sender_flush_and_keep(sender, c_buf, &err)
  /*else*/ {
    __pyx_v_ok = line_sender_flush_and_keep(__pyx_v_sender, __pyx_v_c_buf, (&__pyx_v_err));
  }
  __pyx_L9:;
+1698:         _ensure_has_gil(&gs)
  __pyx_f_7questdb_7ingress__ensure_has_gil((&__pyx_v_gs));
+1699:         if not ok:
  __pyx_t_11 = ((!(__pyx_v_ok != 0)) != 0);
  if (__pyx_t_11) {
/* … */
  }
+1700:             if c_buf == self._buffer._impl:
    __pyx_t_11 = ((__pyx_v_c_buf == __pyx_v_self->_buffer->_impl) != 0);
    if (__pyx_t_11) {
/* … */
    }
 1701:                 # Prevent a follow-up call to `.close(flush=True)` (as is
 1702:                 # usually called from `__exit__`) to raise after the sender
 1703:                 # entered an error state following a failed call to `.flush()`.
 1704:                 # Note: In this case `clear` is always `True`.
+1705:                 line_sender_buffer_clear(c_buf)
      line_sender_buffer_clear(__pyx_v_c_buf);
+1706:             raise c_err_to_py_fmt(err, _FLUSH_FMT)
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FLUSH_FMT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 1706, __pyx_L1_error)
    __pyx_t_2 = __pyx_f_7questdb_7ingress_c_err_to_py_fmt(__pyx_v_err, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1706, __pyx_L1_error)
 1707: 
+1708:     cdef _close(self):
static PyObject *__pyx_f_7questdb_7ingress_6Sender__close(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_close", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
+1709:         self._buffer = None
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_buffer);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_buffer));
  __pyx_v_self->_buffer = ((struct __pyx_obj_7questdb_7ingress_Buffer *)Py_None);
+1710:         line_sender_opts_free(self._opts)
  line_sender_opts_free(__pyx_v_self->_opts);
+1711:         self._opts = NULL
  __pyx_v_self->_opts = NULL;
+1712:         line_sender_close(self._impl)
  line_sender_close(__pyx_v_self->_impl);
+1713:         self._impl = NULL
  __pyx_v_self->_impl = NULL;
 1714: 
+1715:     cpdef close(self, bint flush=True):
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_19close(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7questdb_7ingress_6Sender_close(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7questdb_7ingress_6Sender_close *__pyx_optional_args) {
  int __pyx_v_flush = ((int)1);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_flush = __pyx_optional_args->flush;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1715, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_7questdb_7ingress_6Sender_19close)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_flush); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1715, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1715, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("questdb.ingress.Sender.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_19close(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Sender_18close[] = "\n        Disconnect.\n\n        This method is idempotent and can be called repeatedly.\n\n        Once a sender is closed, it can't be re-used.\n\n        :param bool flush: If ``True``, flush the internal buffer before closing.\n        ";
static PyMethodDef __pyx_mdef_7questdb_7ingress_6Sender_19close = {"close", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7questdb_7ingress_6Sender_19close, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7questdb_7ingress_6Sender_18close};
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_19close(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_flush;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flush,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flush);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "close") < 0)) __PYX_ERR(0, 1715, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_flush = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_flush == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1715, __pyx_L3_error)
    } else {
      __pyx_v_flush = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("close", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1715, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("questdb.ingress.Sender.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7questdb_7ingress_6Sender_18close(((struct __pyx_obj_7questdb_7ingress_Sender *)__pyx_v_self), __pyx_v_flush);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Sender_18close(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self, int __pyx_v_flush) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.flush = __pyx_v_flush;
  __pyx_t_1 = __pyx_vtabptr_7questdb_7ingress_Sender->close(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("questdb.ingress.Sender.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__94 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_flush); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 1715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);
/* … */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_6Sender_19close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sender_close, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_Sender->tp_dict, __pyx_n_s_close, __pyx_t_1) < 0) __PYX_ERR(0, 1715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_Sender);
  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_close, 1715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 1715, __pyx_L1_error)
/* … */
struct __pyx_opt_args_7questdb_7ingress_6Sender_close {
  int __pyx_n;
  int flush;
};
 1716:         """
 1717:         Disconnect.
 1718: 
 1719:         This method is idempotent and can be called repeatedly.
 1720: 
 1721:         Once a sender is closed, it can't be re-used.
 1722: 
 1723:         :param bool flush: If ``True``, flush the internal buffer before closing.
 1724:         """
+1725:         try:
  /*try:*/ {
+1726:             if (flush and (self._impl != NULL) and
    __pyx_t_7 = (__pyx_v_flush != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = ((__pyx_v_self->_impl != NULL) != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
/* … */
    if (__pyx_t_6) {
/* … */
    }
  }
+1727:                     (not line_sender_must_close(self._impl))):
    __pyx_t_7 = ((!(line_sender_must_close(__pyx_v_self->_impl) != 0)) != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;
+1728:                 self.flush(None, True)
      __pyx_t_8.__pyx_n = 2;
      __pyx_t_8.buffer = ((struct __pyx_obj_7questdb_7ingress_Buffer *)Py_None);
      __pyx_t_8.clear = 1;
      __pyx_t_1 = ((struct __pyx_vtabstruct_7questdb_7ingress_Sender *)__pyx_v_self->__pyx_vtab)->flush(__pyx_v_self, 0, &__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1728, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 1729:         finally:
+1730:             self._close()
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_1 = ((struct __pyx_vtabstruct_7questdb_7ingress_Sender *)__pyx_v_self->__pyx_vtab)->_close(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
      {
        __pyx_t_1 = ((struct __pyx_vtabstruct_7questdb_7ingress_Sender *)__pyx_v_self->__pyx_vtab)->_close(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1730, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
      goto __pyx_L1_error;
      __pyx_L11_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }
 1731: 
+1732:     def __exit__(self, exc_type, _exc_val, _exc_tb):
/* Python wrapper */
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_21__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7questdb_7ingress_6Sender_20__exit__[] = "\n        Flush pending and disconnect at the end of a ``with`` block.\n\n        If the ``with`` block raises an exception, any pending data will\n        *NOT* be flushed.\n\n        This is implemented by calling :func:`Sender.close`.\n        ";
static PyMethodDef __pyx_mdef_7questdb_7ingress_6Sender_21__exit__ = {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7questdb_7ingress_6Sender_21__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7questdb_7ingress_6Sender_20__exit__};
static PyObject *__pyx_pw_7questdb_7ingress_6Sender_21__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_exc_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v__exc_val = 0;
  CYTHON_UNUSED PyObject *__pyx_v__exc_tb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_val,&__pyx_n_s_exc_tb,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 1732, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 1732, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 1732, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_exc_type = values[0];
    __pyx_v__exc_val = values[1];
    __pyx_v__exc_tb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1732, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("questdb.ingress.Sender.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7questdb_7ingress_6Sender_20__exit__(((struct __pyx_obj_7questdb_7ingress_Sender *)__pyx_v_self), __pyx_v_exc_type, __pyx_v__exc_val, __pyx_v__exc_tb);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_7questdb_7ingress_6Sender_20__exit__(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self, PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v__exc_val, CYTHON_UNUSED PyObject *__pyx_v__exc_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__", 0);
/* … */
  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("questdb.ingress.Sender.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* … */
  __pyx_tuple__96 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);
/* … */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_7questdb_7ingress_6Sender_21__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Sender___exit, NULL, __pyx_n_s_questdb_ingress, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7questdb_7ingress_Sender->tp_dict, __pyx_n_s_exit, __pyx_t_1) < 0) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7questdb_7ingress_Sender);
  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_questdb_ingress_pyx, __pyx_n_s_exit, 1732, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 1732, __pyx_L1_error)
 1733:         """
 1734:         Flush pending and disconnect at the end of a ``with`` block.
 1735: 
 1736:         If the ``with`` block raises an exception, any pending data will
 1737:         *NOT* be flushed.
 1738: 
 1739:         This is implemented by calling :func:`Sender.close`.
 1740:         """
+1741:         self.close(not exc_type)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exc_type); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1741, __pyx_L1_error)
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.flush = (!__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7questdb_7ingress_Sender *)__pyx_v_self->__pyx_vtab)->close(__pyx_v_self, 0, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 1742: 
+1743:     def __dealloc__(self):
/* Python wrapper */
static void __pyx_pw_7questdb_7ingress_6Sender_23__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7questdb_7ingress_6Sender_23__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7questdb_7ingress_6Sender_22__dealloc__(((struct __pyx_obj_7questdb_7ingress_Sender *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_7questdb_7ingress_6Sender_22__dealloc__(struct __pyx_obj_7questdb_7ingress_Sender *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);
/* … */
  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("questdb.ingress.Sender.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}
+1744:         self._close()
  __pyx_t_1 = ((struct __pyx_vtabstruct_7questdb_7ingress_Sender *)__pyx_v_self->__pyx_vtab)->_close(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;