Connect

You can interact with a QuestDB database by connecting to one of its various network endpoints.

Network EndpointPortInserting & modifying data*Querying data
Web Console9000SQL INSERT, UPDATE, CSVSQL SELECT, charting
InfluxDB Line Protocol9009High performance bulk insert-
PostgreSQL wire protocol8812SQL INSERT, UPDATESQL SELECT
HTTP REST API9000SQL INSERT, UPDATE, CSVSQL SELECT, CSV

* UPDATE is available from QuestDB 6.4.

note

All network ports may be configured.

Web console#

The web console is a general admin and query interface. It's great for quickly trying things out. You can also chart your query results.

Connect your web browser to http://[server-address]:9000/. When running locally, this will be http://localhost:9000/.

Screenshot of the Web Console

InfluxDB Line Protocol#

The fastest way to insert data into QuestDB is using the InfluxDB Line Protocol (ILP).

It is an insert-only protocol that bypasses SQL INSERT statements achieving higher throughput.

readings,city=London temperature=23.2 1465839830100400000\n
readings,city=London temperature=23.6 1465839830100700000\n
readings,make=Honeywell temperature=23.2,humidity=0.443 1465839830100800000\n

Our ILP tutorial covers ingesting data with various client libraries.

For a more in-depth understanding, see our protocol documentation.

PostgreSQL wire protocol#

For SQL, we support the same wire protocol as PostgreSQL, allowing you to connect and query the database with various third-party pre-existing client libraries and tools.

import psycopg2
connection = None
try:
connection = psycopg2.connect(
user="admin",
password="quest",
host="127.0.0.1",
port="8812",
database="qdb")
finally:
if (connection):
connection.close()

See how you can connect through the PostgreSQL wire protocol from different programming languages to:

HTTP REST API#

The HTTP interface that hosts the web console also provides a REST API for importing data, exporting data and querying.

curl -F data=@data.csv http://localhost:9000/imp

Find out how to: