Managing pipes

The following methods allow you to fetch information about the available pipes in your account and/or specific information about them.

Listing pipes

The pipes() method returns the list of pipes the used token has access to (any kind of access), SCOPE:READ or SCOPE:APPEND.

pipes()
//norun
let tinyb = tinybird('<token>')
console.log(await tinyb.pipes())

Getting pipe information

The info() returns information for a specific pipe.

info()
const tinyb = tinybird('<token>')
const { pipes, error } = await tinyb.pipes()
if (pipes.length !== 0) {
    const pipeName = pipes[0]['name']
    console.log(await tinyb.pipe(pipeName).info())
} else {
    console.log(error || `you don't have any pipe in you account`)
}

Getting pipe schema

The schema() returns the schema for a specific pipe. It contains an array called .columns with the name, type and whether the column accepts null values or not (nullable field).

schema()
let tinyb = tinybird('<token>')
console.log(await tinyb.pipe('<pipe>').schema())

Deleting a pipe

delete() drops the pipe. This action can’t be undone.

delete()
//norun
let tinyb = tinybird('<token>')
await tinyb.pipe('<pipe>').delete()