This page shows how to update existing data in QuestDB using different programming languages and tools. There are two main methods for updating data:
- Postgres wire protocol for compatibility with a range of clients
- REST API provides access to QuestDB via HTTP
You can query data using the Postgres endpoint
that QuestDB exposes. This is accessible via port
8812 by default. More
information on the Postgres wire protocol implementation with details on
supported features can be found on the
Postgres API reference page.
This example uses naive
Date.now() * 1000 inserts for Timestamp types in
microsecond resolution. For accurate microsecond timestamps, the
process.hrtime.bigint() call can be used.
QuestDB exposes a REST API for compatibility with a wide range of libraries and
tools. The REST API is accessible on port
9000 and has the following
/imp- import data
/exec- execute an SQL statement
More details on the use of these entrypoints can be found on the REST API reference page.
/imp endpoint does not allow for updating data.
/exec endpoint can be used to create a table and the
INSERT statement can be used to populate it with values:
node-fetch package can be installed using
npm i node-fetch.
By default, QuestDB has an embedded Web Console running at
http://[server-address]:9000. When running locally, this is accessible at
http://localhost:9000. The Web Console can be used to
explore table schemas, visualizing query results as tables or graphs, and
importing datasets from CSV files. For details on these components, refer to the
Web Console reference page.