/** * Google BigQuery Node - Version 2.1 * Consume Google BigQuery API */ export interface GoogleBigQueryV21Params { authentication?: 'oAuth2' | 'serviceAccount'; resource?: unknown; /** * Operation * @displayOptions.show { resource: ["database"] } * @default executeQuery */ operation?: 'executeQuery' | 'insert'; /** * Projects to which you have been granted any project role * @displayOptions.show { resource: ["database"], operation: ["executeQuery", "insert"] } * @default {"mode":"list","value":""} */ projectId?: { __rl: true; mode: 'list' | 'url' | 'id'; value: string; cachedResultName?: string }; /** * Dataset * @displayOptions.show { resource: ["database"], operation: ["insert"] } * @default {"mode":"list","value":""} */ datasetId?: { __rl: true; mode: 'list' | 'id'; value: string; cachedResultName?: string }; /** * Table * @displayOptions.show { resource: ["database"], operation: ["insert"] } * @default {"mode":"list","value":""} */ tableId?: { __rl: true; mode: 'list' | 'id'; value: string; cachedResultName?: string }; /** * SQL query to execute, you can find more information <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax" target="_blank">here</a>. Standard SQL syntax used by default, but you can also use Legacy SQL syntax by using optinon 'Use Legacy SQL'. * @displayOptions.show { resource: ["database"], operation: ["executeQuery"], /options.useLegacySql: [true] } * @displayOptions.hide { /options.useLegacySql: [true] } */ sqlQuery?: string; /** * Options * @displayOptions.show { resource: ["database"], operation: ["executeQuery", "insert"] } * @default {} */ options?: { /** If not set, all table names in the query string must be qualified in the format 'datasetId.tableId'. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>. */ defaultDataset?: string | Expression; /** Whether set to true BigQuery doesn't run the job. Instead, if the query is valid, BigQuery returns statistics about the job such as how many bytes would be processed. If the query is invalid, an error returns. * @default false */ dryRun?: boolean | Expression; /** Whether to include the schema in the output. If set to true, the output will contain key '_schema' with the schema of the table. * @displayOptions.hide { rawOutput: [true] } * @default false */ includeSchema?: boolean | Expression; /** Location or the region where data would be stored and processed. Pricing for storage and analysis is also defined by location of data and reservations, more information <a href="https://cloud.google.com/bigquery/docs/locations" target="_blank">here</a>. */ location?: string | Expression | PlaceholderValue; /** Limits the bytes billed for this query. Queries with bytes billed above this limit will fail (without incurring a charge). String in <a href="https://developers.google.com/discovery/v1/type-format?utm_source=cloud.google.com&utm_medium=referral" target="_blank">Int64Value</a> format */ maximumBytesBilled?: string | Expression | PlaceholderValue; /** Maximum number of results to return per page of results. This is particularly useful when dealing with large datasets. It will not affect the total number of results returned, e.g. rows in a table. You can use LIMIT in your SQL query to limit the number of rows returned. * @default 1000 */ maxResults?: number | Expression; /** Specifies the maximum amount of time, in milliseconds, that the client is willing to wait for the query to complete. Be aware that the call is not guaranteed to wait for the specified timeout; it typically returns after around 200 seconds (200,000 milliseconds), even if the query is not complete. * @hint How long to wait for the query to complete, in milliseconds * @default 10000 */ timeoutMs?: number | Expression; /** Raw Output * @displayOptions.hide { dryRun: [true] } * @default false */ rawOutput?: boolean | Expression; /** Whether to use BigQuery's legacy SQL dialect for this query. If set to false, the query will use BigQuery's standard SQL. * @default false */ useLegacySql?: boolean | Expression; /** Whether all integer values will be returned as numbers. If set to false, all integer values will be returned as strings. * @default false */ returnAsNumbers?: boolean | Expression; /** Use <a href="https://cloud.google.com/bigquery/docs/parameterized-queries#using_structs_in_parameterized_queries" target="_blank">parameterized queries</a> to prevent SQL injections. Positional arguments are not supported at the moment. This feature won't be available when using legacy SQL. * @displayOptions.hide { /options.useLegacySql: [true] } * @default {"namedParameters":[{"name":"","value":""}]} */ queryParameters?: { /** Named Parameter */ namedParameters?: Array<{ /** Name of the parameter */ name?: string | Expression | PlaceholderValue; /** The substitute value. It must be a string. Arrays, dates and struct types mentioned in <a href="https://cloud.google.com/bigquery/docs/parameterized-queries#using_structs_in_parameterized_queries" target="_blank">the official documentation</a> are not yet supported. */ value?: string | Expression | PlaceholderValue; }>; }; /** Batch Size * @default 100 */ batchSize?: number | Expression; /** Whether to gnore row values that do not match the schema * @default false */ ignoreUnknownValues?: boolean | Expression; /** Whether to skip rows with values that do not match the schema * @default false */ skipInvalidRows?: boolean | Expression; /** Create a new table based on the destination table and insert rows into the new table. The new table will be named <code>{destinationTable}{templateSuffix}</code> */ templateSuffix?: string | Expression | PlaceholderValue; /** Unique ID for the request, for debugging only. It is case-sensitive, limited to up to 36 ASCII characters. A UUID is recommended. */ traceId?: string | Expression | PlaceholderValue; }; /** * Whether to insert the input data this node receives in the new row * @displayOptions.show { resource: ["database"], operation: ["insert"] } * @default autoMap */ dataMode?: 'autoMap' | 'define' | Expression; /** * Fields to Send * @displayOptions.show { dataMode: ["define"], resource: ["database"], operation: ["insert"] } * @default {} */ fieldsUi?: { /** Field */ values?: Array<{ /** Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a> */ fieldId?: string | Expression; /** Field Value */ fieldValue?: string | Expression | PlaceholderValue; }>; }; } export interface GoogleBigQueryV21Credentials { googleApi: CredentialReference; googleBigQueryOAuth2Api: CredentialReference; } interface GoogleBigQueryV21NodeBase { type: 'n8n-nodes-base.googleBigQuery'; version: 2.1; credentials?: GoogleBigQueryV21Credentials; } export type GoogleBigQueryV21ParamsNode = GoogleBigQueryV21NodeBase & { config: NodeConfig; }; export type GoogleBigQueryV21Node = GoogleBigQueryV21ParamsNode;