Datafiles

Datafiles describe your Tinybird resources, like data sources, pipes, and so on. They're the source code of your project.

You can use datafiles to manage your projects as source code and take advantage of version control. Tinybird CLI helps you produce and push datafiles to the Tinybird platform.

This is an experimental version of Tinybird. Join #forward in our Slack community to share your feedback.

Folder structure

Tinybird projects are organized in a folder structure that helps you organize the source for each resource type.

The datafiles that you generate when you run tb create are organized in the following folders:

The following example shows a typical tinybird project folder structure that includes subfolders for supported types:

Example file structure
.
├── .tinyb
├── connections
├── copies
├── datasources
│   └── user_actions.datasource
├── endpoints
│   ├── user_actions_line_chart.pipe
│   └── user_actions_total_widget.pipe
├── fixtures
│   ├── user_actions.prompt
│   └── user_actions_d1046873.ndjson
├── infra
│   └── aws
│       ├── config.json
│       ├── k8s.yaml
│       └── main.tf
├── materializations
├── pipes
├── sinks
└── tests
    └── user_actions_line_chart.yaml

The .tinyb file contains the Tinybird project configuration, including the authentication token obtained by running tb login. See .tinyb file.

Types of datafiles

Tinybird uses the following types of datafiles:

  • Datasource files (.datasource) represent data sources. See Datasource files.
  • Pipe files (.pipe) represent pipes of various types. See Pipe files.

Syntactic conventions

Datafiles follow the same syntactic conventions.

Casing

Instructions always appear at the beginning of a line in upper case. For example:

Basic syntax
COMMAND value
ANOTHER_INSTR "Value with multiple words"

Multiple lines

Instructions can span multiples lines. For example:

Multiline syntax
SCHEMA >
    `d` DateTime,
    `total` Int32,
    `from_novoa` Int16

Comments

You can add comments using the # character. For example:

# This is a comment
COMMAND value

Next steps