保持 Baserow 与你的 SQLite 文件同步, 按计划
只需编写一次 SQL 语句。Query Streams 会按照您设定的计划运行它,从每五分钟一次到每周一次都可以,并将结果行写入您的 Baserow 表。您可以按键匹配行,这样编辑操作就能保留在原位,而查询未覆盖的行则会被删除,或者也可以简单地追加数据。无需 Zapier、脚本或导出功能。首次运行大约需要十五分钟,免费套餐即可满足需求。
你最终会得到什么
Baserow 表用于存储 SQLite 查询返回的行,并按计划更新,更新频率从每五分钟到每周一次,每次更新都会记录更改内容。例如:
SQLite holds your data in a file. Your team works in Baserow. The usual bridge is a Zapier or Make scenario, or a CSV someone uploads that breaks quietly and copies one row at a time. Query Streams Automation does it differently: the Agent that already reads your SQLite file runs your saved SQL on a schedule and writes the whole result into Baserow in one pass, matching rows by a key so the table stays correct rather than growing.
你需要准备什么
通过代理连接的 SQLite
The Agent installed on the computer that holds your SQLite file, or on one that reads it from a network share, with the connection added in Data Agents. Not done yet? 首先连接 SQLite大约需要十分钟。
您的 Baserow 登录信息
输入您的 Baserow 服务器地址(默认为 api.baserow.io)、您的电子邮件地址和密码。Query Streams 会将这些信息加密存储,并在同步运行时自动为您登录。
工作在哪里进行? 在运行代理程序的计算机上,它会按计划运行查询并将结果行写入 Baserow,因此该计算机需要保持开机状态。您可以关闭浏览器。查询流本身不会存储这些结果行。
File on another computer? The Agent does not have to run on the computer that holds your SQLite file: it can read the file from a network share. Reaching a file on a network share, below, shows what that takes.
分六步完成设置
-
保存要保持同步的查询
打开 查询生成器选择您的 SQLite 连接(尚未连接?) 从这里开始),并编写 SELECT 语句,使其返回 Baserow 中所需的确切行和列。以下语句从 Baserow 中提取几列。 客户 桌子:
示例 · SQLSELECT customer_id, name, city FROM customers ORDER BY name LIMIT 100;
运行它,然后 节省 给它起一个容易识别的名字,例如“Baserow 的订单”。在 SELECT 语句中保留一个每行都唯一的列,如下所示。 customer_id这就是完全同步功能用于就地更新行的关键所在。稍后编辑并重新保存查询,自动化程序会在下次运行时获取到这些更改。
-
打开自动化并选择 Baserow
在门户中,打开 自动化 (顶部菜单) 流 → 定时 → 自动化)并点击 新自动化巫师有五个简单的步骤。 步骤 1 点击 Baserow 卡片。
看到的是“开始之前”吗? 只有当代理在线并建立连接且至少存在一个已保存的查询时,该向导才会打开。页面会列出缺少哪一项,并提供指向该查询的链接。
-
连接基准行
在 步骤 2 填写 服务器 URL (留空表示使用 Baserow 云),您的 电子邮件 和 密码然后点击 测试连接输入您的 Baserow 服务器地址(默认为 api.baserow.io)、您的电子邮件地址和密码。Query Streams 会将这些信息加密存储,并在同步运行时自动为您登录。
-
选择行的落点。
在 步骤 3 选择 数据库然后是 桌子 数据行应该会同步到该表。如果您想要一个空表,请先在 Baserow 中创建该表。如果表中已有数据行,预览会显示这些数据行,并说明每种同步模式会对其执行哪些操作。每个表只能执行一个自动化操作。
-
选择查询语句,并决定如何显示数据行。
在 步骤 4 打开 保存的查询 列出并选择步骤 1 中的查询。查询流会运行一次该查询以读取列,并告诉您返回的行数,以及两个选项:
追加 · 快速附加
每次运行都会将查询结果添加到表的底部。不会更新或删除任何数据,因此它是快速收集日志、事件和历史记录的理想选择。无需键列。未更改的行不会再次添加;值发生更改的行会作为新行添加到下方,而原行则保留。
完全同步 · 镜像完全同步
行通过以下方式匹配: 钥匙 例如订单 ID 这样的列。新行会被添加,已更改的行会就地更新,查询不再返回的行会被删除,包括用户手动输入的行,因此手动输入的行会保存在另一个表中。这种方式适用于库存、销售管道、主数据和仪表盘。
完全同步是按列设置的,这使得它在共享表中非常有用:
- 钥匙
- 例如,标识行的列。 订单ID它在查询结果中必须是唯一的;查询流会自动检查这一点并拒绝重复项。
- 同步
- 每次运行都会覆盖 SQLite 中的数据。如果有人编辑了 Baserow 中的同步列,下次运行会恢复源值。
- 保存
- 该数据行在首次到达时写入,之后不再进行比较,因此 SQLite 中对其进行的更改不会触发更新。对于团队手动输入的备注、所有者和后续日期,请使用根本不在查询中的列:仅存在于 Baserow 中的列永远不会被同步操作修改。
哪个更快? 追加写入操作不会先读取表。完全同步操作会读取表,比较每一行,然后只写入差异部分,因此耗时更长,但表始终与查询结果匹配。您可以稍后从自动化流程的编辑面板中切换操作。
要查看您信任的表格,请点击 将所有列设置为同步然后点击钥匙图标 customer_id 使其成为 钥匙查询流会扫描整个结果以确认键的唯一性,如果不是,则会发出警告。您可以将团队的备注保存在与查询无关的列中;这些列不会被修改。要查看只会不断增长的日志,请点击此处。 将所有列设置为保留 而是跳过密钥。点击 继续.
-
设置日程,命名,创建它
在 步骤 5 选择 按计划运行 并选择 频率:
频率 跑 每5分钟 每 5 分钟一次,最快允许时间 每15分钟 每隔15分钟 每隔30分钟 每隔30分钟 每小时 每小时整点 每天上午9点 每天上午 9:00,默认 每天早上6点 每天早上6点 工作日上午9点 周一至周五上午 9:00 每周一(上午 9 点) 每周一上午9:00 自定义日程 您自己的分钟、小时、星期几或月份几日。 时代如是 时区 你选择,它最初是你浏览器的默认设置。你也可以选择 仅限手动 并按 运行 您可以随时设置计划任务;稍后可以从自动化流程的“编辑”面板添加计划任务。计划任务会在代理程序上运行,因此即使浏览器关闭,任务也会继续运行。如果运行代理程序的计算机在任务到期时处于关机状态,则会在代理程序重新启动后不久执行一次错过的运行。
给它一个 集成名称例如“每日发往Baserow的订单”,请检查 准备创建 摘要和点击 创建自动化返回“自动化”页面,按 运行 现在就执行第一次同步,无需等待预定计划。打开 Baserow:行就在那里,位于列标题下方。
就是这样。 从现在开始,该表将自动保持最新状态。除了查询返回的行之外,没有任何数据会离开您的网络,而且任何人都无需记住运行任何操作。
你之后看到的
这 自动化页面 列出所有自动化流程及其状态、源、目标、键、计划、上次同步时间和行数。打开一个查看详情。 执行 标签页:记录每次运行及其触发条件(手动或计划)、持续时间以及创建、更新、删除和未更改的行数。 表现 该标签页显示 7 至 90 天内处理的数据和成功率。
它会在停止时通知你。
每个组织都有 同步问题 从第一天起就设置了警报规则:同步失败时发送应用内通知和电子邮件,同步恢复后再发送一封邮件。每次事件只发送一条消息,不会每次重试都发送一条消息。您可以关闭此功能或在“流”→“警报和报告”中更改渠道。
它会在应该暂停的时候暂停。
如果 Baserow 停止接受连接,或者数据连接器被删除,自动化流程将暂停并显示原因。重新连接或选择新的数据源,然后点击“恢复”。其他错误会继续执行计划,并在行中显示。
关键列缺失
如果有人重命名或删除 Baserow 中的关键列,则完全同步会在写入任何内容之前停止并显示相关信息。 修复选项请将列恢复到原来的名称,然后再次运行。同步操作不会删除其他列。
这些计划允许什么?
所有套餐(包括免费套餐)都包含自动化功能,且创建的自动化数量没有限制。每个套餐的限制在于每次查询运行返回的行数:
| 计划 | 每次运行的行数 |
|---|---|
| 免费 | 125 |
| 个人核心 | 500 |
| 个人加强版 | 1,000 |
| 核心业务 | 2,500 |
| 商务+ | 5,000 |
| 商业最大 | 10,000 |
| 企业核心 | 25,000 |
| 企业增强版 | 100,000 |
| 企业版 Max | 250,000 |
如果查询返回的结果较多,则运行会继续进行而不是提前终止,自动化流程会告知您哪个计划更合适,或者建议添加筛选条件,例如日期范围。每次成功运行都会占用您的数据域配额,该配额与您的 Excel 和 Sheets 查询使用的配额相同。 请查看定价页面 津贴。
下一步行动不错。
- 添加筛选器 查询条件可以是最近 90 天的数据,这样表的大小和速度就能保持稳定,并且符合你的计划的行数限制。
- 将手写笔记单独列保存。位于查询之外,因此它们在每次同步中都能保留下来。
- 将自动化流程分组 在编辑面板中添加几个元素后,自动化页面会按组进行筛选。
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? 离开 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?
Every run reaches the file the same way the connection test does. If runs start failing after something changed on the file server, a new password for example, open the connector in 数据代理 并点击 测试连接. The test result, and the line under the file path, name the problem:
| 留言 | 原因 | 使固定 |
|---|---|---|
| SQLite database file not found: followed by a \\server\share path you know is right | No login is stored, so the Agent tried the share as its own account and could not see the file: the share turned that account away, or the server did not answer. In the first case the line under the path says Access denied for the agent’s service account. | 点击 Service identity under the path and store a login that can read the share. If the line under the path does not say access denied, check that the Agent’s computer can open the share at all. |
| Share \\server: access denied — add credentials for this server | A login is stored, but that account has no permission on the share, or another sign-in to the same server is in the way; the message before this line says which. | Ask whoever runs the server to give that account read access, or store an account that has it. For a sign-in in the way, see the two rows on one login per server below. |
| Share \\server: the credentials were refused — check the username and password | The server turned the stored login down: a typo, the wrong domain, or a password changed since it was saved, which also stops runs that used to work. | Click the chip under the path and type the password again; for an account made on the server itself, leave Domain blank. After a refused login the Agent waits a minute before it tries that same one again, so the account is not locked out; saving a corrected password tries straight away. |
| Share \\server: server unreachable from the agent machine | The Agent’s computer got no answer from the server: a wrong server name, the server is off, or a firewall blocks file sharing. | On the Agent’s computer, open the same \\server\share path in File Explorer. If that fails too, it is a network problem for whoever runs the network. |
| Another connector on this agent already signs in to \\server as … | Windows lets one computer sign in to a server as one account at a time, and another connector on this Agent uses a different login for that server. | Store the same login the other connector uses, or change it on every connector that reads that server. |
| Windows already holds a sign-in to \\server for … | Something on the Agent’s computer other than the Agent is already signed in to that server as a different account, and the Agent never closes a sign-in it did not make. | Do what the rest of the message says: use that same account on this connector, or close the other sign-in on the Agent’s computer. If it says the share is already readable through that sign-in, choose Use service identity in the login box instead. |
| This agent build cannot sign in to \\server with stored credentials. | The Agent is an older version that cannot use stored logins. | Update the Agent, then test again. |
| \\server\share is not mounted on this Linux agent (或) macOS agent) | The Agent runs on Linux or a Mac and the share has not been mounted on its computer yet; logins stored in the Portal are not used there. | Mount it with the command the message gives you, then test again. Step by step: 在 Linux 系统上 · on a Mac. |
| … is a WAL-mode SQLite database | The database uses SQLite’s WAL mode, which cannot work over a network share, and Read-Only (Immutable) is unticked on the connector. | Tick Read-Only (Immutable) on the connector and test again. |
人们提出的问题
同步操作会覆盖我的团队在 Baserow 中添加的笔记吗?
如果备注位于单独的列中,则不会出现这种情况。仅存在于 Baserow 中而不存在于您的查询中的列永远不会被修改,因此请在已同步的列旁边添加“备注”或“所有者”列,并在其中输入内容。标记的列 同步 每次运行时都会恢复为 SQLite 值; 保存 当数据行首次到达时,列会被填充,之后不再进行比较。
我的 SQLite 数据会被 Query Streams 存储吗?
不。代理程序会在您这边运行查询,并通过加密链接将数据行直接发送到 Baserow。查询流保存的是配置、计划和每次运行的行数,而不是数据行本身。
我的电脑需要一直开着吗?
运行代理程序的计算机负责执行查询并将数据写入 Baserow。您自己的笔记本电脑和浏览器可以关闭。如果在查询到期时计算机处于关机状态,则错过的查询会在代理程序重新启动后不久执行一次。
我可以稍后修改查询吗?
是的。在查询构建器中编辑并保存,下次运行时会自动使用新版本。如果添加或删除列,请打开自动化的编辑面板进行映射。
两个自动化脚本可以写入同一张表吗?
不,每个表只能有一个自动化脚本。第二个自动化脚本可以指向不同的表,或者扩展第一个脚本背后的查询范围。
免费套餐真的包含这些吗?
是的。“免费”套餐是永久有效的,不是会过期的试用版。每个套餐都包含自动化功能;不同套餐的区别在于每次查询可以返回的行数。请查看“免费”套餐的具体内容。 定价页面.
相关指南
每份指南 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?

