Adding table prefixes

How can I add a certain prefix to a set of tables?

Great question! You can add your prefix to the destination in the Tables screen under the advanced setting of a data source. The field should be based on a column in the data source that has info about which table this row should go to. This changes per data source.

We’ll take MySQL as an example.

In the MySQL source, a column named __tablename is created with the name of the original table of the row. We can now use this column as a variable in the destination field.

This should be done like so (including the curly brackets):

your_prefix_{__tablename}

The __tablename variable is a column in the data the MySQL data source fetches. You can put any field in the curly brackets and the tables will be named after the values in this field. Then the rows will be ingested to the table they belong in.

Note: You should use fields that have a small number of distinct values so you don’t create a different table for every row.