# Zephyr.toml: Define the Tables Structure

The `zephyr.toml` is a crucial part of the newer versions of the Zephyr client-side tooling. The file is used to define the zephyr-related configurations of your rust crate. More specifically it defines the tables that your ingestion program will read from or write to during the execution. Besides the tables, you'll also have to define the columns for each of the tables you declare.

## Choosing a Table's Structure

How can we define Zephyr tables then? Zephyr tables are effectively translated to PostgreSQL tables under the hood (that is, on the host server). In light of this, we recommend following a layout that is SQL-efficient.&#x20;

Let's follow a simple example of how a `zephyr.toml` file with multiple tables would look:

{% code title="zephyr.toml" %}

```rust
name = "feedback-indexer"


// first table
[[tables]]
name = "feedback"

[[tables.columns]]
name = "source"
col_type = "BYTEA"

[[tables.columns]]
name = "hash"
col_type = "BYTEA"

[[tables.columns]]
name = "text"
col_type = "BYTEA"

[[tables.columns]]
name = "votes"
col_type = "BYTEA"


// second table
[[tables]]
name = "score"

[[tables.columns]]
name = "source"
col_type = "BYTEA"

[[tables.columns]]
name = "upvote"
col_type = "BYTEA"
```

{% endcode %}

At the top of the file we always define the name of the program (this example is taken from the [onchain-stellar-complaints indexer](https://github.com/xycloo/onchain-stellar-complaints) example). Next, we have two tables. First, we define for each table the table name, and then we specify the columns one by one.

## Table Naming

For what concerns naming, we are currently leveraging the ease of packing string-alike objects into integers through Sorban symbols, i.e. we are using symbols for table and column names. This means that table/column names can only be up to 9 characters, and that supported characters are `a-zA-Z0-9_`.

This means that table names will likely have to be abbreviated: `"current_sequence"` won't work while `"curr_seq"` will.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mercurydata.app/zephyr-full-customization/learn/database-interactions/zephyr.toml-define-the-tables-structure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
