如何从 python 向 QuestDB 发送流入线协议消息?我应该使用库还是应该写入套接字?节点示例看起来像
const net = require("net")
const client = new net.Socket()
const HOST = "localhost"
const PORT = 9009
function run() {
client.connect(PORT, HOST, () => {
const rows = [
`trades,name=test_ilp1 value=12.4 ${Date.now() * 1e6}`,
`trades,name=test_ilp2 value=11.4 ${Date.now() * 1e6}`,
]
rows.forEach((row) => {
client.write(`${row}\n`)
})
client.destroy()
})
client.on("data", function (data) {
console.log("Received: " + data)
})
client.on("close", function () {
console.log("Connection closed")
})
}
run()