Ver categorias

Como conectar o DuckDB ao Excel – Transmita dados de banco de dados de análise ao vivo

Conectar o DuckDB ao Excel

Obtenha dados de um DuckDB arquivo em Excel

Abra seu banco de dados DuckDB no Excel e atualize-o quando quiser. Sem driver ODBC, sem exportação para CSV, sem macros. Leva cerca de dez minutos na primeira vez, e o plano gratuito cobre isso.

Cerca de 10 minutos Não é necessário programar O arquivo permanece onde está. Excel em qualquer lugar, até mesmo na web.
Teve alguma dúvida? É só perguntar. Aberto Suporte Em Fluxos de Consulta (menu no canto superior direito → Suporte) e envie-nos uma mensagem. Pessoas reais leem as mensagens, e "Não sei o que esta tela está pedindo" é uma pergunta perfeitamente válida.

O resultado final será o que você obterá.

Logotipo do DuckDBUma planilha que exibe os resultados em tempo real de uma consulta SQL no seu arquivo DuckDB, com um botão que busca as linhas mais recentes sempre que os dados são alterados. Assim:

Os bancos de dados DuckDB são arquivos únicos, geralmente com a extensão .duckdb. .duckdbO Excel não consegue abrir esses arquivos por conta própria, e a solução usual envolve instalar um driver ODBC e lidar com strings de conexão. O Query Streams elimina essa dificuldade: um pequeno programa auxiliar lê o arquivo onde ele já está localizado, e um suplemento do Excel solicita as linhas desejadas. Os dois não precisam estar no mesmo computador. O arquivo pode estar no computador do escritório e você pode estar em qualquer lugar: no seu laptop em casa, no computador de um colega do outro lado do país ou no Excel na web.

ONDE O ARQUIVO ESTÁ GUARDADOcomputador do escritório, um servidor ou o de casa.Seu arquivo DuckDBsales.duckdb · permanece aquiAgente de fluxos de consultawhere it can open the fileFluxos de consultalink criptografadopela internet · apenas resultadosONDE QUER QUE VOCÊ ESTEJAseu laptop, outro escritório, um hotel, seu telefoneExcelWindows, Mac ou Excel na web
The Agent runs where it can open the file. Excel does not have to. Open the sheet anywhere and the rows come to you.

O que você vai precisar

Uma conta do Query Streams

O plano gratuito é suficiente para este guia. Cadastre-se em my.querystreams.com.

The Agent on a computer that can open the file

Um pequeno programa que roda em segundo plano e lê o arquivo quando o Excel solicita. O passo 2 abaixo mostra onde obtê-lo.

Seu arquivo DuckDB

Saiba onde fica, por exemplo. C:\Data\vendas.duckdb ou \\server\share\sales.duckdb. If it lives in OneDrive, Dropbox or Google Drive, make sure it is synced to the Agent’s computer.

Qual computador receberá o Agente? The one where the file is, or one that can open it from a network share (see Reaching a file on a network share below). That computer needs to stay on. O Excel pode estar em qualquer lugar.: seu laptop em casa, o computador de um colega em outra cidade ou o Excel na web. Nada mais precisa ser instalado onde o Excel é executado.

Conecte-o em cinco etapas

  1. Crie sua conta

    Vá para my.querystreams.com e inscreva-se. Escolha o Gratuito É um plano real, não uma versão de teste, e abrange a conexão do seu arquivo DuckDB e a execução de consultas a partir do Excel.

  2. Install the Agent on a computer that can open the file

    Faça login e abra Download, and install the Agent for your system on the computer where the file is, or on one that can open it from a network share. It takes a minute and starts on its own from then on.

    Por que um programa pequeno em vez de um driver? The Agent is one install for Windows, Mac or Linux (about 85 MB on Windows, a little over 100 MB on Mac and Linux) that runs quietly in the background. It makes one outbound, encrypted connection to Query Streams, the same way a browser does, so you open no firewall port and set up no VPN. The file stays where it is, and the rows travel to wherever you are, across the internet if need be. The only thing on your side is the add-in.

    A página de download mostra Sua chave de acessoCole o código no Agente quando solicitado e aguarde até que o crachá exiba a mensagem. Conectado a fluxos de consultaEssa é a única coisa que você faz no próprio Agente.

    Guias completos, se você quiser: Janelas, Mac, Linux.

  3. Aponte para o seu arquivo DuckDB.

    De volta ao seu navegador, abra Agentes de dados (sob Dados (no menu superior). Seu agente está listado lá. Clique Adicionar conector, escolher DuckDBe preencha:

    Nome da conexão
    Qualquer nome que você reconheça mais tarde, como Banco de Dados de Vendas.
    Caminho do arquivo do banco de dados
    Where the DuckDB file (.duckdb or .db) is: a path on the Agent’s computer, or a network path, like \\server\share\folder\sales.duckdb, never a mapped drive letter such as S:. Use Browse to pick it.

    Clique em Teste de conexãoQuando lê Conectado, clique SalvarA conexão chega ao seu agente em poucos segundos.

    O teste falhou? Usually the path has a typo, or it uses a mapped drive letter such as S:, which the Agent cannot see. Open the folder, copy the path from the address bar, and paste it in again. For a file on another computer, see Reaching a file on a network share abaixo.

  4. See your data in Query Builder Opcional

    You can look at your DuckDB file before Excel is involved at all. Open Construtor de consultas in the portal and pick the connection you just made. The Esquema tab lists your tables and columns, and clicking one puts its name in the editor, so you can write a query without remembering exact names. Click Executar and the rows appear under Resultados. Query Builder is on every plan, Free included.

    On Business plans you can also ask Nova in plain English (“show me customers in the USA”) and it writes the SQL for you. When the query looks right, save it: from Personal Core up it shows in the add-in’s Saved Queries list, and on any plan you can copy the SQL into the next step.

  5. Adicionar fluxos de consulta ao Excel

    No Excel, acesse Inserir → Obter suplementos, procurar Fluxos de consultae clique AdicionarOu abra-o diretamente de Consultar fluxos no Microsoft AppSourceUm botão "Consultar fluxos" aparece na faixa de opções. Faça login com a mesma conta.

    Funciona no Excel para Microsoft 365 no Windows e no Mac, e no Excel na Web.

  6. Puxe sua primeira mesa.

    Clique no botão Consultar fluxos e escolha Transmita uma consultaE selecione a conexão que você acabou de fazer.

    Digite a consulta que deseja executar. Esta consulta extrai algumas colunas de uma tabela. pedidos mesa:

    Exemplo · SQL
    SELECT order_id, customer_name, order_total FROM main.orders ORDER BY order_total DESC LIMIT 100;

    Sob Folha de Destino escolher Criar uma nova planilhaEm seguida, pressione o botão de reprodução (a seta ▶). As linhas serão exibidas no Excel em um ou dois segundos. Pressione-o novamente sempre que os dados forem alterados e a planilha será atualizada automaticamente.

    Não conhece SQL? Build it in Construtor de consultas first and paste it here, or pick it from Saved Queries if you saved it.

Reaching a file on a network share

The Agent opens files as a background service, not as you, so a file on another computer needs one extra step. Which step depends on the computer the Agent runs on.

Janelas

Type the network path, like \\servidor\compartilhamento\pasta, never a mapped drive letter such as S:, which the Agent cannot see. If the share only lets in named people, click Service identity (the chip under the path) and store a login for that server: a company domain account, or an account made on the server itself with Domain left blank. The Agent then signs in to that server and reads the file there, and every connector on that Agent that reads the same server must use the same login. Without a login, it reads as its own service account, which a company domain sees as the computer itself. Step by step on Windows

Linux

Share logins stored in the Portal are not used on Linux: an administrator mounts the share on the Agent’s computer first, in a folder under /mnt ou /mídia, because the Agent’s service cannot see /home ou /run/user. In the connector, keep the \\servidor\compartilhamento path, which the Agent maps onto the mount, or type the mount path instead, such as /mnt/fileserver-shared/Accounts. How to mount a share on Linux

Mac

Share logins stored in the Portal are not used on a Mac: mount the share first from Terminal with sudo, in a folder under /Volumes, so the Agent’s background service can see it. In the connector, keep the \\servidor\compartilhamento path, which the Agent maps onto the mount, or type the mount path instead, such as /Volumes/fileserver-shared/Accounts. How to mount a share on a Mac

If the test cannot get to the share, look for these words in its result: unreachable means the Agent’s computer got no answer from the server. On Linux or a Mac, not mounted means the share still has to be mounted, and that message includes the exact mount command for your server.

DuckDB file on a share? DuckDB allows one writer at a time, so the Agent cannot open a file that another program has open for writing; on a \\servidor\compartilhamento path the test says it is open for writing by another program. Close it there, or point the connector at a file nobody is writing to. Every query reads the file across the network, so a large file answers more slowly than it would from a local disk.

Test failed on a share?

A Windows Agent signs in to the file server itself, so its test result can also say:

MensagemCausaConsertar
Access denied for the agent’s service account under the path, or Acesso negado in the test resultThe share lets in named people only, and the Agent’s own Windows account is not one of them. Or the login stored for that server may not read this share.Clique em Service identity under the path and store a login that can read the share. If one is stored already, ask whoever runs the server to give that account read access.
the credentials were refusedThe server turned the stored login down: a typo, the wrong domain, or a password changed since it was saved.Click the account name under the path and type the login again; for an account made on the server itself, leave Domain blank. were refused moments ago means the Agent waits a minute before it tries that same login again, so the account is not locked out; saving a corrected password tries again straight away.
Another connector on this agent already signs in to, ou Windows already holds a sign-in toThis Windows computer already signs in to that server as a different account, through another connector or another program. Windows allows one account per server.Store the login the other connector uses, or change it on every connector that reads that server. After Windows already holds a sign-in, the rest of the message says which account it is and what to do.
This agent build cannot sign in toThe Agent is an older version that cannot use stored share logins.Update the Agent, then test again.

É isso. Seus dados estão na planilha e permanecem atualizados com um clique. Nada saiu da sua rede, exceto as linhas que você solicitou.

Boas próximas jogadas

  • Salvar consulta no portal, para que você possa executá-lo novamente com um clique, a partir do Excel ou do Google Sheets.
  • Adicionar um filtro como um intervalo de datas, para que a mesma consulta possa responder "este mês" sem precisar editar.
  • Compartilhe os resultados Com um colega. Eles veem as linhas, não o seu arquivo nem o caminho do arquivo.

Perguntas que as pessoas fazem

O Excel precisa estar no mesmo computador que o arquivo DuckDB?

No. Only the Agent has to be able to open your DuckDB file. Excel can be on any computer with an internet connection, including Excel on the web and Excel on a Mac. Sign in to the add-in with your account and your connections are there.

Meu arquivo de banco de dados é carregado em algum lugar?

No. The Agent reads the file where it sits and sends only the rows your query asks for. The file stays where it is.

O arquivo pode estar no OneDrive, Dropbox ou Google Drive?

Sim, desde que esteja sincronizado com o computador onde o Agente está sendo executado, para que o Agente o veja como um arquivo local comum. Direcione a conexão para a cópia sincronizada.

O plano gratuito realmente cobre isso?

Sim. A versão gratuita é um plano permanente, não um período de teste com prazo de validade. Veja exatamente o que está incluído no plano. página de preços.

Funciona com o Excel para Mac?

Sim. Excel para Microsoft 365 no Mac e no Windows, e Excel na Web.

Ainda com dificuldades? Aberto Suporte Em Fluxos de Consulta, informe-nos em qual etapa você está e o que você vê. Nós o conectaremos.
O Query Streams também conecta os mesmos dados aPlanilhas GoogleClaude, Cursor e ChatGPTuma API RESTe mais

Todos os guias para DuckDB

Não é bem a sua configuração?

  • Você tem uma pasta com arquivos Parquet em vez de um arquivo de banco de dados DuckDB? A opção "Pasta Parquet" lê todos os arquivos como uma única tabela → Parquet Folder
  • Deseja consultar as próprias pastas de trabalho do Excel? A opção Pasta do Excel lê uma pasta de pastas de trabalho como tabelas → Excel Folder

Setup trouble?

  • Agent says the file or folder does not exist, or access is denied? Mapped drives, network shares, OneDrive and Linux home folders each need one fix → Where the Agent can read files from
  • Agent shows Offline, or Test connection and Browse are greyed out? Check that the Agent is online → Is the Agent online?
Atualizado em outubro 17, 2026

Desenvolvido por BetterDocs