@8ms/helpers 2.0.40 → 2.0.41
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/.yarn/install-state.gz
CHANGED
|
Binary file
|
|
@@ -11,7 +11,7 @@ type Datasets = {
|
|
|
11
11
|
location: string;
|
|
12
12
|
projectId: string;
|
|
13
13
|
};
|
|
14
|
-
type
|
|
14
|
+
type Table = {
|
|
15
15
|
id: string;
|
|
16
16
|
};
|
|
17
17
|
export declare class GoogleBigQueryNamespace extends BaseNamespace {
|
|
@@ -44,10 +44,7 @@ export declare class GoogleBigQueryNamespace extends BaseNamespace {
|
|
|
44
44
|
* Check to see whether a given BigQuery table exists.
|
|
45
45
|
* https://cloud.google.com/bigquery/docs/samples/bigquery-table-exists
|
|
46
46
|
*/
|
|
47
|
-
tableExists: (datasetId: string, tableId: string) => Promise<
|
|
48
|
-
|
|
49
|
-
* Retrieve all the Tables from a given Project/Dataset.
|
|
50
|
-
*/
|
|
51
|
-
getTable: (datasetId: string) => Promise<Tables[]>;
|
|
47
|
+
tableExists: (datasetId: string, tableId: string) => Promise<boolean>;
|
|
48
|
+
getTables: (datasetId: string) => Promise<Table[]>;
|
|
52
49
|
}
|
|
53
50
|
export {};
|
|
@@ -129,22 +129,17 @@ class GoogleBigQueryNamespace extends _class_1.BaseNamespace {
|
|
|
129
129
|
*/
|
|
130
130
|
this.tableExists = async (datasetId, tableId) => {
|
|
131
131
|
await this.ensureInit();
|
|
132
|
-
let response;
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
catch (exception) {
|
|
140
|
-
response = false;
|
|
132
|
+
let response = false;
|
|
133
|
+
const tables = await this.getTables(datasetId);
|
|
134
|
+
for (let i = 0; i < tables.length; i++) {
|
|
135
|
+
if (tables[i].id === tableId) {
|
|
136
|
+
response = true;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
141
139
|
}
|
|
142
140
|
return response;
|
|
143
141
|
};
|
|
144
|
-
|
|
145
|
-
* Retrieve all the Tables from a given Project/Dataset.
|
|
146
|
-
*/
|
|
147
|
-
this.getTable = async (datasetId) => {
|
|
142
|
+
this.getTables = async (datasetId) => {
|
|
148
143
|
await this.ensureInit();
|
|
149
144
|
let response = [];
|
|
150
145
|
const tables = await this.client.dataset(datasetId)
|
package/package.json
CHANGED
package/webWorker/index.d.ts
CHANGED
package/webWorker/index.js
CHANGED