@malloydata/db-bigquery 0.0.165-dev240813195925 → 0.0.165-dev240813215510
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.
|
@@ -1,7 +1,8 @@
|
|
|
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 { Connection, ConnectionConfig, FetchSchemaOptions, MalloyQueryData, PersistSQLResults,
|
|
4
|
+
import { Connection, ConnectionConfig, FetchSchemaOptions, MalloyQueryData, PersistSQLResults, QueryData, QueryDataRow, QueryOptionsReader, QueryRunStats, RunSQLOptions, SQLBlock, StreamingConnection, StructDef } from '@malloydata/malloy';
|
|
5
|
+
import { BaseConnection } from '@malloydata/malloy/connection';
|
|
5
6
|
export interface BigQueryManagerOptions {
|
|
6
7
|
credentials?: {
|
|
7
8
|
clientId: string;
|
|
@@ -45,7 +46,7 @@ interface SchemaInfo {
|
|
|
45
46
|
export declare class BigQueryAuthenticationError extends Error {
|
|
46
47
|
constructor(message: string);
|
|
47
48
|
}
|
|
48
|
-
export declare class BigQueryConnection implements Connection, PersistSQLResults, StreamingConnection {
|
|
49
|
+
export declare class BigQueryConnection extends BaseConnection implements Connection, PersistSQLResults, StreamingConnection {
|
|
49
50
|
readonly name: string;
|
|
50
51
|
private readonly dialect;
|
|
51
52
|
static DEFAULT_QUERY_OPTIONS: RunSQLOptions;
|
|
@@ -62,7 +63,6 @@ export declare class BigQueryConnection implements Connection, PersistSQLResults
|
|
|
62
63
|
constructor(name: string, queryOptions?: QueryOptionsReader, config?: BigQueryConnectionConfiguration);
|
|
63
64
|
get dialectName(): string;
|
|
64
65
|
private readQueryOptions;
|
|
65
|
-
isPool(): this is PooledConnection;
|
|
66
66
|
canPersist(): this is PersistSQLResults;
|
|
67
67
|
canStream(): this is StreamingConnection;
|
|
68
68
|
get supportsNesting(): boolean;
|
|
@@ -51,6 +51,7 @@ const bigquery_1 = require("@google-cloud/bigquery");
|
|
|
51
51
|
const googleCommon = __importStar(require("@google-cloud/common"));
|
|
52
52
|
const gaxios_1 = require("gaxios");
|
|
53
53
|
const malloy_1 = require("@malloydata/malloy");
|
|
54
|
+
const connection_1 = require("@malloydata/malloy/connection");
|
|
54
55
|
// BigQuery SDK apparently throws various authentication errors from Gaxios (https://github.com/googleapis/gaxios) and from
|
|
55
56
|
// @google-cloud/common (https://www.npmjs.com/package/@google-cloud/common)
|
|
56
57
|
// catching and rewriting here a single kind of authentication error we can consistently catch further up the stack
|
|
@@ -87,8 +88,9 @@ const MAXIMUM_BYTES_BILLED = String(25 * 1024 * 1024 * 1024);
|
|
|
87
88
|
*/
|
|
88
89
|
const TIMEOUT_MS = 1000 * 60 * 10;
|
|
89
90
|
// manage access to BQ, control costs, enforce global data/API limits
|
|
90
|
-
class BigQueryConnection {
|
|
91
|
+
class BigQueryConnection extends connection_1.BaseConnection {
|
|
91
92
|
constructor(arg, queryOptions, config = {}) {
|
|
93
|
+
super();
|
|
92
94
|
this.dialect = new malloy_1.StandardSQLDialect();
|
|
93
95
|
this.temporaryTables = new Map();
|
|
94
96
|
this.schemaCache = new Map();
|
|
@@ -138,9 +140,6 @@ class BigQueryConnection {
|
|
|
138
140
|
return options;
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
|
-
isPool() {
|
|
142
|
-
return false;
|
|
143
|
-
}
|
|
144
143
|
canPersist() {
|
|
145
144
|
return true;
|
|
146
145
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/db-bigquery",
|
|
3
|
-
"version": "0.0.165-
|
|
3
|
+
"version": "0.0.165-dev240813215510",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@google-cloud/bigquery": "^7.3.0",
|
|
26
26
|
"@google-cloud/common": "^5.0.1",
|
|
27
27
|
"@google-cloud/paginator": "^5.0.0",
|
|
28
|
-
"@malloydata/malloy": "^0.0.165-
|
|
28
|
+
"@malloydata/malloy": "^0.0.165-dev240813215510",
|
|
29
29
|
"gaxios": "^4.2.0"
|
|
30
30
|
}
|
|
31
31
|
}
|