Set your Polytomic API key as an environment variable:
This example covers three steps:
The following request creates a MySQL Connection. See the connection configuration reference for the required fields.
Next, create a model over the customers table on the MySQL Connection.
First, use the source endpoint to list the tables available on the Connection:
The response will look like:
Drill into each level with query parameters — for example, ?table=company.accounts. In this case, requires_one_of on table is null, so no further drill-down is needed.
Now create a model over company.customers:
Replace YOUR-CONNECTION-ID with the Connection ID returned in Step 1.
Next, create a sync from the customer model to a new Snowflake target.
Create a Snowflake Connection to use as the sync target:
Targets enumerate the same way sources do:
The response will look like:
Drill down recursively using the requires_one_of field. For example:
The response will look like:
The schema level requires a table. Enumerate tables by adding another query parameter:
The response will look like:
Finally, query the available fields on the target. POST to the fields endpoint for the target resource:
The response lists the available sync modes and every field on the target along with its metadata. For example:
Map fields from the source model to the target and create the sync: