Ottieni dati da un DuckDB file in Fogli di Google
Apri il tuo database DuckDB in Fogli Google e aggiornalo quando vuoi. Niente caricamenti di file CSV, niente Apps Script, niente copia-incolla. La prima volta ci vogliono circa dieci minuti, ed è incluso nel piano gratuito.
Quello che otterrai alla fine
Un foglio Google che mostra i risultati in tempo reale di una query SQL sul tuo file DuckDB, con un pulsante che visualizza le righe più recenti ogni volta che i dati cambiano. Ad esempio:
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | ID cliente | nome di battesimo | cognome | Paese | totale |
| 2 | 1042 | Maria | Alvarez | U.S.A. | 1,284.50 |
| 3 | 1043 | Daniel | Okafor | U.S.A. | 612.00 |
| 4 | 1047 | Priya | Nair | U.S.A. | 2,090.75 |
| 5 | 1051 | Tommaso | Berg | U.S.A. | 338.20 |
| 6 | 1056 | Lucia | Ferreira | U.S.A. | 1,455.00 |
| 7 | 1060 | Kenji | Sato | U.S.A. | 874.10 |
| 8 |
I database DuckDB sono file singoli, che di solito terminano con .duckdbGoogle Sheets non è in grado di aprirli e la soluzione più comune è esportare un file CSV e caricarlo nuovamente ogni volta che i dati cambiano. Query Streams evita questo problema: un piccolo programma di supporto legge il file nella posizione in cui si trova già, e un componente aggiuntivo di Google Sheets gli richiede le righe desiderate. I due programmi non devono necessariamente trovarsi sullo stesso computer. Il file può essere sul computer dell'ufficio e voi potete lavorare ovunque: con qualsiasi browser e su qualsiasi dispositivo.
Cosa ti servirà
Un account Query Streams
Il piano gratuito è sufficiente per questa guida. Registrati su my.querystreams.com.
The Agent on a computer that can open the file
Un piccolo programma che viene eseguito in background e legge il file quando Google Sheets lo richiede. Il passaggio 2 qui sotto mostra dove trovarlo.
Il tuo file DuckDB
Sapere dove si trova, ad esempio C:\Data\sales.duckdb o \\server\share\sales.duckdb. If it lives in OneDrive, Dropbox or Google Drive, make sure it is synced to the Agent’s computer.
Quale computer riceve l'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. Google Sheets può essere ovunque: funziona nel tuo browser, quindi non viene installato assolutamente nulla nel luogo in cui leggi i dati.
Collegalo in cinque passaggi
-
Crea il tuo account
Vai a my.querystreams.com e iscriviti. Scegli il Gratuito Piano. Si tratta di un piano reale, non di una versione di prova, che include la connessione al file DuckDB e l'esecuzione di query da Fogli Google.
Install the Agent on a computer that can open the file



Accedi, apri Scaricamento, 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.
Perché un piccolo programma invece di un 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.
La pagina di download mostra La tua chiave di accesso. Incollalo nell'Agente quando richiesto e attendi che il badge venga letto Connesso ai flussi di queryQuesta è l'unica operazione che si esegue sull'agente stesso.
Se volete, potete trovare le guide complete: Finestre, Mac, Linux.
-
Puntalo al tuo file DuckDB
Torna al tuo browser, apri Agenti dati (Sotto Dati nel menu in alto). Il tuo agente è elencato lì. Fai clic Aggiungi connettore, scegliere DuckDBe compilare:
- Nome della società
- Un nome che riconoscerai in seguito, come ad esempio "Database delle vendite".
- Percorso file database
- 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.
Cliccare Verifica la connessioneQuando legge Collegato, clicca RisparmiareLa connessione raggiunge il tuo agente in pochi secondi.
Test fallito? 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 sotto.
-
See your data in Query Builder Opzionale
You can look at your DuckDB file before Google Sheets is involved at all. Open Generatore di query in the portal and pick the connection you just made. The Schema 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 Correre and the rows appear under Risultati. 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.
-
Aggiungere Query Streams a Fogli Google
Apri un qualsiasi foglio Google, vai a Estensioni → Componenti aggiuntivi → Ottieni componenti aggiuntivi, cerca Flussi di querye clicca InstallareOppure installalo direttamente da Query Streams sul Google Workspace MarketplaceGoogle ti chiederà di autorizzare l'installazione del componente aggiuntivo; è normale.
Successivamente è presente in ogni Foglio Google che apri: un'icona di Query Streams nel pannello laterale a destra, elencata anche sotto EstensioniNon è necessario effettuare un accesso separato. Il sistema riconosce l'account Google che già utilizzi, quindi l'indirizzo email deve essere lo stesso associato al tuo account Query Streams.
-
Porta il tuo primo tavolo
Fai clic sull'icona Query Streams nel pannello laterale a destra del foglio (oppure trovala sotto Estensioni). Scegliere Streamer di query e seleziona la connessione appena stabilita.
Digita la query che vuoi eseguire. Questa estrae alcune colonne da un ordini tavolo:
Esempio · SQLSELECT order_id, customer_name, order_total FROM main.orders ORDER BY order_total DESC LIMIT 100;
Sotto Scheda di destinazione seleziona la scheda in cui devono finire le righe, quindi fai clic Eseguire la queryLe righe vengono visualizzate in quella scheda in uno o due secondi. Fai clic su "Esegui query" ogni volta che i dati sono cambiati e la scheda si aggiornerà automaticamente.
Non conosci SQL? Build it in Generatore di query 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.
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 \\server\share 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:
| Messaggio | Causa | Aggiustare |
|---|---|---|
| Access denied for the agent’s service account under the path, or accesso negato 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. | Cliccare 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, o 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. |
Questo è tutto. I tuoi dati sono presenti nel foglio di calcolo e rimangono aggiornati con un solo clic. Nulla ha lasciato la tua rete, a parte le righe che hai richiesto.
Buone mosse successive
- Salva la query nel portale, così puoi eseguirlo di nuovo con un solo clic, da Fogli Google o Excel.
- Aggiungi un filtro come ad esempio un intervallo di date, in modo che la stessa query possa rispondere "questo mese" senza modifiche.
- Condividi i risultati con un collega. Loro vedono le righe, non il tuo file e non il tuo percorso file.
Domande che le persone si pongono
Il file DuckDB deve trovarsi sul computer che utilizzo per Fogli Google?
No. Only the Agent has to be able to open your DuckDB file. Google Sheets runs in your browser on any device. Open the add-on with the same Google account and your connections are there.
Il mio file del database viene caricato da qualche parte?
No. The Agent reads the file where it sits and sends only the rows your query asks for. The file stays where it is.
Il file può essere archiviato su OneDrive, Dropbox o Google Drive?
Sì, a patto che sia sincronizzato con il computer su cui è in esecuzione l'Agent, in modo che quest'ultimo lo veda come un normale file locale. Imposta la connessione in modo che punti alla copia sincronizzata.
Il piano gratuito copre davvero tutto questo?
Sì. La versione gratuita è un piano che mantieni, non una prova che scade. Scopri esattamente cosa include su pagina dei prezzi.
Il foglio si aggiorna automaticamente?
Fai clic su "Esegui query" ogni volta che desideri visualizzare le righe più recenti. Per un foglio di calcolo che si aggiorni automaticamente a intervalli regolari senza alcun intervento umano, configura un'automazione nel portale Query Streams (Streams → Automazione). Questa opzione è disponibile in tutti i piani.
Guide correlate
Ogni guida per DuckDB
Non è proprio la tua configurazione?
- Hai una cartella di file Parquet anziché un file di database DuckDB? Parquet Folder li legge tutti come un'unica tabella → Parquet 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?

