> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> DBeaver é uma ferramenta de banco de dados multiplataforma.

# Conectar o DBeaver ao ClickHouse

export const PartnerBadge = () => {
  return <div className="PartnerBadge">
            <div className="PartnerBadgeIcon">
                <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <polyline points="12.5 9.5 10 12 6 11 2.5 8.5" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <polyline points="4.54 4.41 8 3.5 11.46 4.41" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <path d="M2.15,3.78 L0.55,6.95 A0.5,0.5 0,0,0 0.77,7.62 L2.5,8.5 L4.54,4.41 L2.82,3.55 A0.5,0.5 0,0,0 2.15,3.78 Z" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <path d="M13.5,8.5 L15.23,7.62 A0.5,0.5 0,0,0 15.45,6.95 L13.85,3.78 A0.5,0.5 0,0,0 13.18,3.55 L11.46,4.41 Z" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <path d="M11.5,4.5 L9,4.5 L6.15,7.27 A0.5,0.5 0,0,0 6.24,8.05 C7.33,8.74 8.81,8.72 10,7.5 L12.5,9.5 L13.5,8.5" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <polyline points="7.75 13.5 5.15 12.85 3.5 11.67" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                </svg>
            </div>
            Partner Integration
        </div>;
};

export const Image = ({img, alt, size}) => {
  return <Frame>
      <img src={img} alt={alt} />
    </Frame>;
};

O DBeaver está disponível em várias versões. Neste guia, usamos o [DBeaver Community](https://dbeaver.io/). Veja as diferentes versões e recursos [aqui](https://dbeaver.com/edition/). O DBeaver se conecta ao ClickHouse usando JDBC.

<Note>
  Use o DBeaver versão 23.1.0 ou superior para ter melhor suporte a colunas `Nullable` no ClickHouse.
</Note>

<div id="1-gather-your-clickhouse-details">
  ## 1. Reúna as informações do seu ClickHouse
</div>

O DBeaver usa JDBC sobre HTTP(S) para se conectar ao ClickHouse; você precisa de:

* endpoint
* número da porta
* nome de usuário
* senha

<div id="2-download-dbeaver">
  ## 2. Baixe o DBeaver
</div>

O DBeaver está disponível em [https://dbeaver.io/download/](https://dbeaver.io/download/)

<div id="3-add-a-database">
  ## 3. Adicione um banco de dados
</div>

* Use o menu **Database > New Database Connection** ou o ícone **New Database Connection** no **Database Navigator** para abrir a caixa de diálogo **Connect to a database**:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/OHCdlXRrniGWimcZ/images/integrations/sql-clients/dbeaver-add-database.png?fit=max&auto=format&n=OHCdlXRrniGWimcZ&q=85&s=bd3f45b1a41961a91a8253ce5f15242e" size="md" border alt="Adicionar um novo banco de dados" width="642" height="385" data-path="images/integrations/sql-clients/dbeaver-add-database.png" />

* Selecione **Analytical** e, em seguida, **ClickHouse**:

* Monte a URL JDBC. Na guia **Main**, defina Host, Port, Username, Password e Database:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/OHCdlXRrniGWimcZ/images/integrations/sql-clients/dbeaver-host-port.png?fit=max&auto=format&n=OHCdlXRrniGWimcZ&q=85&s=59c59e348b8124981c6e8800f0d2a43e" size="md" border alt="Defina o hostname, a porta, o usuário, a senha e o nome do banco de dados" width="650" height="654" data-path="images/integrations/sql-clients/dbeaver-host-port.png" />

* Por padrão, a propriedade **SSL > Use SSL** não estará ativada. Se você estiver se conectando ao ClickHouse Cloud ou a um servidor que exige SSL na porta HTTP, ative **SSL > Use SSL**:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/OHCdlXRrniGWimcZ/images/integrations/sql-clients/dbeaver-use-ssl.png?fit=max&auto=format&n=OHCdlXRrniGWimcZ&q=85&s=b3f5d76c3bf280d4ac0f59cf970a918f" size="md" border alt="Ative SSL, se necessário" width="650" height="654" data-path="images/integrations/sql-clients/dbeaver-use-ssl.png" />

* Teste a conexão:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/OHCdlXRrniGWimcZ/images/integrations/sql-clients/dbeaver-test-connection.png?fit=max&auto=format&n=OHCdlXRrniGWimcZ&q=85&s=381f793440b6238e2a9304d0f033f828" size="md" border alt="Teste a conexão" width="650" height="654" data-path="images/integrations/sql-clients/dbeaver-test-connection.png" />

Se o DBeaver detectar que você não tem o driver do ClickHouse instalado, ele oferecerá baixá-lo para você:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/OHCdlXRrniGWimcZ/images/integrations/sql-clients/dbeaver-download-driver.png?fit=max&auto=format&n=OHCdlXRrniGWimcZ&q=85&s=66c8cf1d7e0375eee72e2b870b265bcb" size="md" border alt="Baixe o driver do ClickHouse" width="612" height="689" data-path="images/integrations/sql-clients/dbeaver-download-driver.png" />

* Após baixar o driver, **Test** a conexão novamente:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/OHCdlXRrniGWimcZ/images/integrations/sql-clients/dbeaver-test-connection.png?fit=max&auto=format&n=OHCdlXRrniGWimcZ&q=85&s=381f793440b6238e2a9304d0f033f828" size="md" border alt="Teste a conexão" width="650" height="654" data-path="images/integrations/sql-clients/dbeaver-test-connection.png" />

<div id="4-query-clickhouse">
  ## 4. Consultar o ClickHouse
</div>

Abra um editor de consultas e execute uma consulta.

* Clique com o botão direito na conexão e escolha **SQL Editor > Open SQL Script** para abrir um editor de consultas:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/OHCdlXRrniGWimcZ/images/integrations/sql-clients/dbeaver-sql-editor.png?fit=max&auto=format&n=OHCdlXRrniGWimcZ&q=85&s=dec493389745bf2ef76b23a1e23aa00b" size="md" border alt="Abrir o editor SQL" width="636" height="162" data-path="images/integrations/sql-clients/dbeaver-sql-editor.png" />

* Exemplo de consulta em `system.query_log`:

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/OHCdlXRrniGWimcZ/images/integrations/sql-clients/dbeaver-query-log-select.png?fit=max&auto=format&n=OHCdlXRrniGWimcZ&q=85&s=12e236175339e41679d0a029b1c76d30" size="md" border alt="Uma consulta de exemplo" width="712" height="316" data-path="images/integrations/sql-clients/dbeaver-query-log-select.png" />

<div id="next-steps">
  ## Próximas etapas
</div>

Consulte a [wiki do DBeaver](https://github.com/dbeaver/dbeaver/wiki) para saber mais sobre os recursos do DBeaver e a [documentação do ClickHouse](/pt-BR/) para saber mais sobre os recursos do ClickHouse.
