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.
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:
connections
: Contains connection files.copies
: Contains the copy pipes.datasources
: Contains the data sources.endpoints
: Contains the endpoint pipes.fixtures
: Contains test fixtures and test data.infra
: Contains the infrastructure files. See tb infra.materializations
: Contains materialized views.pipes
: Contains non-published pipes.sinks
: Contains sinks.tests
: Contains the test suites.
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¶
- Learn about datasource files.
- Learn about connection files.
- Learn about pipe files.