Connect

This page shows how to connect to QuestDB using different programming languages or tools.

First things first#

Make sure you have QuestDB running and accessible, you can do so from Docker, the binaries or Homebrew for macOS users.

Postgres compatibility#

You can query data using the Postgres endpoint that QuestDB exposes. This is accessible via port 8812.

const { Client } = require("pg")
const start = async () => {
const client = new Client({
database: "qdb",
host: "127.0.0.1",
password: "quest",
port: 8812,
user: "admin",
})
await client.connect()
console.log("Connected")
}
start()

InfluxDB line protocol#

QuestDB implements the InfluxDB line protocol, this endpoint is accessible on port 9009.

const net = require("net")
const client = new net.Socket()
const HOST = "localhost"
const PORT = 9009
function run() {
client.connect(PORT, HOST, () => {
console.log("Connected")
})
}
run()