查看类别

如何将 SQLite 连接到 Google Sheets – 实时传输轻量级数据库数据

连接 · SQLite 到 Google Sheets

从某个来源获取数据 SQLite 文件插入 谷歌工作表

在 Google 表格中打开您的 SQLite 数据库,并随时刷新。无需上传 CSV 文件,无需使用 Apps Script,也无需复制粘贴。首次操作大约需要十分钟,免费套餐即可满足所有需求。

大约10分钟 无需编程 文件位置不变 任何浏览器,任何设备
遇到任何问题?尽管问我们。 打开 支持 请在“查询流”(右上角菜单 → 支持)中给我们发送消息。我们会安排专人阅读您的消息,“我不知道这个屏幕需要什么”就是一个很好的问题。

你最终会得到什么

SQLite 标志一个 Google 表格,实时显示针对 SQLite 文件执行 SQL 查询的结果,并带有一个按钮,可在数据更改时自动更新最新行。例如:

SQLite 数据库是单个文件,通常以 .sqlite 结尾。 .db, .sqlite, .sqlite3Google Sheets 根本无法打开这些文件,通常的解决方法是导出 CSV 文件,然后在每次数据更改时重新上传。Query Streams 则无需如此:一个小型辅助程序会读取文件所在的位置,然后 Google Sheets 插件会向其请求所需的行。这两个程序无需位于同一台计算机上。文件可以位于办公室电脑上,而您可以随时随地使用任何设备上的任何浏览器访问该文件。

文件存放位置办公室电脑、服务器或家里的电脑您的 SQLite 文件sales.db · 保留在此处查询流代理where it can open the file查询流加密链接通过互联网 · 仅显示结果无论你身在何处任何浏览器:笔记本电脑、平板电脑、手机、Chromebook谷歌工作表一行行数据以表格形式呈现
The Agent runs where it can open the file. Your sheet lives in Google’s cloud. Open it anywhere and the rows come to you.

你需要准备什么

查询流帐户

免费版足以满足本指南的需求。请注册: my.querystreams.com.

The Agent on a computer that can open the file

这是一个在后台运行的小程序,当 Google Sheets 发出请求时,它会读取该文件。下面的步骤 2 展示了如何获取该程序。

您的 SQLite 文件

例如,要知道它在哪里。 C:\Data\sales.db 或 \\server\share\sales.db. If it lives in OneDrive, Dropbox or Google Drive, make sure it is synced to the Agent’s computer.

哪个计算机获得代理? 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 可以放在任何地方它在浏览器中运行,因此在您读取数据时不会安装任何东西。

分五步连接

  1. 创建您的帐户

    前往 my.querystreams.com 并注册。选择 免费 计划。这是一个正式的计划,不是试用版,它涵盖了连接 SQLite 文件和从 Google Sheets 运行查询的内容。

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

    登录,打开 下载, 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.

    为什么使用小型程序而不是驱动程序? 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.

    下载页面显示 您的访问密钥当代理提示时,将其粘贴到代理中,然后等待徽章读取。 已连接到查询流这是你在代理程序本身上唯一需要做的事情。

    完整攻略(如果您需要): Windows, 苹果, Linux.

  3. 将其指向您的 SQLite 文件

    返回浏览器,打开 数据代理 (在下面 数据 (在顶部菜单中)。您的经纪人信息就在那里。点击 添加连接器, 选择 SQLite并填写:

    连接名称
    任何你以后会记住的名称,例如销售数据库。
    数据库文件路径
    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.

    点击 测试连接当它读到 已连接, 点击 节省连接会在几秒钟内到达您的代理。

    测试失败? 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 以下。

  4. See your data in Query Builder 选修的

    You can look at your SQLite file before Google Sheets is involved at all. Open 查询生成器 in the portal and pick the connection you just made. The 模式 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 运行 and the rows appear under 成果. 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.

  5. 将查询流添加到 Google 表格

    打开任意一个 Google 表格,然后转到 扩展程序 → 附加组件 → 获取附加组件搜索 查询流然后点击 安装或者直接从这里安装 Google Workspace Marketplace 上的查询流谷歌会要求你允许安装该插件;这是正常现象。

    之后,您打开的每个 Google 表格中都会出现“查询流”图标,位于右侧边栏,也列在“查询流”下方。 扩展无需单独登录。它会识别您已在使用的 Google 帐户,因此该电子邮件地址必须与您的 Query Streams 帐户所用的电子邮件地址一致。

  6. 把你的第一张桌子拉过来

    单击工作表右侧侧面板中的“查询流”图标(或在下方找到它)。 扩展)。 选择 查询流 选择你刚刚建立的连接。

    输入要运行的查询语句。以下查询语句会从数据库中提取几列数据。 客户 桌子:

    示例 · SQL
    SELECT customer_id, name, city FROM customers ORDER BY name LIMIT 100;

    在下面 目的地表 选择行应该落入的选项卡,然后单击 运行查询数据行会在一两秒内显示在该标签页中。如果数据发生更改,请随时再次单击“运行查询”,标签页将自动更新。

    不懂SQL? Build it in 查询生成器 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.

Windows

Type the network path, like \\服务器\共享\文件夹, 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 或 /媒体, because the Agent’s service cannot see /home 或 /run/user. In the connector, keep the \\server\share 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

苹果

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 \\server\share 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.

SQLite file on a share? 离开 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 \\server\share 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:

留言原因使固定
Access denied for the agent’s service account under the path, or 拒绝访问 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.点击 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,或 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.

就是这样。 您的数据已保存在表格中,只需单击一下即可保持最新状态。除了您请求的行之外,没有任何数据会离开您的网络。

下一步行动不错。

  • 保存查询 在门户网站中,您可以一键再次运行它,也可以从 Google Sheets 或 Excel 中运行。
  • 添加筛选器 例如日期范围,这样同一个查询就可以回答“本月”而无需编辑。
  • 分享结果 与同事一起操作。他们看到的是行,而不是你的文件和文件路径。

人们提出的问题

你的 SQLite 文件必须放在我运行 Sheets 的电脑上吗?

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.

我的数据库文件会被上传到哪里吗?

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

文件可以存储在 OneDrive、Dropbox 或 Google Drive 中吗?

是的,只要它与运行代理的计算机同步,代理就能将其视为普通的本地文件。将连接指向同步的副本即可。

免费套餐真的包含这些吗?

是的。“免费”是一个永久有效的方案,而不是会过期的试用期。请查看具体包含内容。 定价页面.

表格会自动刷新吗?

如需获取最新行,请再次单击“运行查询”。要设置工作表自动刷新(无需用户手动操作),请在“查询流”门户(“流”→“自动化”)中设置自动化。此功能在所有套餐中均有提供。

还是不行? 打开 支持 请在“查询流”中告诉我们您当前处于第几步以及您看到的内容。我们会帮您连接。
查询流也将相同的数据连接到在 ExcelClaude、Cursor 和 ChatGPTREST API以及更多

每份指南 SQLite

这不是你想要的配置?

  • 你的 SQLite 文件不是单个文件而是多个文件?SQLite Folder 会将同名表合并成一个表,并用文件来源标记每一行数据 → 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?
更新 10 月 17, 2026

Powered by BetterDocs