[英]transfer data between databases - influx-python
I am trying to write points that been taken from one database to another (influxdb-python), I have created a list of dict, and I am using write_points('list of dicts'). 我试图将从一个数据库获取的点写到另一个数据库(influxdb-python),我创建了一个字典列表,并且我正在使用write_points('字典列表')。 I even tried to simplify things by getting only 2 points.
我什至试图通过仅获得2分来简化事情。
here is my code and the errors, pls help 这是我的代码和错误,请帮助
rs = cli.query("""SELECT * FROM cpu_value WHERE time > now() - 2s""")
points = rs.get_points()
a=next(points)
b=next(points)
temp=[]
temp.append(a)
temp.append(b)
client = InfluxDBClient(database='test')
client.write_points(temp)
使用INTO子句从一个数据库写入另一个数据库比通过外部库导出和导入点要容易得多。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.