@malloydata/db-bigquery 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bigquery.spec.js
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* This program is free software; you can redistribute it and/or
|
|
6
|
+
* modify it under the terms of the GNU General Public License
|
|
7
|
+
* version 2 as published by the Free Software Foundation.
|
|
8
|
+
*
|
|
9
|
+
* This program is distributed in the hope that it will be useful,
|
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
* GNU General Public License for more details.
|
|
13
|
+
*/
|
|
2
14
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
15
|
if (k2 === undefined) k2 = k;
|
|
4
16
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { RowMetadata } from "@google-cloud/bigquery";
|
|
2
2
|
import bigquery from "@google-cloud/bigquery/build/src/types";
|
|
3
3
|
import { ResourceStream } from "@google-cloud/paginator";
|
|
4
|
-
import { QueryData, StructDef, MalloyQueryData, FieldTypeDef, SQLBlock, Connection, QueryDataRow } from "@malloydata/malloy";
|
|
5
|
-
import { PooledConnection } from "@malloydata/malloy";
|
|
6
|
-
import { FetchSchemaAndRunSimultaneously, FetchSchemaAndRunStreamSimultaneously, PersistSQLResults, StreamingConnection } from "@malloydata/malloy/src/runtime_types";
|
|
4
|
+
import { FetchSchemaAndRunSimultaneously, FetchSchemaAndRunStreamSimultaneously, PersistSQLResults, PooledConnection, QueryData, StructDef, StreamingConnection, MalloyQueryData, FieldTypeDef, SQLBlock, Connection, QueryDataRow } from "@malloydata/malloy";
|
|
7
5
|
export interface BigQueryManagerOptions {
|
|
8
6
|
credentials?: {
|
|
9
7
|
clientId: string;
|
|
@@ -41,7 +41,6 @@ const bigquery_1 = require("@google-cloud/bigquery");
|
|
|
41
41
|
const googleCommon = __importStar(require("@google-cloud/common"));
|
|
42
42
|
const gaxios_1 = require("gaxios");
|
|
43
43
|
const malloy_1 = require("@malloydata/malloy");
|
|
44
|
-
const malloy_2 = require("@malloydata/malloy");
|
|
45
44
|
// BigQuery SDK apparently throws various authentication errors from Gaxios (https://github.com/googleapis/gaxios) and from
|
|
46
45
|
// @google-cloud/common (https://www.npmjs.com/package/@google-cloud/common)
|
|
47
46
|
// catching and rewriting here a single kind of authentication error we can consistently catch further up the stack
|
|
@@ -211,7 +210,7 @@ class BigQueryConnection {
|
|
|
211
210
|
}
|
|
212
211
|
async getTableFieldSchema(tableURL) {
|
|
213
212
|
var _a, _b;
|
|
214
|
-
const { tablePath: tableName } = (0,
|
|
213
|
+
const { tablePath: tableName } = (0, malloy_1.parseTableURI)(tableURL);
|
|
215
214
|
const segments = tableName.split(".");
|
|
216
215
|
// paths can have two or three segments
|
|
217
216
|
// if there are only two segments, assume the dataset is "local" to the current billing project
|
|
@@ -388,7 +387,7 @@ class BigQueryConnection {
|
|
|
388
387
|
}
|
|
389
388
|
}
|
|
390
389
|
tableURLtoTablePath(tableURL) {
|
|
391
|
-
const { tablePath } = (0,
|
|
390
|
+
const { tablePath } = (0, malloy_1.parseTableURI)(tableURL);
|
|
392
391
|
if (tablePath.split(".").length === 2) {
|
|
393
392
|
return `${this.defaultProject}.${tablePath}`;
|
|
394
393
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/db-bigquery",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"license": "GPL-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"homepage": "https://github.com/looker-open-source/malloy#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/looker-open-source/malloy"
|
|
11
|
+
},
|
|
7
12
|
"scripts": {
|
|
8
13
|
"lint": "eslint '**/*.ts{,x}'",
|
|
9
14
|
"lint-fix": "eslint '**/*.ts{,x}' --fix",
|
|
@@ -14,7 +19,7 @@
|
|
|
14
19
|
"dependencies": {
|
|
15
20
|
"@google-cloud/bigquery": "^5.5.0",
|
|
16
21
|
"@google-cloud/common": "^3.6.0",
|
|
17
|
-
"@malloydata/malloy": "
|
|
22
|
+
"@malloydata/malloy": "0.0.3",
|
|
18
23
|
"gaxios": "^4.2.0"
|
|
19
24
|
}
|
|
20
25
|
}
|