Skip to content

Commit cec7bcf

Browse files
InitSettings
1 parent c5d3083 commit cec7bcf

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

packages/server/destinations/gcp/src/bigquery/push.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ import { isObject, isArray } from '@walkeros/core';
44

55
export const push: PushFn = async function (
66
event,
7-
{ config, mapping: _mapping, data, collector, env },
7+
{ config, mapping: _mapping, data },
88
) {
99
const { client, datasetId, tableId } = config.settings!;
1010

11+
if (!client || !datasetId || !tableId) {
12+
throw new Error(
13+
'Missing required BigQuery configuration. Ensure init() was called successfully.',
14+
);
15+
}
16+
1117
let row: WalkerOS.AnyObject | undefined;
1218

1319
if (isObject(data)) {

packages/server/destinations/gcp/src/bigquery/types/index.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ export interface Settings {
1414
bigquery?: BigQueryOptions;
1515
}
1616

17-
export type InitSettings = Partial<Settings>;
17+
export interface InitSettings {
18+
projectId: string;
19+
client?: BigQuery;
20+
datasetId?: string;
21+
tableId?: string;
22+
location?: string;
23+
bigquery?: BigQueryOptions;
24+
}
1825

1926
export interface Mapping {}
2027

0 commit comments

Comments
 (0)