TDengine is an open source, high-performance, cloud native time-series database optimized for Internet of Things (IoT), Connected Cars, Industrial IoT and DevOps.
# if database is specified,
# then it must exist.
conn = taos.connect(host="192.168.1.206",
port=6030,
user="root",
password="taosdata",
database="fastbee_log")
print('client info:', conn.client_info)
print('server info:', conn.server_info)
result: taos.TaosResult = conn.query("select * from device_d1124a81570s")
connect_example.py:22:
C:\DevelopmentLanguage\python\Python38\lib\site-packages\taos\connection.py:85: in query
res = taos_query(self._conn, sql)
connection = c_void_p(1526890475472), sql = 'select * from device_d1124a81570s'
def taos_query(connection, sql):
# type: (c_void_p, str) -> c_void_p
"""Run SQL
- sql: str, sql string to run
@return: TAOS_RES*, result pointer
"""
try:
ptr = c_char_p(sql.encode("utf-8"))
res = c_void_p(_libtaos.taos_query(connection, ptr))
errno = taos_errno(res)
if errno != 0:
errstr = taos_errstr(res)
taos_free_result(res)
raise ProgrammingError(errstr, errno)
E taos.error.ProgrammingError: [0x0216]: syntax error near 'unrecognized token: ""'
============================= test session starts ============================= collecting ... collected 1 item
connect_example.py::test_connection FAILED [100%]client info: 2.6.0.34 server info: 2.6.0.12
connect_example.py:10 (test_connection) def test_connection():
all parameters are optional.
connect_example.py:22:
C:\DevelopmentLanguage\python\Python38\lib\site-packages\taos\connection.py:85: in query res = taos_query(self._conn, sql)
connection = c_void_p(1526890475472), sql = 'select * from device_d1124a81570s'
C:\DevelopmentLanguage\python\Python38\lib\site-packages\taos\cinterface.py:329: ProgrammingError
============================== 1 failed in 0.28s ==============================
Process finished with exit code 1