New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@sdairs/tinybird-trigger-tasks

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sdairs/tinybird-trigger-tasks

A collection of [trigger.dev](https://trigger.dev) task implementations for Tinybird APIs.

latest
npmnpm
Version
0.2.2
Version published
Maintainers
0
Created
Source

@sdairs/tinybird-trigger-tasks

A collection of trigger.dev task implementations for Tinybird APIs.

Installation

npm install @sdairs/tinybird-trigger-tasks
# or
yarn add @sdairs/tinybird-trigger-tasks
# or
pnpm add @sdairs/tinybird-trigger-tasks

Tasks

Query

The Query task executes a SQL query using the Query API.

Copy

The Copy task executes an on-demand Copy job using the Copy API.

Usage

You can provide your Tinybird API token either through the environment variable TINYBIRD_TOKEN or directly in the task payload.

Copy Task

To run a Copy with no params:

import { tinybirdCopyTask } from '@sdairs/tinybird-trigger-tasks';

const copyResult = await tinybirdCopyTask.triggerAndWait({ 
  pipeId: "YOUR_COPY_PIPE_ID",
  token: "YOUR_TOKEN" // Optional if TINYBIRD_TOKEN env var is set
});

To run a Copy with params:

const copyWithParamResult = await tinybirdCopyTask.triggerAndWait({ 
  pipeId: "YOUR_COPY_WITH_PARAM_ID", 
  params: { test_int: "7" },
  token: "YOUR_TOKEN" // Optional if TINYBIRD_TOKEN env var is set
});

Query Task

To run a Query with no params:

import { tinybirdQueryTask } from '@sdairs/tinybird-trigger-tasks';

const queryResult = await tinybirdQueryTask.triggerAndWait({ 
  sql: "SELECT * FROM table",
  token: "YOUR_TOKEN" // Optional if TINYBIRD_TOKEN env var is set
});

To run a Query with params:

const paramResult = await tinybirdQueryTask.triggerAndWait({ 
  sql: "% SELECT * FROM my_ds WHERE number == {{Int8(test_int)}}", 
  params: { test_int: "7" },
  token: "YOUR_TOKEN" // Optional if TINYBIRD_TOKEN env var is set
});

FAQs

Package last updated on 05 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts