Obtenha dados de um SQLite arquivo em Planilhas Google
Abra seu banco de dados SQLite no Google Sheets e atualize-o quando quiser. Sem uploads de CSV, sem Apps Script, sem copiar e colar. Leva cerca de dez minutos na primeira vez, e o plano gratuito cobre isso.
O resultado final será o que você obterá.
Uma planilha do Google que exibe os resultados em tempo real de uma consulta SQL em seu arquivo SQLite, com um botão que busca as linhas mais recentes sempre que os dados forem alterados. Assim:
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | ID do cliente | primeiro nome | sobrenome | país | total |
| 2 | 1042 | Maria | Álvarez | EUA | 1,284.50 |
| 3 | 1043 | Daniel | Okafor | EUA | 612.00 |
| 4 | 1047 | Priya | Nair | EUA | 2,090.75 |
| 5 | 1051 | Thomas | Berg | EUA | 338.20 |
| 6 | 1056 | Lúcia | Ferreira | EUA | 1,455.00 |
| 7 | 1060 | Kenji | Sato | EUA | 874.10 |
| 8 |
Os bancos de dados SQLite são arquivos únicos, geralmente com a extensão .sqlite. .db, .sqlite, .sqlite3O Google Sheets não consegue abrir esses arquivos, e a solução usual é exportar um CSV e carregá-lo novamente sempre que os dados forem alterados. O Query Streams evita isso: um pequeno programa auxiliar lê o arquivo onde ele já está salvo, e um complemento do Google Sheets 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: qualquer navegador em qualquer dispositivo.
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 Google Sheets solicita. O passo 2 abaixo mostra onde obtê-lo.
Seu arquivo SQLite
Saiba onde fica, por exemplo. C:\Data\vendas.db ou \\server\share\sales.db. 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 Google Sheets pode estar em qualquer lugar.Ele é executado no seu navegador, portanto, nada é instalado no local onde você lê os dados.
Conecte-o em cinco etapas
-
Crie sua conta
Vá para my.querystreams.com e inscreva-se. Escolha o Gratuito plano. É um plano real, não uma versão de teste, e abrange a conexão do seu arquivo SQLite e a execução de consultas a partir do Google Sheets.
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-on.
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.
-
Aponte para o seu arquivo SQLite.
De volta ao seu navegador, abra Agentes de dados (sob Dados (no menu superior). Seu agente está listado lá. Clique Adicionar conector, escolher SQLitee 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 SQLite file is: a path on the Agent’s computer, like C:\Data\sales.db, or a network path, like \\server\share\folder\sales.db, 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.
-
See your data in Query Builder Opcional
You can look at your SQLite file before Google Sheets 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-on’s Saved Queries list, and on any plan you can copy the SQL into the next step.
-
Adicionar fluxos de consulta ao Google Sheets
Abra qualquer planilha do Google e acesse Extensões → Complementos → Obter complementos, procurar Fluxos de consultae clique InstalarOu instale-o diretamente de Consultar fluxos no Google Workspace MarketplaceO Google pedirá que você permita o complemento; isso é normal.
Depois disso, estará presente em todas as Planilhas Google que você abrir: um ícone do Query Streams no painel lateral à direita, também listado em ExtensõesNão há necessidade de fazer login separadamente. O sistema reconhece a conta do Google que você já utiliza, portanto, o e-mail precisa ser o mesmo cadastrado na sua conta do Query Streams.
-
Puxe sua primeira mesa.
Clique no ícone "Consultar Fluxos" no painel lateral à direita da planilha (ou encontre-o em "Acessar Fluxos"). Extensões). Escolher Fluxo de consulta e selecione a conexão que você acabou de fazer.
Digite a consulta que deseja executar. Esta consulta extrai algumas colunas de uma tabela. clientes mesa:
Exemplo · SQLSELECT customer_id, name, city FROM customers ORDER BY name LIMIT 100;
Sob Folha de Destino Selecione a aba onde as linhas devem ser exibidas e clique em Executar consultaAs linhas aparecem nessa aba em um ou dois segundos. Clique em "Executar consulta" novamente sempre que os dados forem alterados e a aba 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.
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.
SQLite file on a share? Deixar Read-Only (Immutable) ticked, as it is by default; reads then take a point-in-time view of the file without locks. SQLite cannot use its WAL mode over a network, so with that box unticked a WAL-mode database on a \\servidor\compartilhamento path is refused, and the test says it is a WAL-mode SQLite database.
Test failed on a share?
A Windows Agent signs in to the file server itself, so its test result can also say:
| Mensagem | Causa | Consertar |
|---|---|---|
| Access denied for the agent’s service account under the path, or Acesso negado in the test result | The 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 refused | The 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 to | This 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 to | The 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 Google Sheets ou do Excel.
- 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 arquivo SQLite precisa estar no mesmo computador em que uso o Planilhas Google?
No. Only the Agent has to be able to open your SQLite file. Google Sheets runs in your browser on any device. Open the add-on with the same Google 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.
A planilha atualiza sozinha?
Clique em Executar Consulta novamente sempre que desejar as linhas mais recentes. Para uma planilha que seja atualizada automaticamente, sem que ninguém precise fazer nada, configure uma Automação no portal do Query Streams (Streams → Automação). Ela está disponível em todos os planos.
Guias relacionados
Todos os guias para SQLite
Não é bem a sua configuração?
- Você tem uma pasta com vários arquivos SQLite em vez de um único arquivo? O SQLite Folder mescla tabelas com o mesmo nome em uma única tabela e marca cada linha com o arquivo de origem → SQLite 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?

