Convex Setup Guide In Dev
Follow our setup guide to connect Fivetran to Convex as a destination.
NOTE: This destination is partner-built. For any questions related to the Convex destination and its documentation, refer to Convex's support team. For SLA details, see Convex's Status and Guarantees documentation.
Prerequisites
To connect your Convex deployment to Fivetran, you need the following:
- A Convex account.
- A Convex deployment. See Convex's documentation to get started.
- Your Convex deployment's URL (e.g.,
https://jaded-raven-991.convex.cloud
). - Your Convex deployment's deploy key. You can find both the deployment URL and deploy key on the Production Deployment Settings page.
Setup instructions
Find your deployment credentials
- Go to your deployment on the Convex Dashboard.
- Go to the Production Deployment Settings.
- Find your deployment URL and deploy key and make a note of them. You will need them to configure Fivetran.
Complete Fivetran configuration
- Log in to your Fivetran account.
- Go to the Destinations page and click Add destination.
- Enter a Destination name of your choice and then click Add.
- Select Convex as the destination type.
- Enter your deployment credentials.
- Click Save & Test. Fivetran tests and validates connection to your Convex deployment.
Using Convex destination with a source connector
- In your Fivetran dashboard, click Connectors > Add Connector.
- Select and configure a data source of your choice.
- Select the Convex destination you connected to.
- Start your initial sync by clicking Sync Now.
- The initial sync may fail with a user action to update convex/schema.ts. Follow the instructions in the error message to update your
schema.ts
. The error message will give you code to copy-paste into yourschema.ts
. It may take around 20 minutes for the error to appear. - Deploy your
schema.ts
withnpx convex deploy
. - Retry your initial sync by clicking Sync Now.
The example below is a sample schema.ts
for a source with a single table email.cars
.
import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";
const fivetranTables = {
email_cars: defineTable({
description: v.union(v.string(), v.null()),
fivetran: v.object({
columns: v.object({
directory: v.union(v.string(), v.null()),
file: v.union(v.string(), v.null()),
line: v.union(v.int64(), v.null()),
modified: v.union(v.float64(), v.null()),
}),
synced: v.float64(),
}),
make: v.union(v.string(), v.null()),
model: v.union(v.string(), v.null()),
price: v.union(v.float64(), v.null()),
year: v.union(v.int64(), v.null()),
})
.index("by_fivetran_synced", ["fivetran.synced"])
.index("by_primary_key", [
"fivetran.columns.directory",
"fivetran.columns.file",
"fivetran.columns.line",
"fivetran.columns.modified",
]),
};
export default defineSchema({
...fivetranTables,
});
Related articles
description Destination Overview