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

# DBeaver

> Connecting DBeaver via JDBC protocol.

export const Diagram = ({src, alt}) => {
  return <div style={{
    display: "flex",
    "flex-direction": "column",
    "align-items": "center"
  }}>
    <img src={src} alt={alt} style={{
    background: "#dddddd",
    "margin-bottom": 0
  }} />
    <span>{alt}</span>
  </div>;
};

export const YouTubeList = ({id}) => {
  const src = `https://www.youtube.com/embed/videoseries?list=${id}`;
  return <iframe className="w-full aspect-video rounded-xl" src={src} allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen></iframe>;
};

export const YouTube = ({id, width}) => {
  const src = `https://www.youtube.com/embed/${id}`;
  return <iframe className="w-full aspect-video rounded-xl" src={src} allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen width={width}></iframe>;
};

export const Schema = ({t, id}) => {
  const anchor = id ? id : t.toLowerCase().replace(/\s+/g, "-");
  const link = `/odf/schemas#${anchor}`;
  return <a class="schema-object" href={link}>{t}</a>;
};

export const Term = ({t, id}) => {
  const anchor = id ? id : t.toLowerCase().replace(/\s+/g, "-");
  const link = `/general/glossary#${anchor}`;
  return <a class="glossary-term" href={link}>{t}</a>;
};

[DBeaver](https://dbeaver.io/) is a great free database exploration tool. It can be connected to `kamu` using a JDBC driver.

In this setup:

* `kamu` runs an [Arrow Flight SQL](https://arrow.apache.org/docs/format/FlightSql.html) server - a high-performance protocol for data transfer
* `DBeaver` loads a special JDBC driver - a Java software module that implements an abstract database interface
* JDBC driver translates `DBeaver`'s commands into efficient Flight SQL calls in `kamu`

To connect `DBeaver` to `kamu` follow these simple steps:

1. Downlaod the latest [Flight SQL JDBC Driver](https://central.sonatype.com/artifact/org.apache.arrow/flight-sql-jdbc-driver)
2. Add a new database driver in `DBeaver` by following [these steps](https://dbeaver.com/docs/dbeaver/Database-drivers/)
   * For class name use:
     ```
     org.apache.arrow.driver.jdbc.ArrowFlightJdbcDriver
     ```
   * For URL template use:
     ```
     jdbc:arrow-flight-sql://{host}:{port}
     ```
   * In libraries add the driver's `.jar` file you just downloaded
3. Run `kamu` Flight SQL server in a desired workspace:
   ```bash theme={null}
   kamu sql server --flight-sql --address 127.0.0.1 --port 50050
   ```
4. Create a new connection in `DBeaver` using the driver you created:
   * Specify host and port, e.g. `127.0.0.1:50050`
   * Use `"anonymous"` as username and password or specify a token for authentication
   * In `Driver properties` tab add user property:
     ```bash theme={null}
     useEncryption=false
     ```
