JLC*_*Dev 2 node.js google-bigquery
我找到了很多node.js查询和插入数据到 BigQuery的例子,但没有找到任何关于如何删除和更新数据库行的例子或 API 描述。我知道限制(自上次更改后 30 分钟等)。
我发现的唯一提示是从 vscode
bigQuery.dataset(dataset).table(table).deleteFromBigQuery('noIdea')
Run Code Online (Sandbox Code Playgroud)
但即使是 vscode 也不能给我一个关于更新的提示。
你知道这方面的任何nodejs文件吗?
我一直在寻找googleapis和 DMLs google Manual 的查询示例的一些资源
Ell*_*ard 11
async function runDeleteQuery(projectId) {
// Imports the Google Cloud client library
const BigQuery = require('@google-cloud/bigquery');
/**
* TODO(developer): Uncomment the following line before running the sample.
*/
// const projectId = "your-project-id";
// Modify this query however you need
const sqlQuery = "DELETE FROM dataset.table WHERE condition;";
// Creates a client
const bigquery = new BigQuery({projectId});
// Query options list: https://cloud.google.com/bigquery/docs/reference/v2/jobs/query
const options = {
query: sqlQuery,
timeoutMs: 100000, // Time out after 100 seconds.
useLegacySql: false, // Use standard SQL syntax for queries.
};
// Runs the query
await bigquery.query(options);
}
Run Code Online (Sandbox Code Playgroud)
另请参阅DELETE 语句文档。
| 归档时间: |
|
| 查看次数: |
3148 次 |
| 最近记录: |