使用 node.js 在 Google 电子表格数据更改时自动更新 MSSQL table

Using node.js to automatically update MSSQL table on Google Spreadsheet data change

请问有没有什么方法可以使用node.js或javascript自动检测google电子表格数据变化并更新MSSQL数据库中的变化table?

我看过几篇文章,但都需要使用第三方应用程序。

如有任何帮助,我们将不胜感激。谢谢!

您可以使用 NodeJS 中的 Watch 方法订阅对文件的更改。

  const res = await drive.files.watch({
    acknowledgeAbuse: false,
    fileId: 'id-value',
    supportsAllDrives: false,   
    requestBody: {
     "address": "my_address",
     "expiration": "my_expiration",
     "id": "my_id",
     "kind": "my_kind",
     "params": {},
     "payload": false,
     "resourceId": "my_resourceId",
     "resourceUri": "my_resourceUri",
     "token": "my_token",
     "type": "my_type"
     }
    },
  });
  console.log(res.data);

您可以从 https://googleapis.dev/nodejs/googleapis/latest/drive/classes/Resource$Files-1.html#watch

上的 Node JS 文档中查看如何实现该服务