我正在尝试使用 Node js 在 google bigquaey 中插入、删除、搜索和更新。我已经跟进了google中的所有文档。但没有提到如何连接 - 所以我创建了这个,--
如何将 GCP BigQuery 与 NodeJS 连接。我刚来这地方。任何帮助都会起作用。
我写的代码 -
const {BigQuery} = require('@google-cloud/bigquery');
const mainFunction = () => {
insertIntoBigQuery("John", "john@gmail.com", "+1-23232344231");
}
async function insertIntoBigQuery(name, email, phone) {
// const insertIntoBigQuery = async(name, email, phone) => {
const bigqueryClient = new BigQuery();
// The SQL query to run
const sqlQuery = "INSERT INTO `p4tyu78.Backend_testing.Test1` VALUES ("+name+ "," +email+","+ phone+")";
const options = {
query: sqlQuery,
// Location must match that of …Run Code Online (Sandbox Code Playgroud) node.js google-bigquery google-api-nodejs-client google-cloud-platform