> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alginte.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ksqlDB

> Run ksqlDB statements and pull queries from the built-in SQL editor.

The **ksqlDB** entry appears in the sidebar when a ksqlDB server is
configured (`alginte.ksqldb.url` — see
[Configuration](https://docs.alginte.com/operate/configuration.md)); like every optional upstream, an
absent menu entry just means it's
[not configured](https://docs.alginte.com/guides/at-a-glance.md#the-sidebar-reflects-your-configuration).
Three tabs:

* **Editor** — a SQL editor with an execute button and a result panel. A mode
  switch distinguishes the two kinds of requests:
  * **Statement** — DDL/DML: `CREATE STREAM …`, `INSERT INTO …`,
    `SHOW STREAMS;`
  * **Query** — *pull queries* that return rows: `SELECT … WHERE …;`,
    with `LIMIT` for ranges.
* **Streams** — the server's streams (name, type, backing topic, key/value
  formats), refreshed automatically each time you return to the tab.
* **Tables** — the same view for tables.

![The ksqlDB Editor tab with the Query and Statement mode radio and the result panel](https://mintcdn.com/alginte-9b6e883f/XzJ_luxj10zyLCus/images/ksqldb-editor.png?fit=max\&auto=format\&n=XzJ_luxj10zyLCus\&q=85\&s=f797008e04b381ab39d83845d508e1c5)

The ksqlDB editor: Query/Statement mode switch above the SQL editor, results below.

A minimal end-to-end session — create the `riders` topic first
([Topics guide](https://docs.alginte.com/guides/topics.md#creating-a-topic)), then in *Statement* mode:

```sql theme={null}
CREATE STREAM riders (
  riderId VARCHAR KEY,
  city VARCHAR,
  distanceKm DOUBLE
) WITH (
  KAFKA_TOPIC = 'riders',
  VALUE_FORMAT = 'JSON'
);

INSERT INTO riders (riderId, city, distanceKm) VALUES ('r1', 'Ljubljana', 12.5);
```

Then switch to *Query* mode for a point lookup:

```sql theme={null}
SELECT * FROM riders WHERE riderId = 'r1';
```

> [!NOTE]
>
> The editor executes pull queries and statements. Continuous *push* queries
> (`EMIT CHANGES`) hold a connection open indefinitely and are rejected with
> a clear message — use a dedicated consumer (or the topic's
> [Live messages view](https://docs.alginte.com/guides/messages.md#browsing-messages)) to follow a
> stream continuously.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.